# Register now to access 7 million high quality study materials (What's Course Hero?) Course Hero is the premier provider of high quality online educational resources. With millions of study documents, online tutors, digital flashcards and free courseware, Course Hero is helping students learn more efficiently and effectively. Whether you're interested in exploring new subjects or mastering key topics for your next exam, Course Hero has the tools you need to achieve your goals.

21 Pages

### h7

Course: CS 182, Fall 2008
School: Purdue
Rating:

Word Count: 13039

#### Document Preview

Homework [50] 7: Basic Number Theory [10] Show that if a &gt; b 0, then gcd(a, b) = gcd(a b, b). [10] Compute 61531 mod 713. [10] Show that 15 is an inverse of 7 modulo 26. [10] Solve 5x = 11 mod 17. [10] the Encrypt message ATTACK using the RSA system with n = 43 59 and e = 13, translating each letter into integers (where A = 00, B = 01, . . . Z = 25) and grouping pairs of integers, as we did in class.

Register Now

#### Unformatted Document Excerpt

Coursehero >> Indiana >> Purdue >> CS 182

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Homework [50] 7: Basic Number Theory [10]...
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Purdue - CS - 182
[50] Homework 7: Basic Number Theory [10] Show that if a &gt; b 0, then gcd(a, b) = gcd(a b, b). [10] Compute 61531 mod 713. [10] Show that 15 is an inverse of 7 modulo 26. [10] Solve 5x = 11 mod 17. [10] Encrypt the message ATTACK using the RSA syste
Purdue - CS - 182
[50] Homework 8: Counting [10] How many ways are there to seat 18 people around a circular table, where seatings are considered to be the same if they can be obtained from each other by rotating the table? Justify your answer. [10] How many ordered p
Purdue - CS - 182
[40] Homework 9: Discrete Probability [10] Prove Booles inequality, namely, for events E1 , . . . , En we have P (E1 E2 . . . En ) P (E1 ) + P (E2 ) + + P (En ).[10] What is the probability that a die never comes up an odd number when rolled
Purdue - CS - 182
[40] Homework 9: Discrete Probability [10] Prove Booles inequality, namely, for events E1 , . . . , En we have P (E1 E2 . . . En ) P (E1 ) + P (E2 ) + + P (En ).[10] What is the probability that a die never comes up an odd number when rolled
Purdue - CS - 182
Module 1: Basic Logic Theme 1: PropositionsEnglish sentences are either true or false or neither. Consider the following sentences: 1. Warsaw is the capital of Poland. 2. .3. How are you? The first sentence is true, the second is false, while th
Purdue - CS - 182
Module 3: Proof TechniquesTheme 1: Rule of InferenceLet us consider the following example. Example 1: Read the following &quot;obvious&quot; statements: All Greeks are philosophers. Socrates is a Greek. Therefore, Socrates is a philosopher. This conclusion s
Purdue - CS - 182
Module 4: Mathematical InductionTheme 1: Principle of Mathematical InductionMathematical induction is used to prove statements about natural numbers. As students may remember, we can write such a statement as a predicate set of natural numbers wher
Purdue - CS - 182
Module 5: Basic Number TheoryTheme 1: DivisionGiven two integers, sayand , the quotientmay or may not be an integer (e.g., but ). Number theory concerns the former case, and discovers criteria upon which one candecide about divisibility
Purdue - CS - 182
Module 8: Trees and GraphsTheme 1: Basic Properties of TreesA (rooted) tree is a finite set of nodes such that there is a specially designated node called the root. the remaining nodes are partitioned into sets is a tree. The sets disjoint s
Purdue - CS - 250
Appendix 1Lab Exercises For A Computer Architecture CourseA1.1 IntroductionThis Appendix presents a set of lab exercises for an undergraduate computer architecture course. The labs are designed for students whose primary educational goal is learn
Purdue - CS - 250
Appendix 1Lab Exercises For A Computer Architecture CourseA1.1 IntroductionThis Appendix presents a set of lab exercises for an undergraduate computer architecture course. The labs are designed for students whose primary educational goal is learn
Purdue - CS - 250
--Sec. A1.7Lab Exercises337Lab 1Introduction And Account ConfigurationPurposeTo learn about the lab and set up a computer account for use in lab during the semester.Background Reading And PreparationRead about the bash shell availabl
Purdue - CS - 250
--Sec. A1.7Lab Exercises337Lab 1Introduction And Account ConfigurationPurposeTo learn about the lab and set up a computer account for use in lab during the semester.Background Reading And PreparationRead about the bash shell availabl
Purdue - CS - 250
--Lab Exercises339Lab 2Digital Logic: Use Of A BreadboardPurposeTo learn how to wire a basic breadboard and use an LED to test the operation of a gate.Background Reading And PreparationRead Chapter 2 to learn about basic logic gates an
Purdue - CS - 250
--Lab Exercises339Lab 2Digital Logic: Use Of A BreadboardPurposeTo learn how to wire a basic breadboard and use an LED to test the operation of a gate.Background Reading And PreparationRead Chapter 2 to learn about basic logic gates an
Purdue - CS - 250
Purdue - CS - 250
Purdue - CS - 250
--Lab Exercises343Lab 4Digital Logic: Clocks And DemultiplexingPurposeTo understand how a clock controls a circuit and allows a series of events to occur.Background Reading And PreparationRead Chapter 2 to learn about basic logic gates
Purdue - CS - 250
--Lab Exercises343Lab 4Digital Logic: Clocks And DemultiplexingPurposeTo understand how a clock controls a circuit and allows a series of events to occur.Background Reading And PreparationRead Chapter 2 to learn about basic logic gates
Purdue - CS - 250
--Lab Exercises345Lab 5Representation: Testing Big Endian Vs. Little EndianPurposeTo learn how the integer representation used by the underlying hardware affects programming and data layout.Background Reading And PreparationRead Chapte
Purdue - CS - 250
--Lab Exercises345Lab 5Representation: Testing Big Endian Vs. Little EndianPurposeTo learn how the integer representation used by the underlying hardware affects programming and data layout.Background Reading And PreparationRead Chapte
Purdue - CS - 250
--Lab Exercises347Lab 6Representation: A Hex Dump Program In CPurposeTo learn how values in memory can be presented in hexadecimal form.Background Reading And PreparationRead Chapter 3 on data representation, and find both the integer
Purdue - CS - 250
--Lab Exercises347Lab 6Representation: A Hex Dump Program In CPurposeTo learn how values in memory can be presented in hexadecimal form.Background Reading And PreparationRead Chapter 3 on data representation, and find both the integer
Purdue - CS - 250
--Lab Exercises349Lab 7Processors: Learn A RISC Assembly LanguagePurposeTo gain first-hand experience with an assembly language and understand the oneto-one mapping between assembly language instructions and machine instructions.Backgro
Purdue - CS - 250
--Lab Exercises349Lab 7Processors: Learn A RISC Assembly LanguagePurposeTo gain first-hand experience with an assembly language and understand the oneto-one mapping between assembly language instructions and machine instructions.Backgro
Purdue - CS - 250
--Lab Exercises351Lab 8Processors: Function That Can Be Called From CPurposeTo learn how to write an assembly language function that can be called from a C program.Background Reading And PreparationRead Chapter 8 to learn about subrout
Purdue - CS - 250
--Lab Exercises351Lab 8Processors: Function That Can Be Called From CPurposeTo learn how to write an assembly language function that can be called from a C program.Background Reading And PreparationRead Chapter 8 to learn about subrout
Purdue - CS - 250
--Lab Exercises353Lab 9Memory: Row-Major And Column-Major Array StoragePurposeTo understand storage of arrays in memory and the difference between row-major order and column-major order.Background Reading And PreparationRead Chapters 9
Purdue - CS - 250
--Lab Exercises353Lab 9Memory: Row-Major And Column-Major Array StoragePurposeTo understand storage of arrays in memory and the difference between row-major order and column-major order.Background Reading And PreparationRead Chapters 9
Purdue - CS - 250
--Lab Exercises355Lab 10Input / Output: A Buffered I/O LibraryPurposeTo learn how buffered I/O operates and to compare the performance of buffered and unbuffered I/O.Background Reading And PreparationRead Chapters 13 through 15 to lear
Purdue - CS - 250
--Lab Exercises355Lab 10Input / Output: A Buffered I/O LibraryPurposeTo learn how buffered I/O operates and to compare the performance of buffered and unbuffered I/O.Background Reading And PreparationRead Chapters 13 through 15 to lear
Purdue - CS - 250
--Lab Exercises357Lab 11A Hex Dump Program In Assembly LanguagePurposeTo gain experience coding assembly language.Background Reading And PreparationReview Chapters 4 through 6, Chapter 8, and assembly language programs written in earli
Purdue - CS - 250
--Lab Exercises357Lab 11A Hex Dump Program In Assembly LanguagePurposeTo gain experience coding assembly language.Background Reading And PreparationReview Chapters 4 through 6, Chapter 8, and assembly language programs written in earli
Purdue - CS - 381
Purdue - CS - 381
\Things to Know.&quot; Existential Quanti er: There exists an x such that P(x) is true. Universal Quanti er: Binomial Coe cient: Product: Sum: Logarithm De nition(9x)P (x) For all x, P(x) is true. (8x)P (x) The number of m-combinations of a set of n dist
Purdue - CS - 381
Purdue - CS - 381
Purdue - CS - 381
Solution to Homework 1Stirlings Approximation Part 1: logk k=1The graph at the back represents the above function. The graph does not look much like a logarithmic curve. Looks more like nlogn. Plotting the curve for nlogn gives a good approximati
Purdue - CS - 381
Purdue - CS - 381
Purdue - CS - 381
Homework #2Problem 1:Prove that:n k1 1) 1 k (k11 n1Proving for basis: Put k = 1 in L.H.S:k = 1 and n = 11 1(1 1)Put n = 1 in R.H.S:1 2 1 211 11L.H.S = R.H.S , hence true for basis. Assume true for n and prove for n + 1,n1 k
Purdue - CS - 381
Purdue - CS - 381
Purdue - CS - 381
1)nln n or ln nn both take ln ln nln n = ln n * ln n = (ln n)2 ln lnn = n (ln ln n) ( ln n )2 n n ( ln ln n ) ( ln n )2 lim n n ( ln ln n ) lim lim ( t2 ) t t ( e ln t )2t = lim t t t e / t + e ln t( 2t ) 2 =lim t t ( e ln t +t e/ e / t +
Purdue - CS - 381
Purdue - CS - 381
Purdue - CS - 381
1. T (n) = 3T (n 1) + 2 = 3(3T (n 2) + 2) + 2 = 3 2 T (n 2) + 3 2 + 2 = 3 2 (3T (n 3) + 2) + 3 2 + 2 = 33 T (n 3) + 3 2 2 + 3 2 + 2 This can be generalized to: T ( n) = 3 i T ( n i ) + 2 3 jj =0 i 1This is trivially true for i = 1. Now s
Purdue - CS - 381
Purdue - CS - 381
Purdue - CS - 381
1.Divide-and-conquer, binary search, sorted array A, # of element is N. Basic idea : N Find middle element of array A with index ] . 2 3 case : N N case 1 : A ] =] 2 2 N case 2 : A ] &lt; 2 N case 3 : A ] &gt; 2 N ]2 N ]2 , find. Return 1. (found) N ]2 N
Purdue - CS - 381
1.Divide-and-conquer, binary search, sorted array A, # of element is N. Basic idea : N Find middle element of array A with index ] . 2 3 case : N case 1 : A ] 2 N case 2 : A ] 2 N =] 2 &lt; N ]2 N ]2 , find. Return 1. (found) N ]2 N ]2, recursive on
Purdue - CS - 381
F2A4B1 4 3 2 6 3 36 5 7 E 2 D
Purdue - CS - 381
F2A4B1 4 3 2 6 3 36 5 7 E
Purdue - CS - 381
Homework 61. T = t1t 2 t 3 .t n P = p1 p 2 p3 . p m Simple solution : O(nm)time Try every t i as a starting po int .Efficient algorithm: For example: T=x y y x z xy y x y y x z \ | | | | comparison failed here. / P=x y y x yy z x yy xyy z | secon
Purdue - CS - 250
Basics Chapter 1 Introduction and OverviewCS250 - Part 11Dr. Rajesh Subramanyan, 2005Importance Of Architecture Why should software folks study hardware ? To write smaller, faster code, less prone to errors Appreciate relative cost of ope
Purdue - CS - 250
Basics Chapter 2 Digital LogicCS250 - Part 11Dr. Rajesh Subramanyan, 2005Topics Flip-Flops Binary Counters ClocksCS250 - Part 1Voltage And Current Transistor Logic Gates Symbols Used For Gates Interconnection Of Gates IC Chips Co
Purdue - CS - 250
Basics Chapter 3 Data And Program RepresentationCS250 - Part 11Dr. Rajesh Subramanyan, 2005Topics Binary Arithmetic Hexadecimal Notation Notation For Constants Character Sets Unsigned Integers, Overow, And Underow Bits, Bytes Byte Si
Purdue - CS - 250
Processors Chapter 4The Variety Of Processors And Computational EnginesCS250 - Part II1Dr. Rajesh Subramanyan, 2005Topics Coprocessors Microcontrollers Microsequencers Range Of Processors Hierarchical Structure And Computational En
Purdue - CS - 250
Processors Chapter 5 Processor Types And Instruction SetsCS250 - Part II1Dr. Rajesh Subramanyan, 2005Topics Instruction set and representation Opcodes, Operands and results Typical instruction format Variable-length vs xed-length ins
Purdue - CS - 250
Processors Chapter 6 Operand Addressing And Instruction RepresentationCS250 - Part II1Dr. Rajesh Subramanyan, 2005Topics Opearand Values Two Operands Per Instruction Three Operands Per Instruction One Operand Per Instruction Introductio
Purdue - CS - 250
Processors Chapter 6 CPUs: Microcode, Protection, And Processor ModesCS250 - Part II1Dr. Rajesh Subramanyan, 2005Topics Changing modes Privelage and protection Backward compatability Modes of execution CPU complexity A central processo