Polynomial Identity Testing If A , B , C are three matrices of size n x n and we want to find out whether AB = C or not, then this can be solved in O ( n 3 ) or O ( n 2 . 37 ) by multiplying A and B first. Randomized Computation If we introduce a new matrix X of size n x 1 then we can solve this problem in O ( n 2 ) by using A ( BX ) = CX equation. If AB = C ⇒ Prob[ A ( BX ) = CX ] = 1 Nabil Mustafa If AB � = C ⇒ Prob[ A ( BX ) = CX ] ≤ k , where k could have any value over the interval [0 , 1] In other words we can say that for fixed values of X and C we Computability and Complexity can have different values of AB � 1 � 1 � 2 1 � � � AB = X = CX = 1 1 1 2 � 2 � 1 � 2 0 � � � AB = X = CX = 0 2 1 2 Nabil Mustafa Randomized Computation Nabil Mustafa Randomized Computation Polynomial Identity Testing Probabilistic Turing Machines ( PTM ) So far, considered the following types of machines for input x : Similar problem can happen with polynomials as well TM : only one computation that either accepts or rejects Let A ( x ), B ( x ) and C ( x ) be polynomials (over reals) of NTM : there are many sequences of computation, and x degrees m , n and mn respectively. accepted if there exists a sequence of computations that Question: Is A ( x ) · B ( x ) = C ( x ) accept Idea: reduce problem to checking zero’s of a polynomial ATM : many sequences of computations, and x accepted based on the type of nodes ( ∃ or ∀ ) along its path A ( x ) · B ( x ) = C ( x ) ⇐ ⇒ D ( x ) = A ( x ) · B ( x ) − C ( x ) ≡ 0 OTM : a TM with access to an oracle Last kind of machine: Probabilistic Turing Machine D ( x ) has degree at most mn Very similar to a TM , except at each step, M could toss a So if D ( x ) is not identically 0, it can have at most mn roots coin to get a random bit, and decide which transition rule to follow based on the outcome of the coin toss Pick a random real r out of 2 mn reals. If D ( r ) = 0, return that A ( x ) · B ( x ) = C ( x ) A PTM takes input x and a random bit string r Otherwise A ( x ) · B ( x ) � = C ( x ) Prob[ M ( x , r ) = z ]: probability M outputs z . Since at most mn of these can be roots of D ( · ), with A polynomial PTM halts after a polynomial (in the length of probability 1 / 2, D ( r ) � = 0 if A ( x ) · B ( x ) � = C ( x ) the input) number of steps Nabil Mustafa Randomized Computation Nabil Mustafa Randomized Computation
Failure Probability Randomized Complexity Classes PTM Can Make Mistakes RP (Randomized Polynomial time) A major aspect of randomized algorithms or probabilistic machines is that they may fail to produce the desired output with some One-sided error specified failure probability. coRP (complement of RP ) One-sided error The machine may err only in one direction i.e. either on ‘yes’ One-sided error instances or on ‘no’ instances. Either false positive or false negative, not both. BPP (Bounded-error Probabilistic Polynomial time) Two-sided error The machine may err in both directions i.e. it may result a Two-sided error ‘yes’ instance as a ‘no’ instance and vice versa. Both false positive and false negative can occur. ZPP (Zero-error Probabilistic Polynomial time) Zero-sided error The algorithm never provides a wrong answer. Zero error But sometimes it returns ‘don’t know’ Nabil Mustafa Randomized Computation Nabil Mustafa Randomized Computation Randomized Polynomial time RP is in NP Definition: RP Theorem The complexity class RP is the class of all languages L for which RP ⊆ NP there exists a polynomial PTM M such that Proof ⇒ Prob [ M ( x ) = 1] ≥ 1 x ∈ L = Let L be a language in RP . Let M be a polynomial 2 probabilistic Turing Machine that decides L . x / ∈ L = ⇒ Prob [ M ( x ) = 0] = 1 If x ∈ L , then there exists a sequence of coin tosses y such that M accepts x with y as the random string. Definition: coRP So we can consider y as a certificate instead of a random The complexity class coRP is the class of all languages L for which string. y can be verified in polynomial time by the same there exists a polynomial PTM M such that machine. If x / ∈ L , then Prob[ M ( x ) = 1] = 0. So there is no certificate. x ∈ L = ⇒ Prob [ M ( x , r ) = 1] = 1 M rejects x . ⇒ Prob [ M ( x , r ) = 0] ≥ 1 x / ∈ L = So L ∈ NP 2 Nabil Mustafa Randomized Computation Nabil Mustafa Randomized Computation
Boosting for RP Examples of RP and coRP The constant 1 / 2 in the definition of RP can be replaced by any constant k , 0 < k < 1 Example of RP Since the error is one-sided, we can repeat the algorithm t Primes, the set of all prime numbers, is in RP . times independently: This was shown by Adelman and Huang (1992), who gave a primality testing algorithm that always rejected composite We reject the string x if any of the t runs reject, and accept x numbers, and accepted primes with probability at least 1 / 2 otherwise Clearly, if x / ∈ L , all t runs will return a 0 If x ∈ L , if any of the t runs returns a 1, we return the correct answer Example of coRP Primes, the set of all prime numbers, is in coRP also. If x ∈ L , if all t runs returns 0, we make mistake Miller and Rabin gave a primality test that always accepts prime Pr[algorithm makes a mistake t times] ≤ 1 numbers, but rejects composites with probability at least 1 / 2 2 t Thus, we can make the error exponentially small by polynomial number of repetitions. Nabil Mustafa Randomized Computation Nabil Mustafa Randomized Computation Bounded-error Probabilistic Polynomial time Boosting for BPP Definition: BPP 2 / 3 is arbitrary and can be improved as follows: The complexity class BPP is the class of all languages L for which Repeat the algorithm t times, say it returns X i at the i -th run there exists a polynomial PTM M such that Take majority answer, i.e., if ≥ t / 2 times M returns 1, return ⇒ Prob [ M ( x ) = 1] ≥ 2 1, otherwise return 0 x ∈ L = 3 The Chernoff Bound ⇒ Prob [ M ( x ) = 1] < 1 Suppose X 1 , . . . , X t are t independent random variables with x / ∈ L = 3 values in { 0 , 1 } and for every i , Pr[ X i = 1] = p . Then M answers correctly with probability 2 / 3 on any input x regardless t if x ∈ L or x / ∈ L Pr [1 X i − p > ǫ ] < e − ǫ 2 . t � 2 p (1 − p ) t i =1 Example of BPP Primes, the set of all prime numbers, is in BPP . t Pr [1 X i − p > − ǫ ] < e − ǫ 2 . t � BPP is closed under complement. 2 p (1 − p ) t i =1 BPP = coBPP Nabil Mustafa Randomized Computation Nabil Mustafa Randomized Computation
Boosting for BPP RP ⊆ BPP RP x ∈ L : M outputs correctly if � t i =1 X i ≥ t 2 x ∈ L ⇒ Prob [ M ( x ) = 1] ≥ 1 The algorithm makes a mistake when � t i =1 X i < t 2 2 x / ∈ L ⇒ Prob [ M ( x ) = 1] = 0 Pr [ Algorithm outputs the wrong answer on x ] = Pr [ � t i =1 X i < t 2 ] BPP x ∈ L ⇒ Prob [ M ( x ) = 1] ≥ 2 = Pr [ 1 � t i =1 X i < 1 2 ] 3 t ∈ L ⇒ Prob [ M ( x ) = 1] < 1 x / = Pr [ 1 � t i =1 X i − 2 / 3 < − 1 6 ] 3 t t ≤ e − 36 · 2 · 2 / 3 · 1 / 3 Can boost RP probability by running twice: = e − ct , where c is some constant x ∈ L ⇒ Prob [ M ( x ) = 1] ≥ 3 ≤ 1 2 n for t = (ln 2 n ) / c 4 So by running the algorithm O ( n ) times, reduce probability x / ∈ L ⇒ Prob [ M ( x ) = 1] = 0 exponentially Clearly the above definition satisfies BPP Nabil Mustafa Randomized Computation Nabil Mustafa Randomized Computation A Theorem on ZPP A Theorem on ZPP Theorem ZPP = RP ∩ coRP Let M ′ be a Turing Machine that on input x , returns 0 if This Theorem has two parts: M ( x ) =“don’t know” and otherwise returns M ( x ). ZPP ⊆ RP ∩ coRP If x ∈ L , then Prob[ M ( x ) = 1 or M ( x ) =“don’t know”] = 1. RP ∩ coRP ⊆ ZPP So Prob[ M ′ ( x ) = 1] = 1. ZPP ⊆ RP ∩ coRP has two parts ∈ L , then Prob[ M ( x ) = 0] ≥ 1/2. So Prob[ M ′ ( x ) = 0] ≥ If x / ZPP ⊆ RP 1/2 as well. ZPP ⊆ coRP So L ∈ coRP , and ZPP ⊆ coRP Here we prove ZPP ⊆ coRP Let L ∈ ZPP . Then there is a machine M that, for all x , either correctly determines whether or not x ∈ L or outputs “don’t know”. It does the latter with probability at most 1 / 2. Nabil Mustafa Randomized Computation Nabil Mustafa Randomized Computation
Recommend
More recommend