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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
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 . To decode a message, you need to know the encryption method and the
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/15/2008 for the course CS 103A taught by Professor Plummer,r during the Fall '07 term at Stanford.

Page1 / 5

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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online