cse101_10_3_11

cse101_10_3_11 - Primality vs factoring 1. Primality...

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

View Full Document Right Arrow Icon
Primality vs factoring 1. Primality testing a. Given a number N, determine whether it is prime. b. Fermat’s little theorem: if p is prime, then a p-1 (mod p) for all 1 <=a < p. P = 7 is prime. So Fermat’s thm: 1 6 === 1 (mod 7) 2 6 === 1 3 6 === 1 Etc. c. Idea for a Primality tester: Given a number N. pick some a -> is a n-1 === 1 (mod N)? if yes, output = prime. if no, output composite. Problem: if N is prime, it will pass Fermat’s test. But even a composite N might pass the test. Eg. N = 341 = 11*13 composite. 2 340 = (2 10 ) 34 mod 341 = 1. d. It turns that there are just three possibilities for N: d.i. N is prime and a N-1 === 1 (mod N) for all 1 <= a <N. d.ii. N is composite and a N-1 (mod N) for all 1 <= a < N. Such N are called cormichael numbers – exceeding rare and can be detected separately. So we’ll just ignore them. d.iii. N is composite and at least half the possible values of 1 <= a < N will have a N-1 !=== (mod N) but whether it passes Fermat’s test e. Randomized algorithm
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/09/2012 for the course CSE 101 taught by Professor Staff during the Spring '08 term at UCSD.

Page1 / 2

cse101_10_3_11 - Primality vs factoring 1. Primality...

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

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