{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# HO25 - Maggie Johnson CS103A Handout#25 Applications of...

This preview shows pages 1–3. Sign up to view the full content.

Maggie Johnson Handout #25 CS103A Applications of Number Theory Key topics: Pseudorandom Numbers Cryptology Some Additional Results: Euler’s Theorem RSA and Public Key Cryptography Given two different positive integers a and b, their arithmetic mean = (a+b)/2 and their geometric mean is sqrt(ab). Compare the arithmetic and geometric means for several cases and define a theorem for how they compare. Then, prove the theorem. Write the numbers 1, 2, … 2n on a piece of paper where n is odd. Pick any two numbers j and k, and write |j – k| on the paper, and erase j and k. Continue this process until only one number is left. Prove that remaining integer must be odd.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Pseudorandom Numbers We frequently need to use random numbers in programming. There are many different methods for generating numbers that have properties of randomly chosen numbers. Because numbers generated by deterministic methods are not really random, we call them pseudorandom numbers. A commonly used method for generating pseudorandom numbers uses congruences. Four integers are defined: a) modulus m b) multiplier a c) increment i d) seed value y 0 These values conform to the following conditions: 2 ≤ a < m 0 ≤ i < m 0 ≤ y 0 < m The sequence of “random” numbers is generated, denoted y n , with 0 ≤ y n < m for all n by applying the following congruence: y n+1 = (ay n + i) mod m If there is a requirement for the numbers to be between 0 and 1, just divide the each y n by m. For example, choose y 0 = 3, a = 4, i = 1, m = 7. We get the following sequence for y n . y 1 = ((4 *3) + 1) mod 7 = 6 y 2 = ((4 *6) + 1) mod 7 = 4 y 3 = ((4 *4) + 1) mod 7 = 3 y 4 = ((4 *3) + 1) mod 7 = 6 y 5 = ((4 *6) + 1) mod 7 = 4 With this combination of values, we begin to repeat the sequence after only three iterations. Larger values will produce longer sequences before repeating. Cryptology Cryptology is the study of encryption and decryption. We write a message, apply encryption to obtain a coded message, transmit the coded message, and then apply decryption to reveal the message at the destination. The original message is called plaintext and the encrypted message is called ciphertext . To encode a message you need a method of encryption and an encryption key .
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern