Prime Numbers. Difficulties in Factoring a Number: from the Perspective of Computation. Computation Theory. Turing Machine 電 腦 安 全

Size: px
Start display at page:

Download "Prime Numbers. Difficulties in Factoring a Number: from the Perspective of Computation. Computation Theory. Turing Machine 電 腦 安 全"

Transcription

1 Prime Numbers Difficulties in Factoring a Number: from the Perspective of Computation 電 腦 安 全 海 洋 大 學 資 訊 工 程 系 丁 培 毅 Prime number: an integer p> that is divisible only by and itself, ex., 3, 5, 7,, 3, 7 Composite number: an integer n> that is not prime; can be expressible as a product a b of integers with < a, b< n; the prime factorization of n is unique Fact: there are infinitely many prime numbers. (by Euclid) Prime Number Theorem: the number of primes less than x, π(x) x/ln x How difficult is it to certify a prime number? How difficult is it to factor a composite number? Computation Theory Turing Machine Complexity Theory: central problem What makes some problems computationally hard and others easy? major achievements. Schemes for classifying problems of different computational difficulties. Options in confronting a difficult problem What is the most difficult part of a problem? Can we alter this part to avoid that problem? ComplexityComputability Are there sub-optimal or heuristic solutions to a problem? Theory Theory What kind of instance of a problem is hard? Is there a randomized computable algorithm for a problem? Automata Computability Theory: Theory central problem What is computable? What is not computable? in what model? major achievements. Theoretical models of computers (ex. LBA, DTM, NTM, ). Classify problems as solvable or non-solvable Automata Theory: definitions and properties of mathematical models of computation Finite automata: text processing, compilers, H/W design Push down automata: programming language, artificial intelligence 3 Complexity / Computability is defined w.r.t. a certain model of computation state read/write head Turing Machine Alan Turing, 936 d a c b a Similar to finite automaton but with an unlimited and unrestricted memory Formally, a 7-tuple (Q, Σ, Γ, δ, q 0, q accept, q reject ). Q is the set of states. Σ is the input alphabet not containing the special blank symbol 3. Γ is the tape alphabet, where Γand Σ Γ 4. δ: Q Γ Q Γ {L, R} is the transition function 5. q 0 Q is the initial state 6. q accept Q is the accept state 7. q reject Q is the reject state, where q reject q accept 4

2 Turing Machine (cont d) TM computes as follows: M s input w = w w w n Σ * on the leftmost n squares of the tape, the rest of the tape are blanks (the first marks the end) Initial state is q 0 read/write head starts on the leftmost square Computation proceeds according to the transition function δ If M tries to move its head to the left off the left hand end of the tape, the read/write head stays at the same place for that move state The computation continues until it enters either the accept or reject state. If neither occurs, M goes on forever. d read/write head a c b a 5 DTM vs. NTM Deterministic Turing Machine: at any time, a DTM knows its next configuration (the state, the tape head, the tape content) for sure; a single configuration specified by its transition function δ: Q Γ Q Γ {L, R} Non-deterministic Turing Machine: at each moment, an NTM has several choices to proceed as the next configurations. i.e. the range of the transition function is modified to be a set: δ: Q Γ P (Q Γ {L, R}) NTM has two equivalent evaluation ways if you only consider the capability: Process in a parallel fashion Process in a probabilistic fashion Probabilistic one seems slower. If you consider the time complexity, in polynomial time, the parallel one defines class NP, and the probabilistic one defines class BPP. Security professionals surely believe that BPP NP. NTM can be proved to be equivalent to DTM 6 Deterministic vs. Nondeterministic Many-One (Mapping) Reducibility Def: Given two problems P and Q, P is reducible to Q iff there exists a TM M τ (computable function, algorithm, program, etc) which can transform every instance in P to an instance of Q Mτ x x P x x Q x accept or reject accept or reject Properties: capture the difficulties between problems If Q is solvable, then P is also solvable If P is a well known unsolvable problem and can be reduced to Q, then Q is also unsolvable Extension: Efficient mapping reducibility - M τ is poly-time Note that an NTM decider halts on all branches. 7 8

3 Turing Reducibility There are some intuitive reducibility cases that cannot be captured by mapping reduction, e.g. A TM and A TM seem to be reducible to one another (a solution to either one could be used to solve the other by simply reversing the answer). However, A TM is not mapping reducible to A TM because it is not Turingrecognizable (find a solution to map each unacceptable <M, w> to an acceptable <M, w> is clearly not possible) Need a general notation that captures more problem reductions. Def: Given two problems P and Q, P is Turing reducible to Q iff there exists an oracle TM M A,which given an oracle A for solving problem Q, can solve every instance in P i.e. M A using A as a subroutine (a blackbox) and can invoke A for regular regular expression Language Classes context sensitive grammar regular context free grammar context free grammar push down automata (PDA) recursive recursive enumerable Not Turing recognizable, Nor co-recognizable context sensitive grammar linear bounded automata (LBA) Semi-solvable solvable (problem) Recursive enumerable recursive (language) Turing recognizable Turing decidable Turing enumerable? µ-recursive function decidable? Primitive recursive function (TM can decide)? Unrestricted grammar computable (function) (TM can semi-decide) (polynomially) many times 9 * Unsolvable means undecidable (includes semi-solvable and totally unsolvable) 0 co-turing recognizable Language Examples regular: closed under union, intersection, and complement Σ = {0, }, 0*0*, Σ*Σ*, Σ*00Σ*, (ΣΣ)*, 0 0, (0 ε)* D={w w has an equal number of occurrence of 0 and 0 as substrings}, B n ={a k where k is a multiple of n, n }, C n ={x x is a binary number that is a multiple of n} CFL: closed under union B={0 n n n 0}, C={w w has equal number of 0 s and s} D={ n n 0}, E={0 i j i j}, {0 n m 0 n m, n 0} {0 m n m n}, {a i b j c k i,j,k 0 and i=j or i=k}, {ww R w {0,}*}, {w w {0,}* and w is not a palindrome} CSL: {w w w {0,}*}, {w # w w {0,}*}, {w w w w {0,}*}, {a n b n c n n 0}, {a i b j c k 0 i j k}, {a n n 0}, {a i b j c k i j=k, i, j, k }, {#x #x # #x l x i {0,}*, x i x j, i j}, {<G> G is a connected undirected graph}, {w w is a palindrome}, Language Examples (cont d) Recursive (Turing computable, infinite tape required) or or {p p is a polynomial with two or more variables with an integral root} Hilbert s 0th E LBA, E TM, REGULAR TM, CFL TM (Rice Thm: Testing any property (ex. CS, CF, regular, finite decidable) of L(M), M is a TM, is non-decidable), ALL CFG, PCP, {incompressible strings} Recursive Enumerable (Turing recognizable) A TM, HALT TM co-turing recognizable A TM, HALT TM, EQ CFG, MIN TM, Th(N, +, ), Not Turing recognizable nor co-turing recognizable EQ TM, EQ TM, A REX, E REX, EQ REX, A NFA, E NFA, EQ NFA, A DFA, E DFA, A CFG, E CFG, A LBA

4 P: O(n k ) Complexity Classes the class of problems that can be polynomially decided by a DTM NP: polynomially decided by an NTM (has a polynomial time verifier) P NP worst case is difficult to solve, general instances might be easy witness can be verified in polynomial time BPP: polynomially decided by a probabilistic TM (a sort of NTM) BPP NP (BPP =? NP) RP: BPP with one-sided error probability (accept with error prob < /, reject with prob. ) RP BPP NP 3 Complexity Classes (cont d) EXPTIME: O( nk ) decided by a DTM in exponential time steps P NP EXPTIME n! is larger than e n ; however TSP EXPTIME NP-hard: (non-deterministic polynomial time hard) For all decision problems in NP, there is a polynomial-time many-one reduction to H, which is in NP-hard the problem H is NP-hard if for every decision problem L in NP there is an oracle machine that has an oracle for solving H and this oracle machine can solve L in polynomial time (poly-time Turing reduction) NP-complete: NP-hard NP 4 Complexity Classes (cont d) Refining Complexity Classes PSPACE: can be solved by a deterministic TM with the memory requirement a polynomial in n NPSPACE: nondeterministic TM, polynomial space P NP PSPACE=NPSPACE EXPTIME PSPACE-complete IP: IP = PSPACE EXPSPACE: exponential space is required L: sublinear space, deterministic TM NL: sublinear space, nondeterministic TM NL-complete 5 TM recognizable TM decidable NP BPP NPC P EXPTIME NPHard co-np PSPACE/IP EXPSPACE co-tm recognizable 6

5 Refining Complexity Classes NP vs. co-np Four possibilities: REX P P = NP = co-np NP = co-np P CFL P most unlikely NP might be closed under complement NL=coNL co-np P = NP co-np NP co-np NP co-np P NP most likely 7 8 NP-Complete problems CIRCUIT-SAT ALL-NPs SAT Bounded-Tiling 3SAT CLIQUE SUBSET-SUM VERTEX-COVER HAM-CYCLE TSP 9 PRIMES: Problem Definitions the problem to decide if an integer is a prime number in terms of language decidability, the language L is {the set of all prime numbers} COMPOSITES: the problem to decide if an integer is composite (i.e. not prime) PAPP: (Prime Absolute Pseudo Prime) the problem to decide if an integer passes Fermat tests to all bases (i.e. an absolute pseudoprime (Carmichael number) or a prime) FACTORING: (this is a search problem) the problem to find factors of a composite integer 0

6 Pseudoprimes Def: a pseudoprime to the base b is a composite positive integer n such that the integer b satisfies b n- (mod n) Ex. 34= 3, 56=3 7, and 645= are pseudoprimes to the base There are 455,05,5 primes less than 0 0 but only 4884 pseudoprimes to the base. There are infinitely many pseudoprimes to any given base. Note: 34 is not a pseudoprime to the base 7 Def: a Carmichael Number (an absolute pseudoprime) is a composite integer that satisfies b n- (mod n) for all positive integers b where gcd(b,n) = Pseudoprimes (cont d) Ex. 56=3 7 and 660=7 3 4 are Carmichael numbers If gcd(b, 56) = then gcd(b,3)=gcd(b,)=gcd(b,7)=. From Fermat s Little Theorem, b 3, b 0, and b 6 7. Consequently, b (b ) 80 3, b 560 (b 0 ) 56, and b (b 6 ) By CRT, b If n=q q q k, q j are distinct primes that satisfy (q j -) (n-) for all j, then n is a Carmichael number There are infinitely many Carmichael numbers. (conjectured 9 by Carmichael, proved 99 Alford, Granville and Pomerance) 43 Carmichael numbers not exceeding 0 6, and 05, of them not exceeding 0 5 Carmichael numbers cannot be distinguished from a prime number by Fermat Test with respect to any integer base PAPP Def: PAPP={p p is a prime number or an absolute pseudoprime} Claim: PAPP is a decidable problem Fermat Test a probabilistic poly-time algorithm to decide PAPP: given an integer p, step. randomly pick a < p and compute b p a p- step. if b p reject (i.e. declare p PAPP), else repeat for k times step 3. accept (declare p PAPP) otherwise This PPT algorithm decides PAPP with a one-sided error rate, Pr{Fermat Test declares x PAPP x PAPP}= -k Error Probability of the Fermat Test Lemma: for any integer n >, if n fails the Fermat test to some base a in Z n, then n fails the Fermat test to at least half of all numbers in Z n i.e. n PAPP Proof: given a Z n such that a n- n, ( i.e. a is a witness for the composite number n) we want to prove that for any non-witness h, i.e. h n- n, there exists a unique witness t such that t n- n i.e. #witnesses n/ let n = q r and gcd(q, r) = (for applying CRT) t n-. Construct t q h r a, in that case, t n- n q r i.e. t is a witness (note that we assume a n- n kr + ; otherwise construct t r h q a) Pr{Fermat Test declares x PAPP x PAPP}=0 3. if h' h then t' t from CRT, i.e. t is a distinct witness 4

7 Error Probability (cont d) The previous lemma implies that for an n PAPP if you randomly pick a number a Z n and perform the Fermat test to this base on n, you have a probability greater than 0.5 for getting a witness in Z n i.e. Pr{a single repetition of FT declares n PAPP n PAPP} / with k repetitions (each picks independently a base), Pr{Fermat Test declares n PAPP n PAPP} -k 5 Miller-Rabin Test Fermat test cannot distinguish Carmichael numbers from true prime numbers while the Miller-Rabin Test can. Miller-Rabin test for primality utilizes another number theory property: The number has exactly two square roots, and, modulo any prime number p For a composite number c, could be a Carmichael number, has four or more square roots modulo c One pass in Miller-Rabin test: if a number p passes the Fermat test to the base a, the algorithm finds one of the square roots of modulo p at random and determines whether that square root is or -. If it is not, we know that the number p is not a prime i.e. starting from p a p-, a (p-)/ is a square root of, a (p-)/4 6 Basic Factoring Principle Let n be an integer and suppose there exist integers x and y with x y (mod n), but x ±y (mod n). Then n is composite, both gcd(x-y, n) and gcd(x+y, n) are nontrivial factors of n. Proof: let d = gcd(x-y, n). Case : assume d = n x y (mod n) contradiction Case : assume d is (the trivial factor) x y (mod n) x -y = (x-y)(x+y) = k n d= means gcd(x-y, n)= n x+y x -y (mod n) contradiction Case and implies that < d < n i.e. d must be a nontrivial factor of n 7 One Pass of Miller-Rabin Primality Test Is n a composite number? Let n > be odd, write n- = k m with m being odd Choose a random integer a with < a < n- n will pass Fermat test Compute b 0 a m (mod n) n is a pseudoprime if b 0 ± (mod n), stop, n is probably prime Compute b b 0 (mod n) if b (mod n), stop, gcd(b 0 -, n) is a factor of n if b - (mod n), stop, n is probably prime Compute b b (mod n).. Compute b k- b k- (mod n) if b k- (mod n), stop, gcd(b k- -, n) is a factor of n if b k- - (mod n), stop, n is probably prime Compute b k b k- (mod n) if b k (mod n), stop, gcd(b k- -, n) is a factor of n otherwise n is composite (Fermat Little Thm, b k a n- (mod n)) 8

8 One Pass of MRP Test (cont d) In summary: there are 4 possible sorts of sequences for b 0, b, b, b i-, b i, b k : 34,, 5,,,,,, composite, factored 45, 5634, 35, 3, -,,, possibly prime ±,,,, possibly prime 4, 987,, 893, 3, 34 composite 9 Strong Pseudoprime If n passes the Miller-Rabin test with base a (without being identified as a composite), we say that n is a strong pseudoprime number to the base a. Ex. 047 is a strong pseudoprime to the base Up to 0 0, there are only 39 strong pseudoprime numbers to the base There are infinitely many strong pseudoprimes to the base There is no parallel set in strong pseudoprimes to the Carmichael numbers as to the pseudoprime. 30 Error Probability of MRP-Test Def: PRIMES = {p p is a prime number} The Miller Rabin Primality test selects a,, a k randomly in Z p, and repeats the previous square root test for k times, is a probabilistic polynomial time algorithm The maximum error probability is Pr{MR declares x PRIMES x PRIMES} = -k even stronger Pr{MR declares x PRIMES x PRIMES} = 4 -k On the other hand Pr{MR declares x PRIMES x PRIMES} = 3 Error Probability (cont d) Lemma : Pr{MR declares x PRIMES x PRIMES} = the MR algorithm rejects x only when ) a x- x and ) successive square roots of a x- ever x ; however, both cases imply that x must be a composite, contradiction with the assumption x PRIME Lemma : Pr{MR declares x PRIMES x PRIMES} = -k We want to show that if p is an odd composite number and a is selected randomly in Z p, Pr{a is a composite witness} > / i.e. we would like to demonstrate that at least as many witnesses as non-witnesses exist in Z p ; we could prove that for any non-witness h, i.e., there exists a unique witness b i.e. #witnesses>p/ 3

9 Error Probability (cont d) Ken Rose, Elementary Number Theory, 4-th Ed. A/W Thm 6.0 (in Ken. Rosen): If n is an odd composite positive integer, then n passes Miller-Rabin s test for at most (n-)/4 bases b with b n- Stronger convergence property Thm 6.: Pr{MR declares x PRIMES x PRIMES} = 4 -k Conjecture 6.: Generalized Riemann hypothesis For every composite positive integer n, there is a base b with b < (log n), such that n fails Miller-Rabin s test for the base b Error Probability (cont d) Thm 6.: If the generalized Riemann hypothesis is valid, then there is an algorithm to determine whether a positive integer n is prime using O((log n) ) bit operations One Pass of Miller-Rabin Primality Test Both of these two tests can identify subsets of composite numbers I = P C I: integers C = SPP a SPP a = PP a PP a SPP a PP a PP a SPP a C P: prime numbers SPP a PP a SPP a : strong pseudo prime numbers for base a, the set of composite n where M-T test says probably prime C: composite numbers PP a : pseudo prime numbers for base a, the set of composite : mysterious part n where a n- (mod n) not prime, but cannot be identified as composite 35 Miller-Rabin Primality Test Both of these two tests can identify subsets of composite numbers I = P C I: integers C = SPP SPP = CM CM φ =? SPP CM CM SPP C P: prime numbers SPP CM SPP: strong pseudo prime numbers for all base a, the set of composite n where M-T test says probably prime C: composite numbers CM: Carmichael numbers the set of composite n where a n- (mod n)? : mysterious part for all base a not prime, but cannot be identified as composite 36

10 Practical Question Consider a composite number n = p q, where p and q are two large prime numbers, each with k/ bits Applying Miller-Rabin test on n for k times, the probability that n is not detected as a composite is less than -k which is extremely small if k is say 04 Note that n must at least satisfy n PAPP otherwise Miller-Rabin test will factor n in the process of identifying its compositeness But there is still some chance that for some base a, n passes the Fermat test but detected by the Miller-Rabin test Is n still hard to be factored? Actually, factoring n is a hard non-poly time problem: COMPOSITES NP COMPOSITES There are several kinds of witnesses for a composite number (an instance of COMPOSITES), ex: A factor of it (one of them is enough) or A positive integer a such that a n- (mod n) or A positive integer a such that a n- (mod n) and a s j ± (mod n) and a s j+ (mod n) where n- = s k and s is an odd integer, 0 j<k actually, COMPOSITES RP BPP NP use the probabilistic Miller-Rabin algorithm to decide if a number is a composite number the error probability: If x COMPOSITES, Pr{accept x} > / GNFS: exp{(.93+o())}(ln(n)) /3 (ln(ln(n))) /3 If x COMPOSITES, Pr{reject x} = PRIMES The complement of COMPOSITES PRIMES CoNP by definition PRIMES NP There are several kinds of witnesses for a prime number (an instance of PRIMES) ex. Pratt certificate Atkin-Goldwasser-Kilian-Morain certificate PRIMES RP BPP NP use the probabilistic Miller-Rabin algorithm to decide if a number is a prime number the error probability: If x PRIMES, Pr{accept x} = If x PRIMES, Pr{reject x} > / 39 Prime Witness: Pratt Certificate By applying Fermat s little theorem converse to n and recursively to each purported factor of n-, a certificate for a given prime number n can be generated. (for prime < 0 0 ) ex. n = 799, n- = 798 = 37 07, let a = , 7 798/ 799, 7 798/37 799, 7 798/ n = is called self-witness n = 37, n- = 36 = 3, let a =, 36 37, 36/ 37, 36/3 37 n = 07, n- = 06 = 53, let a =, 06 07, 06/ 07, 06/53 07 n = 53, n- = 5 = 3 let a =, 5 53, 5/ 53, 5/3 53 n = 3, n- = = 3 let a =, 3, / 3, /3 3 n = 3, n- = = let a =, 3, / 3 40

11 Pratt Certificate: an example Atkin-Goldwasser-Kilian-Morain Certificate = = 3 06= 53 5= 3 = 3 is a self witness A recursive primality certificate: (for prime > 0 0 ) A point on an elliptic curve C y = x 3 + g x + g 3 (mod p) for some number g and g 3 A prime q with q > (p /4 + ), such that for some other number k and m=kq with k, mc(x,y,g,g3,p) is the identity on the curve, but kc(x,y,g,g 3,p) is not the identity. This guarantees primality of p by a theorem of Goldwasser and Killian (986). Each q has its recursive certificate following it. So if the smallest q is known to be prime, all the numbers are certified prime up the chain. 4 4 Related Theorems Fermat s Little Theorem Euler s Theorem Carmichael Theorem Fermat Little Theorem Converse 43 Fermat s Little Theorem If p is a prime, pfa then a p- (mod p) Proof: let S = {,, 3,, p-} (Z p* ), define ψ(x) a x (mod p) be a mapping ψ: S Z x S, ψ(x) 0 (mod p) x S, ψ(x) S, i.e. ψ: S S x, y S, if x y then ψ(x) ψ(y) since ( Fair-MAH ) if ψ(x) a x 0 (mod p) x 0 (mod p) since gcd(a, p) = if ψ(x) ψ(y) a x a y x y since gcd(a, p) = from the above two observations, ψ(), ψ(),... ψ(p-) are distinct elements of S... (p-) ψ() ψ()... ψ(p-) (a ) (a ) (a (p-)) a p- (... (p-)) (mod p) since gcd(j, p) = for j S, we can divide both side by,, 3, p-, and obtain a p- (mod p) 44

12 Fermat s Little Theorem Converse For an odd integer n, if a, a n- (mod n) and p i, where n- = Π i p i r i, a (n-)/p i (mod n) then. ord n (a) = n-. n is a prime number 3. a is a primitive in Z n * Proof: let ord n (a) be the smallest integer d such that a d n, i.e. a ord n (a) n, ord n (a) n-, let n- = k ord n (a) + r a n- n a n- n a k ord n (a)+r n n k a r r=0 i.e. ord n (a) (n-) ord n (a)=n- or p i, n-=π i p i r i s.t. ordn (a) (n-)/p i i.e. a (n-)/p i n (a ord n (a) ) k n a n- n and r p i, where n-=π i p i,a (n-)/p i i n ord n (a)=n- n is a prime number (for a composite number, the order of any a is at most φ(n), which is strictly less than n-) and a is a primitive 45 Euler s Theorem If gcd(a,n)= then a φ(n) (mod n) Proof: let S be the set of integers x n, with gcd(x, n) =, define ψ(x) a x (mod n) be a mapping ψ: S Z x S and gcd(a, n) =, ψ(x) 0 (mod n) gcd(a, n)= and gcd(x, n) = gcd(ψ(x), n) = x S, ψ(x) S, i.e. ψ: S S x, y S, if x y then ψ(x) ψ(y) (mod n) from the above two observations, x S, ψ(x) are distinct elements of S (i.e. {ψ(x) x S} is S) This is true even when n = p if ψ(x) a x 0 (mod n) x 0 (mod n) if ψ(x) ψ(y) a x a y x y since gcd(a, n) = x ψ(x) a φ(n) x (mod n) x S x S x S since gcd(x, n) = for x S, we can divide both side by x S one after another, and obtain a φ(n) (mod n) 46 Carmichael Theorem Carmichael s Theorem: a Z n*,a λ (n) (mod n) and a n λ(n) (mod n ) where n=p q, p q, λ(n) = lcm(p-, q-), λ(n) φ(n) like Euler s Theorem, we can prove it through Fermat s Little Theorem, consider n = p q, where p q, a Z p*,a p- (mod p) (a p- ) (q-)/gcd(p-,q-) a λ (n) (mod p) a Z q*,a q- (mod q) (a q- ) (p-)/gcd(p-,q-) a λ (n) (mod q) from CRT, a Z * p Z q* = Z n*, a λ (n) (mod n) therefore, a Z n*,a λ (n) = + k n raise both side to the n-th power, we get a n λ(n) = ( + k n) n, a n λ(n) = + n k n +... a Zn * (or Z n *), a n λ(n) (mod n ) 47 Primitive Roots modulo p When p is a prime number, a primitive root modulo p is a number whose powers yield every nonzero element mod p. (equivalently, the order of a primitive root is p-) ex: 3 3, 3, 3 3 6, 3 4 4, 3 5 5, 3 6 (mod 7) 3 is a primitive root mod 7 sometimes called a multiplicative generator there are plenty of primitive roots, actually φ(p-) ex. p=0, φ(p-)=00 (-/) (-/5)=40 p=43537, φ(p-)=43536 (-/) (-/897)=

13 Primitive Testing Procedure How do we test whether h is a primitive root modulo p? naïve method: go through all powers h, h 3,, h p-, and make sure modulo p faster method: assume p- has prime factors q, q,, q n, for all q i, make sure h (p-)/q i modulo p is not, then h is a primitive root Intuition: let h g a (mod p), if gcd(a, p-)=d (i.e. g a is not a primitive root), (g a ) (p-)/q i (g a/q i) (p-) (mod p) for some q i d Primitive Testing Procedure (cont d) Procedure to test a primitive g: assuming p- has prime factors q, q,, q n, (i.e. p- =q r...q r n n) for all q i, make sure g (p-)/q i (mod p) is not Proof: (a) by definition, g ord p (g) (mod p), g φ(p) (mod p) therefore ord p (g) φ(p) if φ(p) = ord p (g) * k + s with s < ord p (g) g φ(p) g ord p (g) * k g s g s (mod p), but s < ord p (g) s = 0 ord p (g) φ(p) and ord p (g) φ(p) (b) assume g is not a primitive root i.e ord p (g) < φ(p)=p- then i, such that ord p (g) (p-)/q i i.e. g (p-)/q i (mod p) for some q i (c) if for all q i, g (p-)/q i (mod p) then ord p (g) = φ(p) and g is a primitive root modulo p 49 50

Factoring & Primality

Factoring & Primality Factoring & Primality Lecturer: Dimitris Papadopoulos In this lecture we will discuss the problem of integer factorization and primality testing, two problems that have been the focus of a great amount

More information

Primality - Factorization

Primality - Factorization Primality - Factorization Christophe Ritzenthaler November 9, 2009 1 Prime and factorization Definition 1.1. An integer p > 1 is called a prime number (nombre premier) if it has only 1 and p as divisors.

More information

Complexity Classes P and NP

Complexity Classes P and NP Complexity Classes P and NP MATH 3220 Supplemental Presentation by John Aleshunas The cure for boredom is curiosity. There is no cure for curiosity Dorothy Parker Computational Complexity Theory In computer

More information

3515ICT Theory of Computation Turing Machines

3515ICT Theory of Computation Turing Machines Griffith University 3515ICT Theory of Computation Turing Machines (Based loosely on slides by Harald Søndergaard of The University of Melbourne) 9-0 Overview Turing machines: a general model of computation

More information

Lecture 2: Universality

Lecture 2: Universality CS 710: Complexity Theory 1/21/2010 Lecture 2: Universality Instructor: Dieter van Melkebeek Scribe: Tyson Williams In this lecture, we introduce the notion of a universal machine, develop efficient universal

More information

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Fall 25 Alexis Maciel Department of Computer Science Clarkson University Copyright c 25 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

More information

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009. Notes on Algebra

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009. Notes on Algebra U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009 Notes on Algebra These notes contain as little theory as possible, and most results are stated without proof. Any introductory

More information

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

CSE 135: Introduction to Theory of Computation Decidability and Recognizability CSE 135: Introduction to Theory of Computation Decidability and Recognizability Sungjin Im University of California, Merced 04-28, 30-2014 High-Level Descriptions of Computation Instead of giving a Turing

More information

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics

NP-complete? NP-hard? Some Foundations of Complexity. Prof. Sven Hartmann Clausthal University of Technology Department of Informatics NP-complete? NP-hard? Some Foundations of Complexity Prof. Sven Hartmann Clausthal University of Technology Department of Informatics Tractability of Problems Some problems are undecidable: no computer

More information

Cryptography and Network Security Number Theory

Cryptography and Network Security Number Theory Cryptography and Network Security Number Theory Xiang-Yang Li Introduction to Number Theory Divisors b a if a=mb for an integer m b a and c b then c a b g and b h then b (mg+nh) for any int. m,n Prime

More information

2.1 Complexity Classes

2.1 Complexity Classes 15-859(M): Randomized Algorithms Lecturer: Shuchi Chawla Topic: Complexity classes, Identity checking Date: September 15, 2004 Scribe: Andrew Gilpin 2.1 Complexity Classes In this lecture we will look

More information

The Halting Problem is Undecidable

The Halting Problem is Undecidable 185 Corollary G = { M, w w L(M) } is not Turing-recognizable. Proof. = ERR, where ERR is the easy to decide language: ERR = { x { 0, 1 }* x does not have a prefix that is a valid code for a Turing machine

More information

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move. CS54 Turing Machines Turing Machine q 0 AI N P U T IN TAPE read write move read write move Language = {0} q This Turing machine recognizes the language {0} Turing Machines versus DFAs TM can both write

More information

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. 3130CIT: Theory of Computation Turing machines and undecidability (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. An undecidable problem

More information

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Diagonalization Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Ahto Buldas Ahto.Buldas@ut.ee Background One basic goal in complexity theory is to separate interesting complexity

More information

Turing Machines: An Introduction

Turing Machines: An Introduction CIT 596 Theory of Computation 1 We have seen several abstract models of computing devices: Deterministic Finite Automata, Nondeterministic Finite Automata, Nondeterministic Finite Automata with ɛ-transitions,

More information

3. Computational Complexity.

3. Computational Complexity. 3. Computational Complexity. (A) Introduction. As we will see, most cryptographic systems derive their supposed security from the presumed inability of any adversary to crack certain (number theoretic)

More information

The Classes P and NP

The Classes P and NP The Classes P and NP We now shift gears slightly and restrict our attention to the examination of two families of problems which are very important to computer scientists. These families constitute the

More information

Cryptography and Network Security Chapter 8

Cryptography and Network Security Chapter 8 Cryptography and Network Security Chapter 8 Fifth Edition by William Stallings Lecture slides by Lawrie Brown (with edits by RHB) Chapter 8 Introduction to Number Theory The Devil said to Daniel Webster:

More information

Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU

Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU Birgit Vogtenhuber Institute for Software Technology email: bvogt@ist.tugraz.at office hour: Tuesday 10:30 11:30 slides: http://www.ist.tugraz.at/pact.html

More information

Is n a Prime Number? Manindra Agrawal. March 27, 2006, Delft. IIT Kanpur

Is n a Prime Number? Manindra Agrawal. March 27, 2006, Delft. IIT Kanpur Is n a Prime Number? Manindra Agrawal IIT Kanpur March 27, 2006, Delft Manindra Agrawal (IIT Kanpur) Is n a Prime Number? March 27, 2006, Delft 1 / 47 Overview 1 The Problem 2 Two Simple, and Slow, Methods

More information

Notes on NP Completeness

Notes on NP Completeness Notes on NP Completeness Rich Schwartz November 10, 2013 1 Overview Here are some notes which I wrote to try to understand what NP completeness means. Most of these notes are taken from Appendix B in Douglas

More information

Introduction to computer science

Introduction to computer science Introduction to computer science Michael A. Nielsen University of Queensland Goals: 1. Introduce the notion of the computational complexity of a problem, and define the major computational complexity classes.

More information

CS 3719 (Theory of Computation and Algorithms) Lecture 4

CS 3719 (Theory of Computation and Algorithms) Lecture 4 CS 3719 (Theory of Computation and Algorithms) Lecture 4 Antonina Kolokolova January 18, 2012 1 Undecidable languages 1.1 Church-Turing thesis Let s recap how it all started. In 1990, Hilbert stated a

More information

Lecture 13 - Basic Number Theory.

Lecture 13 - Basic Number Theory. Lecture 13 - Basic Number Theory. Boaz Barak March 22, 2010 Divisibility and primes Unless mentioned otherwise throughout this lecture all numbers are non-negative integers. We say that A divides B, denoted

More information

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Complexity Theory IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar Outline Goals Computation of Problems Concepts and Definitions Complexity Classes and Problems Polynomial Time Reductions Examples

More information

Theoretical Computer Science (Bridging Course) Complexity

Theoretical Computer Science (Bridging Course) Complexity Theoretical Computer Science (Bridging Course) Complexity Gian Diego Tipaldi A scenario You are a programmer working for a logistics company Your boss asks you to implement a program that optimizes the

More information

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification) Some N P problems Computer scientists have studied many N P problems, that is, problems that can be solved nondeterministically in polynomial time. Traditionally complexity question are studied as languages:

More information

! X is a set of strings. ! Instance: string s. ! Algorithm A solves problem X: A(s) = yes iff s! X.

! X is a set of strings. ! Instance: string s. ! Algorithm A solves problem X: A(s) = yes iff s! X. Decision Problems 8.2 Definition of NP Decision problem. X is a set of strings. Instance: string s. Algorithm A solves problem X: A(s) = yes iff s X. Polynomial time. Algorithm A runs in polytime if for

More information

Computability Theory

Computability Theory CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10.

More information

OHJ-2306 Introduction to Theoretical Computer Science, Fall 2012 8.11.2012

OHJ-2306 Introduction to Theoretical Computer Science, Fall 2012 8.11.2012 276 The P vs. NP problem is a major unsolved problem in computer science It is one of the seven Millennium Prize Problems selected by the Clay Mathematics Institute to carry a $ 1,000,000 prize for the

More information

CoNP and Function Problems

CoNP and Function Problems CoNP and Function Problems conp By definition, conp is the class of problems whose complement is in NP. NP is the class of problems that have succinct certificates. conp is therefore the class of problems

More information

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms

Page 1. CSCE 310J Data Structures & Algorithms. CSCE 310J Data Structures & Algorithms. P, NP, and NP-Complete. Polynomial-Time Algorithms CSCE 310J Data Structures & Algorithms P, NP, and NP-Complete Dr. Steve Goddard goddard@cse.unl.edu CSCE 310J Data Structures & Algorithms Giving credit where credit is due:» Most of the lecture notes

More information

Chapter 7 Uncomputability

Chapter 7 Uncomputability Chapter 7 Uncomputability 190 7.1 Introduction Undecidability of concrete problems. First undecidable problem obtained by diagonalisation. Other undecidable problems obtained by means of the reduction

More information

Computer and Network Security

Computer and Network Security MIT 6.857 Computer and Networ Security Class Notes 1 File: http://theory.lcs.mit.edu/ rivest/notes/notes.pdf Revision: December 2, 2002 Computer and Networ Security MIT 6.857 Class Notes by Ronald L. Rivest

More information

Public Key Cryptography: RSA and Lots of Number Theory

Public Key Cryptography: RSA and Lots of Number Theory Public Key Cryptography: RSA and Lots of Number Theory Public vs. Private-Key Cryptography We have just discussed traditional symmetric cryptography: Uses a single key shared between sender and receiver

More information

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm.

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. #-approximation algorithm. Approximation Algorithms 11 Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of three

More information

Lecture 7: NP-Complete Problems

Lecture 7: NP-Complete Problems IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Basic Course on Computational Complexity Lecture 7: NP-Complete Problems David Mix Barrington and Alexis Maciel July 25, 2000 1. Circuit

More information

NP-Completeness and Cook s Theorem

NP-Completeness and Cook s Theorem NP-Completeness and Cook s Theorem Lecture notes for COM3412 Logic and Computation 15th January 2002 1 NP decision problems The decision problem D L for a formal language L Σ is the computational task:

More information

Introduction to Logic in Computer Science: Autumn 2006

Introduction to Logic in Computer Science: Autumn 2006 Introduction to Logic in Computer Science: Autumn 2006 Ulle Endriss Institute for Logic, Language and Computation University of Amsterdam Ulle Endriss 1 Plan for Today Now that we have a basic understanding

More information

CSC 373: Algorithm Design and Analysis Lecture 16

CSC 373: Algorithm Design and Analysis Lecture 16 CSC 373: Algorithm Design and Analysis Lecture 16 Allan Borodin February 25, 2013 Some materials are from Stephen Cook s IIT talk and Keven Wayne s slides. 1 / 17 Announcements and Outline Announcements

More information

2 Primality and Compositeness Tests

2 Primality and Compositeness Tests Int. J. Contemp. Math. Sciences, Vol. 3, 2008, no. 33, 1635-1642 On Factoring R. A. Mollin Department of Mathematics and Statistics University of Calgary, Calgary, Alberta, Canada, T2N 1N4 http://www.math.ucalgary.ca/

More information

Automata and Formal Languages

Automata and Formal Languages Automata and Formal Languages Winter 2009-2010 Yacov Hel-Or 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,

More information

Integer Factorization using the Quadratic Sieve

Integer Factorization using the Quadratic Sieve Integer Factorization using the Quadratic Sieve Chad Seibert* Division of Science and Mathematics University of Minnesota, Morris Morris, MN 56567 seib0060@morris.umn.edu March 16, 2011 Abstract We give

More information

Lecture 13: Factoring Integers

Lecture 13: Factoring Integers CS 880: Quantum Information Processing 0/4/0 Lecture 3: Factoring Integers Instructor: Dieter van Melkebeek Scribe: Mark Wellons In this lecture, we review order finding and use this to develop a method

More information

P versus NP, and More

P versus NP, and More 1 P versus NP, and More Great Ideas in Theoretical Computer Science Saarland University, Summer 2014 If you have tried to solve a crossword puzzle, you know that it is much harder to solve it than to verify

More information

A Working Knowledge of Computational Complexity for an Optimizer

A Working Knowledge of Computational Complexity for an Optimizer A Working Knowledge of Computational Complexity for an Optimizer ORF 363/COS 323 Instructor: Amir Ali Ahmadi TAs: Y. Chen, G. Hall, J. Ye Fall 2014 1 Why computational complexity? What is computational

More information

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and Breaking The Code Ryan Lowe Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and a minor in Applied Physics. As a sophomore, he took an independent study

More information

Lecture summary for Theory of Computation

Lecture summary for Theory of Computation Lecture summary for Theory of Computation Sandeep Sen 1 January 8, 2015 1 Department of Computer Science and Engineering, IIT Delhi, New Delhi 110016, India. E- mail:ssen@cse.iitd.ernet.in Contents 1 The

More information

Reading 13 : Finite State Automata and Regular Expressions

Reading 13 : Finite State Automata and Regular Expressions CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model

More information

Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)

Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m) Chapter 23 Squares Modulo p Revised Version of Chapter 23 We learned long ago how to solve linear congruences ax c (mod m) (see Chapter 8). It s now time to take the plunge and move on to quadratic equations.

More information

24 Uses of Turing Machines

24 Uses of Turing Machines Formal Language and Automata Theory: CS2004 24 Uses of Turing Machines 24 Introduction We have previously covered the application of Turing Machine as a recognizer and decider In this lecture we will discuss

More information

Factoring Algorithms

Factoring Algorithms Factoring Algorithms The p 1 Method and Quadratic Sieve November 17, 2008 () Factoring Algorithms November 17, 2008 1 / 12 Fermat s factoring method Fermat made the observation that if n has two factors

More information

Recent Breakthrough in Primality Testing

Recent Breakthrough in Primality Testing Nonlinear Analysis: Modelling and Control, 2004, Vol. 9, No. 2, 171 184 Recent Breakthrough in Primality Testing R. Šleževičienė, J. Steuding, S. Turskienė Department of Computer Science, Faculty of Physics

More information

Complexity Theory. Jörg Kreiker. Summer term 2010. Chair for Theoretical Computer Science Prof. Esparza TU München

Complexity Theory. Jörg Kreiker. Summer term 2010. Chair for Theoretical Computer Science Prof. Esparza TU München Complexity Theory Jörg Kreiker Chair for Theoretical Computer Science Prof. Esparza TU München Summer term 2010 Lecture 8 PSPACE 3 Intro Agenda Wrap-up Ladner proof and time vs. space succinctness QBF

More information

Introduction to Automata Theory. Reading: Chapter 1

Introduction to Automata Theory. Reading: Chapter 1 Introduction to Automata Theory Reading: Chapter 1 1 What is Automata Theory? Study of abstract computing devices, or machines Automaton = an abstract computing device Note: A device need not even be a

More information

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 4 Nancy Lynch Today Two more models of computation: Nondeterministic Finite Automata (NFAs)

More information

On Generalized Fermat Numbers 3 2n +1

On Generalized Fermat Numbers 3 2n +1 Applied Mathematics & Information Sciences 4(3) (010), 307 313 An International Journal c 010 Dixie W Publishing Corporation, U. S. A. On Generalized Fermat Numbers 3 n +1 Amin Witno Department of Basic

More information

Course Manual Automata & Complexity 2015

Course Manual Automata & Complexity 2015 Course Manual Automata & Complexity 2015 Course code: Course homepage: Coordinator: Teachers lectures: Teacher exercise classes: Credits: X_401049 http://www.cs.vu.nl/~tcs/ac prof. dr. W.J. Fokkink home:

More information

Computational Models Lecture 8, Spring 2009

Computational Models Lecture 8, Spring 2009 Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown Univ. p. 1 Computational Models Lecture 8, Spring 2009 Encoding of TMs Universal Turing Machines The Halting/Acceptance

More information

Theory of Computation Chapter 2: Turing Machines

Theory of Computation Chapter 2: Turing Machines Theory of Computation Chapter 2: Turing Machines Guan-Shieng Huang Feb. 24, 2003 Feb. 19, 2006 0-0 Turing Machine δ K 0111000a 01bb 1 Definition of TMs A Turing Machine is a quadruple M = (K, Σ, δ, s),

More information

FACTORING. n = 2 25 + 1. fall in the arithmetic sequence

FACTORING. n = 2 25 + 1. fall in the arithmetic sequence FACTORING The claim that factorization is harder than primality testing (or primality certification) is not currently substantiated rigorously. As some sort of backward evidence that factoring is hard,

More information

NP-Completeness I. Lecture 19. 19.1 Overview. 19.2 Introduction: Reduction and Expressiveness

NP-Completeness I. Lecture 19. 19.1 Overview. 19.2 Introduction: Reduction and Expressiveness Lecture 19 NP-Completeness I 19.1 Overview In the past few lectures we have looked at increasingly more expressive problems that we were able to solve using efficient algorithms. In this lecture we introduce

More information

Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li

Computer Algorithms. NP-Complete Problems. CISC 4080 Yanjun Li Computer Algorithms NP-Complete Problems NP-completeness The quest for efficient algorithms is about finding clever ways to bypass the process of exhaustive search, using clues from the input in order

More information

Faster deterministic integer factorisation

Faster deterministic integer factorisation David Harvey (joint work with Edgar Costa, NYU) University of New South Wales 25th October 2011 The obvious mathematical breakthrough would be the development of an easy way to factor large prime numbers

More information

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis

MATHEMATICS: CONCEPTS, AND FOUNDATIONS Vol. III - Logic and Computer Science - Phokion G. Kolaitis LOGIC AND COMPUTER SCIENCE Phokion G. Kolaitis Computer Science Department, University of California, Santa Cruz, CA 95064, USA Keywords: algorithm, Armstrong s axioms, complete problem, complexity class,

More information

Chapter 11. 11.1 Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling

Chapter 11. 11.1 Load Balancing. Approximation Algorithms. Load Balancing. Load Balancing on 2 Machines. Load Balancing: Greedy Scheduling Approximation Algorithms Chapter Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should I do? A. Theory says you're unlikely to find a poly-time algorithm. Must sacrifice one

More information

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

NP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with

More information

1 Digital Signatures. 1.1 The RSA Function: The eth Power Map on Z n. Crypto: Primitives and Protocols Lecture 6.

1 Digital Signatures. 1.1 The RSA Function: The eth Power Map on Z n. Crypto: Primitives and Protocols Lecture 6. 1 Digital Signatures A digital signature is a fundamental cryptographic primitive, technologically equivalent to a handwritten signature. In many applications, digital signatures are used as building blocks

More information

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm.

! Solve problem to optimality. ! Solve problem in poly-time. ! Solve arbitrary instances of the problem. !-approximation algorithm. Approximation Algorithms Chapter Approximation Algorithms Q Suppose I need to solve an NP-hard problem What should I do? A Theory says you're unlikely to find a poly-time algorithm Must sacrifice one of

More information

RSA and Primality Testing

RSA and Primality Testing and Primality Testing Joan Boyar, IMADA, University of Southern Denmark Studieretningsprojekter 2010 1 / 81 Correctness of cryptography cryptography Introduction to number theory Correctness of with 2

More information

Overview of Number Theory Basics. Divisibility

Overview of Number Theory Basics. Divisibility Overview of Number Theory Basics Murat Kantarcioglu Based on Prof. Ninghui Li s Slides Divisibility Definition Given integers a and b, b 0, b divides a (denoted b a) if integer c, s.t. a = cb. b is called

More information

Introduction to NP-Completeness Written and copyright c by Jie Wang 1

Introduction to NP-Completeness Written and copyright c by Jie Wang 1 91.502 Foundations of Comuter Science 1 Introduction to Written and coyright c by Jie Wang 1 We use time-bounded (deterministic and nondeterministic) Turing machines to study comutational comlexity of

More information

Lecture 2: Complexity Theory Review and Interactive Proofs

Lecture 2: Complexity Theory Review and Interactive Proofs 600.641 Special Topics in Theoretical Cryptography January 23, 2007 Lecture 2: Complexity Theory Review and Interactive Proofs Instructor: Susan Hohenberger Scribe: Karyn Benson 1 Introduction to Cryptography

More information

CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 Solutions CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

More information

8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

More information

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits Outline NP-completeness Examples of Easy vs. Hard problems Euler circuit vs. Hamiltonian circuit Shortest Path vs. Longest Path 2-pairs sum vs. general Subset Sum Reducing one problem to another Clique

More information

6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008

6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 MIT OpenCourseWare http://ocw.mit.edu 6.080 / 6.089 Great Ideas in Theoretical Computer Science Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

6.080/6.089 GITCS Feb 12, 2008. Lecture 3

6.080/6.089 GITCS Feb 12, 2008. Lecture 3 6.8/6.89 GITCS Feb 2, 28 Lecturer: Scott Aaronson Lecture 3 Scribe: Adam Rogal Administrivia. Scribe notes The purpose of scribe notes is to transcribe our lectures. Although I have formal notes of my

More information

Finite Automata. Reading: Chapter 2

Finite Automata. Reading: Chapter 2 Finite Automata Reading: Chapter 2 1 Finite Automaton (FA) Informally, a state diagram that comprehensively captures all possible states and transitions that a machine can take while responding to a stream

More information

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion CHAPTER 5 Number Theory 1. Integers and Division 1.1. Divisibility. Definition 1.1.1. Given two integers a and b we say a divides b if there is an integer c such that b = ac. If a divides b, we write a

More information

Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011. Lecture 1 Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

More information

Turing Machines, Part I

Turing Machines, Part I Turing Machines, Part I Languages The $64,000 Question What is a language? What is a class of languages? Computer Science Theory 2 1 Now our picture looks like Context Free Languages Deterministic Context

More information

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology Honors Class (Foundations of) Informatics Tom Verhoeff Department of Mathematics & Computer Science Software Engineering & Technology www.win.tue.nl/~wstomv/edu/hci c 2011, T. Verhoeff @ TUE.NL 1/20 Information

More information

Model 2.4 Faculty member + student

Model 2.4 Faculty member + student Model 2.4 Faculty member + student Course syllabus for Formal languages and Automata Theory. Faculty member information: Name of faculty member responsible for the course Office Hours Office Number Email

More information

Chapter. Number Theory and Cryptography. Contents

Chapter. Number Theory and Cryptography. Contents Chapter 10 Number Theory and Cryptography Contents 10.1 Fundamental Algorithms Involving Numbers..... 453 10.1.1 Some Facts from Elementary Number Theory.... 453 10.1.2 Euclid s GCD Algorithm................

More information

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi Automata Theory Automata theory is the study of abstract computing devices. A. M. Turing studied an abstract machine that had all the capabilities of today s computers. Turing s goal was to describe the

More information

Lecture 1: Oracle Turing Machines

Lecture 1: Oracle Turing Machines Computational Complexity Theory, Fall 2008 September 10 Lecture 1: Oracle Turing Machines Lecturer: Kristoffer Arnsfelt Hansen Scribe: Casper Kejlberg-Rasmussen Oracle TM Definition 1 Let A Σ. Then a Oracle

More information

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

Discrete Mathematics, Chapter 4: Number Theory and Cryptography Discrete Mathematics, Chapter 4: Number Theory and Cryptography Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 4 1 / 35 Outline 1 Divisibility

More information

Notes on Factoring. MA 206 Kurt Bryan

Notes on Factoring. MA 206 Kurt Bryan The General Approach Notes on Factoring MA 26 Kurt Bryan Suppose I hand you n, a 2 digit integer and tell you that n is composite, with smallest prime factor around 5 digits. Finding a nontrivial factor

More information

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP International Journal of Information and Computation Technology. ISSN 0974-2239 Volume 4, Number 1 (2014), pp. 79-84 International Research Publications House http://www. irphouse.com /ijict.htm Implementation

More information

Overview of E0222: Automata and Computability

Overview of E0222: Automata and Computability Overview of E0222: Automata and Computability Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. August 3, 2011 What this course is about What we study

More information

CMPSCI611: Approximating MAX-CUT Lecture 20

CMPSCI611: Approximating MAX-CUT Lecture 20 CMPSCI611: Approximating MAX-CUT Lecture 20 For the next two lectures we ll be seeing examples of approximation algorithms for interesting NP-hard problems. Today we consider MAX-CUT, which we proved to

More information

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12 CONTINUED FRACTIONS AND PELL S EQUATION SEUNG HYUN YANG Abstract. In this REU paper, I will use some important characteristics of continued fractions to give the complete set of solutions to Pell s equation.

More information

Study of algorithms for factoring integers and computing discrete logarithms

Study of algorithms for factoring integers and computing discrete logarithms Study of algorithms for factoring integers and computing discrete logarithms First Indo-French Workshop on Cryptography and Related Topics (IFW 2007) June 11 13, 2007 Paris, France Dr. Abhijit Das Department

More information

Arithmetic algorithms for cryptology 5 October 2015, Paris. Sieves. Razvan Barbulescu CNRS and IMJ-PRG. R. Barbulescu Sieves 0 / 28

Arithmetic algorithms for cryptology 5 October 2015, Paris. Sieves. Razvan Barbulescu CNRS and IMJ-PRG. R. Barbulescu Sieves 0 / 28 Arithmetic algorithms for cryptology 5 October 2015, Paris Sieves Razvan Barbulescu CNRS and IMJ-PRG R. Barbulescu Sieves 0 / 28 Starting point Notations q prime g a generator of (F q ) X a (secret) integer

More information

Homework until Test #2

Homework until Test #2 MATH31: Number Theory Homework until Test # Philipp BRAUN Section 3.1 page 43, 1. It has been conjectured that there are infinitely many primes of the form n. Exhibit five such primes. Solution. Five such

More information

Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011. Lecture 1 Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

More information

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

SIMS 255 Foundations of Software Design. Complexity and NP-completeness SIMS 255 Foundations of Software Design Complexity and NP-completeness Matt Welsh November 29, 2001 mdw@cs.berkeley.edu 1 Outline Complexity of algorithms Space and time complexity ``Big O'' notation Complexity

More information

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)!

HOMEWORK 5 SOLUTIONS. n!f n (1) lim. ln x n! + xn x. 1 = G n 1 (x). (2) k + 1 n. (n 1)! Math 7 Fall 205 HOMEWORK 5 SOLUTIONS Problem. 2008 B2 Let F 0 x = ln x. For n 0 and x > 0, let F n+ x = 0 F ntdt. Evaluate n!f n lim n ln n. By directly computing F n x for small n s, we obtain the following

More information