Probabilistic Complexity. Probabilistic Algorithms Def: A probabilistic Turing Machine M is a type of non- deterministic TM, where each non-deterministic.

Slides:



Advertisements
Similar presentations
Isolation Technique April 16, 2001 Jason Ku Tao Li.
Advertisements

Rice ’ s Theorem. Def: A property of the Turing-recognizable languages is simply a subset of all Turing- recognizable languages.
WS Algorithmentheorie 03 – Randomized Algorithms (Primality Testing) Prof. Dr. Th. Ottmann.
Chapter 8 – Introduction to Number Theory. Prime Numbers prime numbers only have divisors of 1 and self –they cannot be written as a product of other.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
1 Deciding Primality is in P M. Agrawal, N. Kayal, N. Saxena Presentation by Adi Akavia.
Computability and Complexity
Having Proofs for Incorrectness
Chapter 8 Introduction to Number Theory. Prime Numbers prime numbers only have divisors of 1 and self –they cannot be written as a product of other numbers.
Primality Testing Patrick Lee 12 July 2003 (updated on 13 July 2003)
Introduction to Modern Cryptography Lecture 6 1. Testing Primitive elements in Z p 2. Primality Testing. 3. Integer Multiplication & Factoring as a One.
COM 5336 Cryptography Lecture 7a Primality Testing
Basic properties of the integers
Probabilistic algorithms Section 10.2 Giorgi Japaridze Theory of Computability.
Probabilistic Algorithms Michael Sipser Presented by: Brian Lawnichak.
Complexity 18-1 Complexity Andrei Bulatov Probabilistic Algorithms.
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
Randomized Computation Roni Parshani Orly Margalit Eran Mantzur Avi Mintz
1 Fingerprint 2 Verifying set equality Verifying set equality v String Matching – Rabin-Karp Algorithm.
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Deciding Primality is in P M. Agrawal, N. Kayal, N. Saxena Slides by Adi Akavia.
Chapter II. THE INTEGERS
Complexity1 Pratt’s Theorem Proved. Complexity2 Introduction So far, we’ve reduced proving PRIMES  NP to proving a number theory claim. This is our next.
Submitted by : Estrella Eisenberg Yair Kaufman Ohad Lipsky Riva Gonen Shalom.
–Def: A language L is in BPP c,s ( 0  s(n)  c(n)  1,  n  N) if there exists a probabilistic poly-time TM M s.t. : 1.  w  L, Pr[M accepts w]  c(|w|),
K. -C. Yang and J. -L. Lin National Tsing Hua University
and Factoring Integers
Theory of Computation Transparency No. 1-1 Chapter 2 Introduction to Number Theory and Its applications Cheng-Chia Chen October 2002.
Theory of Computation Transparency No. 1-1 Chapter 2 Introduction to Number Theory and Its applications Cheng-Chia Chen October 2005.
Chapter 8 – Introduction to Number Theory Prime Numbers  prime numbers only have divisors of 1 and self they cannot be written as a product of other numbers.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
Chapter 8 – Introduction to Number Theory Prime Numbers
Chapter 8 – Introduction to Number Theory Prime Numbers  prime numbers only have divisors of 1 and self they cannot be written as a product of other numbers.

Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices
Information Security and Management 4. Finite Fields 8
The Polynomial Time Algorithm for Testing Primality George T. Gilbert.
Methods of Proof. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical theorems. Direct.
MA/CSSE 473 Day 08 Randomized Primality Testing Carmichael Numbers Miller-Rabin test.
The Complexity of Primality Testing. What is Primality Testing? Testing whether an integer is prime or not. – An integer p is prime if the only integers.
Approximation Algorithms Pages ADVANCED TOPICS IN COMPLEXITY THEORY.
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Computation Model and Complexity Class. 2 An algorithmic process that uses the result of a random draw to make an approximated decision has the ability.
. CLASSES RP AND ZPP By: SARIKA PAMMI. CONTENTS:  INTRODUCTION  RP  FACTS ABOUT RP  MONTE CARLO ALGORITHM  CO-RP  ZPP  FACTS ABOUT ZPP  RELATION.
1 Section Congruences In short, a congruence relation is an equivalence relation on the carrier of an algebra such that the operations of the algebra.
Chinese Remainder Theorem. How many people What is x? Divided into 4s: remainder 3 x ≡ 3 (mod 4) Divided into 5s: remainder 4 x ≡ 4 (mod 5) Chinese Remainder.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Tuesday’s lecture: Today’s lecture: One-way permutations (OWPs)
6.3 Primality Testing. p2. (1) Prime numbers 1. How to generate large prime numbers? (1) Generate as candidate a random odd number n of appropriate size.
Chapter 1 Algorithms with Numbers. Bases and Logs How many digits does it take to represent the number N >= 0 in base 2? With k digits the largest number.
MA/CSSE 473 Day 10 Primality Testing. MA/CSSE 473 Day 10 In-class exam: Friday, Sept 28 –You may bring a two-sided 8.5x11 inch piece of paper containing.
MA/CSSE 473 Day 09 Modular Division Revisited Fermat's Little Theorem Primality Testing.
1 Introduction to Quantum Information Processing CS 467 / CS 667 Phys 667 / Phys 767 C&O 481 / C&O 681 Richard Cleve DC 2117 Lecture.
Discrete Mathematics Chapter 2 The Fundamentals : Algorithms, the Integers, and Matrices. 大葉大學 資訊工程系 黃鈴玲.
Mathematical Induction And Recursion Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Fuw-Yi Yang1 Textbook: Introduction to Cryptography 2nd ed. By J.A. Buchmann Chap 1 Integers Department of Computer Science and Information Engineering,
MA/CSSE 473 Day 9 Primality Testing Encryption Intro.
 2005 SDU Lecture14 Mapping Reducibility, Complexity.
B504/I538: Introduction to Cryptography
Mathematics of Cryptography
Probabilistic Algorithms
Read Once Branching Programs: a model of computation used in CAD.
Textbook: Introduction to Cryptography 2nd ed. By J.A. Buchmann
Number Theory (Chapter 7)
Chapter 5 Induction and Recursion
Patrick Lee 12 July 2003 (updated on 13 July 2003)
From the last time: gcd(a, b) can be characterized in two different ways: It is the least positive value of ax + by where x and y range over integers.
Probabilistic Complexity
Presentation transcript:

Probabilistic Complexity

Probabilistic Algorithms Def: A probabilistic Turing Machine M is a type of non- deterministic TM, where each non-deterministic step is called a coin-flip step and has 2 legal next moves.

Define the probability of branch b to be Pr[b]=2 -k, where k is the number of coin-flip steps that occur on branch b. Define the probability that M accepts w to be Pr[M accepts w] =  Pr[b] For 0    ½, we say that M recognize language A with error probability  if w  A implies Pr[M accepts w]  1- , and w  A implies Pr[M rejects w]  1- 

BPP Def: BPP is the class of languages that are recognized by probabilistic polynomial time TM ’ s with an error probability of 1/3. Lemma: [Amplification Lemma] Let 0<  < ½. Then for any polynomial p(n) a probabilistic poly time TM M 1 that operates with error probability  has an equivalent probabilistic poly time TM M 2 that operates with an error probability of 2 -p(n).

Pf: M 1 : recognizes a language with error , and a poly p(n). Construct M 2 that recognizes the same language with an error probability 2 -p(n). M 2 = “ On input w 1. Calculate k and repeat the following 2k times 2. Simulate M 1 on w. 3. If most runs of M 1 accept, then accept; otherwise reject. ”

M 1 errs on w with some probability    < ½,  /1-  <1.  (1-  )-  (1-  )<0

Need to show that (k+1)(4  (1-  )) k  2 -p(n). Let t=2 p(n), a=1/4  (1-  ), b=max(1,1/loga), c=2logbt, k=  bc  Claim: (k+1)(1/a) k  1/t a k = a  bc   a bc  2 c 2 c = 2 2log(bt) = (bt) 2 b  1, assume that t  9  bt  9  bt>2+2log(bt)  (bt) 2 > bt(2+2logbt) = t(2b+2blogbt) ∵ b  1 i) if 1/loga > 1  b=1/loga  a bc =a 1/logaC =2 C ii) if 1/loga 2  a bc =a C >2 C

Hence a k  t(2+2blogbt)  t(1+  2blogbt  )  t(1+  bc  ) = t(k+1) (k+1)(4  (1-  )) k = (k+1)/a k  1/t =2 -p(n) ■

Primality: Composite number : 複合數 Prime : 質數 Z p + ={1,2, …,p-1}, Z p ={0}  Z p + Z 5 ={0,1,2,3,4} Z 6 ={0,1,2,3,4,5} Z 6 + ={1,2,3,4,5} x mod p is the smallest non-negative y where x  y (mod p).

Lemma: Suppose that a 1, …,a t all divide n and (a i,a j )=1 for i  j. Then a 1 … a t  n. Pf: By induction. It is clear for t=1 Suppose the lemma is true up to t-1, i.e. a 1 … a t-1  n. (a t,a 1 … a t-1 )=1  Exist r and s such that r  a t + s  a 1 … a t-1 =1, ra t n + sa 1 … a t-1 n=n. ■ by ind. a t |n

Thm: (Chinese Remainder theorem) Suppose m=m 1 m 2 … m t and (m i,m j )=1 for i  j. Let b 1,b 2, …,b t be integers and consider the system of congruencies : x  b 1 (mod m 1 ) x  b 2 (mod m 2 ) x  b t (mod m t )

Pf: Let n i = m/m i, then (m i,n i )=1.  Exist r i and s i such that r i m i +s i n i =1. Let e i = s i n i  e i  1 (mod m i ) e i  0 (mod m j ), i  j Let x 0 = b i e i. Then x 0  b i e i (mod m i )  b i (mod m i )  x 0 is a solution. Suppose x 1 is another solution. Then x 1 – x 0  0 (mod m j ), for i=1,…,t. That is m 1, …,m t divide x 1 -x 0.  m  x 1 -x 0 ■

The CRT says that a 1-1 correspondence exists between Z m and Z m1 × … × Z mt Thm: (Fermat ’ s little theorem) If p is a prime number and a  Z p +, then a p-1  1 (mod p).

Pf: 1a,2a,…,(p-1)a 1  i,j  p-1, ia  ja (mod p) (ia–ja)  0 (mod p) (i-j)a = k ‧ p  p  (i-j)  i=j. Thus, 1a,2a, … (p-1)a is a permutation of 1,2, …,(p-1).  1a ‧ 2a ‧ … ‧ (p-1)a  1 ‧ 2 ‧ … ‧ (p-1) (mod p) (p-1)!a p-1  (p-1)! (mod p) (p-1)!(a p-1 -1)  0 (mod p)  (p-1)!(a p-1 -1)  k ‧ p  p  a p-1 –1,  a p-1  1 (mod p). ■

eg =2 6 =64, 64 mod 7 =1. Fermat test: we say that p passes the Fermat test at a, we mean that a p-1  1 (mod p). Fermat’s little theorem states that primes pass all Fermat tests for a  Z p +.

Carmichael numbers: Composite numbers that passes all Fermat tests. Pseudo-prime = “ On input p: 1. Select a 1, …,a k randomly in Z p Compute a i p-1 mod p for each i. 3. If all computed values are 1, accept ; otherwise, rejects. “

Numbers of prime power: N=p k It is easy to test such type of numbers! It is clear that (p-1)| (N-1) Find a number a such that gcd(a, p) =1. Then a N-1  1 (mod p). Why? Thus p | gcd ( N, a N-1 -1). Test prime power

PRIME = “ On input p 1. If p is even and p=2 then accept ; else reject. 2. Select a 1, …,a k randomly in Z p For i=1 to k do 4.Compute a i p-1 mod p and reject if different from 1. 5.Let p-1=st where s is odd and t=2 h 6.Compute mod p. 7.If some element is not 1, then find the last one that is not 1 and reject if it is not –1. 8. All tests have passed at this point, so accept. “

Lemma: If p is an odd prime number, then Pr[PRIME accepts p]=1. Pf: If p is an odd prime, then it will pass stage 4. If a were a stage 7 witness, some b exists in Z p +, where b   1 (mod p) and b  1(mod p)  b 2 -1  0 (mod p)  (b-1)(b+1)  0 (mod p)

 (b-1)(b+1) = cp for some positive integer c. ∵ b   1 (mod p)  0<b+1, b-1<p. Therefore, p is composite because a prime number cannot be expressed as a product of numbers that are smaller than it is. ■

Lemma: If p is an odd composite number, then Pr[PRIME accepts p]  2 -k. Pf: Goal: If p is an odd composite number and a is selected randomly in Z p +, then Pr[a is witness]  ½. Prove by demonstrating that at least as many witnesses as non- witnesses exist in Z p +, i.e. by finding a unique witness for each non-witness.

For every non-witness, the sequence computed in stage 6 is either all 1 or contains – 1 at some position followed by 1 ’ s. 1: non-witness of the first kind 1,1,1, …,1 -1:non-witness of the second kind -1,1,1, … 1 Among all non-witness of 2 nd kind, find a non-witness for which the – 1 appears in the largest position in the sequence.

Let h be a non-witness., …, ……………..-1,1, …,1 ∵ p is composite.  We can write p = qr, (q,r)=1, or p is a prime power. We handle former case first. By the CRT, there exists t  Z p. t  h (mod q) t  1 (mod r) j-th

Hence t is a witness because but

Next we prove that dt mod p is a unique witness for each non- witness d by 2 observations.

Thus the number of witnesses must be as large as the number of non-witnesses when p=qr.

For the case p=q e, where q is a prime and e >1. Let t= 1+ q e-1, which is < p. Thus t p = (1+ q e-1 ) p = 1 + p q e-1 + (.....) q 2(e-1) = 1 + p( )  1 (mod p). Observe that if t p-1  1 (mod p), then t p  t !  1 (mod p), which contradicts that t p  1 (mod p). Thus t is a stage 4 witness, since t p-1 !  1 (mod p). If d is a stage 4 non-witness, then d p-1  1 (mod p), but then (dt) p-1 !  1 (mod p), ie, dt is a witness. If d 1 and d 2 are distinct non-witness, then d 1 t mod p  d 2 t mod p. Otherwise, d 1 =d 1 t p mod p = d 2 t p mod p = d 2. Thus the number of stage 4 witnesses must be as large as the number of non-witnesses. Thm: PRIMES  BPP, actually co-RP.

Def: BPP is the class of all languages L for which there is a non-det poly time TM M, whose computation branches all have the same length, and when x  L  Pr[M(x) accepts]  2/3, when x  L  Pr[M(x) accepts] < 1/3. Def: L  RP, if  a NTM in poly time. when x  L  Pr[M(x) accepts]  2/3, when x  L  Pr[M(x) accepts] =0. RP  BPP. ? ZPP Def: ZPP = RP  co-RP.