Docsity

Randomized Polynomial Time: One-Sided Error & Bounded Probabilistic Polynomial Time - Prof, Study notes of Computer Science

Toggle sidebar
bg1
Notes for CMSC 652
Randomized Polynomial Time
William Gasarch
1R: Randomized Polynomial Time With 1-
Sided Error
Def 1.1 A set Ais in R (Randomized Polynomial Time) if there exists a
polynomial p, and a polynomial predicate Bso that for all n, and for all x
with |x|=n, we have
x∈A⇒Pr|r|=p(n)(B(x, r)) ≥3
4
x /∈A⇒Pr|r|=p(n)(¬B(x, r)) = 1
(Think of ras being a random string.)
Note 1.2 Some papers use RP instead of R. This has the advantage that
you can extend to other classes like Rlog.
Exercise 1
1. Show that if 3
4is replaced by 99
100 then the resulting class is still R.
2. Show that if 3
4is replaced by 1 −1
2|x|then the resulting class is still R.
We have defined R with 1-sided error. This is because most known ran-
domized algorithms have 1-sided error. The following problems are in R.
1. PRIMES: Given a number, is it prime? This is also in P; however, for
a long time it was one of the few natural problems known to be in R
but not known to be on P. The randomized algorithm is much faster
and is commonly used.
2. MODULAR SQUARE ROOTS: Given nand a prime p, is there a
number m, 0 ≤m≤p−1, such that m2≡n(mod p). This is used
in cryptography. As of today it is not known to be in P.
1
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Randomized Polynomial Time: One-Sided Error & Bounded Probabilistic Polynomial Time - Prof and more Study notes Computer Science in PDF only on Docsity!

Notes for CMSC 652 Randomized Polynomial Time William Gasarch

1 R: Randomized Polynomial Time With 1-

Sided Error

Def 1.1 A set A is in R (Randomized Polynomial Time) if there exists a polynomial p, and a polynomial predicate B so that for all n, and for all x with |x| = n, we have

x ∈ A ⇒ Pr|r|=p(n)(B(x, r)) ≥ (^34) x /∈ A ⇒ Pr|r|=p(n)(¬B(x, r)) = 1

(Think of r as being a random string.)

Note 1.2 Some papers use RP instead of R. This has the advantage that you can extend to other classes like R log.

Exercise 1

  1. Show that if 34 is replaced by 10099 then the resulting class is still R.
  2. Show that if 34 is replaced by 1 − (^2) |^1 x| then the resulting class is still R.

We have defined R with 1-sided error. This is because most known ran- domized algorithms have 1-sided error. The following problems are in R.

  1. PRIMES: Given a number, is it prime? This is also in P; however, for a long time it was one of the few natural problems known to be in R but not known to be on P. The randomized algorithm is much faster and is commonly used.
  2. MODULAR SQUARE ROOTS: Given n and a prime p, is there a number m, 0 ≤ m ≤ p − 1, such that m^2 ≡ n (mod p). This is used in cryptography. As of today it is not known to be in P.
  1. DETPOLYZERO (described below). This has an easy-to-describe al- gorithm for why it is in R. It is not known to be in P.

There are many problems in P (or even lower classes) that have a faster algorithm (with a small probability of error) if you allow randomization.

  1. Graph isomorphism for graphs of degree 3 is in O(n^3 log n) time deter- ministically but O(n^3 ) time using randomization. See [2].
  2. Let NC be the set of problems you can do with a poly number of processors in time polylog. Let RNC be the randomized version. Graph Matching can be done by a RNC but it is not known to be in NC. See [3].
  3. Let Matrix Mult Check (MMC) be the following problem: Given ma- trices A, B, C determine if AB = C. This can be done in randomized O(n^2 ) time (easy: pick 10 random x and test if A(B(x)) = C(x). If it always does then output YES else NO. Prob of error ≤ 1 / 210. Note that cannot iterate to get ≤ 1 / 2 n^ unless increase run time.) The best known deterministic algorithm for this problem takes O(nα) where α is the exponent in the best known matrix mult algorithm. That is currently 2.36.
  4. In Communication Complexity the EQ problem takes Ω(n) bits deter- ministically but O(log n) bits if randomization is allowed. In this case we have a proven separation.
  5. There is a vast area called Property Testing where all of the protocols are randomized.

Classes with 2-sided error have also been defined. We will look at those later in this chapter.

Note 1.3 If a problem is in R, then we think of it as feasible to solve in the real world. This is because there are good (though not provably good) random number generators. There are also theoretical reasons to think that P = R (see [5]).

  1. Show that PRIMES is in R. (You may not use that PRIMES is known to be in P. You may use the Web or any other non-organic source; however, you must hand in a reasonably complete proof.)
  2. Find a case in the literature where using randomization seems to im- prove the performance of something.

We will need the notion of a randomized reduction.

Def 1.5 Let A and B be two sets. We say that A ≤p r B if there exists a function f computable in poly time (the reduction), and polynomials p, q such that x ∈ A ⇒ Pr|r|=p(n)(f (x, r) ∈ B) ≥ (^) q(^1 n) x /∈ A ⇒ Pr|r|=p(n)(f (x, r) ∈/ B) = 1

(Think of r as being a random string.)

This does not look that useful since the probability of being right when x ∈ A is small. But its usefulness emerges from the following theorem.

Theorem 1.6 If A ≤p r B and B ∈ P then A ∈ R.

Proof: Assume A ≤p r B via the function f and polynomials p, q.

  1. Input (x, r). Let n be such that |x| = n and let |r| = 2p(n)q(n). (We denote r = r 1 r 2 · · · r 2 q(n) where, for each i, |ri| = p(n).)
  2. Compute f (x, r 1 ), · · ·, f (x, r 2 q(n)). For each i query f (x, ri) ∈ B. If any of the answers are YES, then output YES. Otherwise output NO.

If x /∈ A then, for all i, f (x, ri) ∈/ B hence the algorithm will (correctly) say NO. If x ∈ A then, for each i, Pr(f (x, ri) ∈/ B) ≤ (1 − (^) q(^1 n) ). Hence

[Pr((∀i)[f (x, ri) ∈/ B])] ≤ (1 − (^) q(^1 n) )^2 q(n) ≤ (e−^1 /q(n))^2 q(n) ≤ (e−^1 )^2 ≤ (^) e^12 ≤ 14.

Hence Pr((∃i)[f (x, ri) ∈ B]) ≥ 1 − 14 = 34. This establishes the desired result.

Exercise 3 Show that if A ≤p r B and B ∈ R then A ∈ R.

2 BPP- Two sided Error

Our definition of Randomized Polynomial Time assumed one-sided error. That is, if x ∈ A then the algorithm outputs YES or NO (YES much more often) but if x /∈ A then the algorithm will output NO. What if we allow two-sided error?

Def 2.1 A set A is in BPP (Bounded Probabilistic Polynomial Time) if there exists a polynomial p, and a polynomial predicate B so that for all n, and for all x with |x| = n, we have

x ∈ A ⇒ Pr|r|=p(n)(B(x, r)) ≥ (^34) x /∈ A ⇒ Pr|r|=p(n)(B(x, r)) ≤ 1 − (^34)

(Think of r as being a random string.)

Exercise 4

  1. Show that if 34 is replaced by 10099 then the resulting class is still BPP.
  2. Show that if 34 is replaced by 1 − (^21) |x| then the resulting class is still BPP.

Note 2.2 Very few problems are known to be in BPP but not known to be in P. See [1] for some; however, that paper was written before the result Primes in P so it may be outdated.

What if we pick L values of t? Then we get

Prt 1 ,...,tL (y /∈

⋃^ L

i=

S ⊕ ti) ≤ e−|S|L/^2

m = e−m.

What is the probability that there exists a y which is not covered? For- mally

Prt 1 ,...,tL ((∃y)[y /∈

⋃^ m

i=

S ⊕ ti]) ≤ 2 me−m.

For large enough m (in fact, m need not be that large) this quantity is < 1. Hence there exists t 1 ,... , tL. such that

{ 0 , 1 }m^ =

⋃^ n

i=

S ⊕ ti.

Theorem 2.5 BPP ⊆ Σp 2 ∩ Πp 2

Proof: Let A ∈ BPP. Let m = m(n) be the polynomial such that, for all x of length n,

x ∈ A ⇒ Pr|r|=m(B(x, r)) ≥ (1 − (^21) n ) x /∈ A ⇒ Pr|r|=m(B(x, r)) ≤ (^21) n

(Think of r as being a random string.) Let

Sx = {r | B(x, r)}.

We rewrite the equations above about x ∈ A and x /∈ A.

x ∈ A ⇒ |Sx| ≥ (1 − (^21) n )2m x /∈ A ⇒ |Sx| ≤ (^21) n 2 m^ = 2m−n

Let Lx = 2mm/|Sx| (recognize this from Lemma 2.4). Note that

x ∈ A ⇒ Lx ≤ 2 m.

(Note- we could use (1 + δ)m instead of 2m but there is no need.) By Lemma 2.

x ∈ A ⇒ (∃t 1 ,... , t 2 m ∈ { 0 , 1 }m)(∀y ∈ { 0 , 1 }m)[y ∈

(^2) ⋃m

i=

Sx ⊕ ti].

Hence

x ∈ A ⇒ (∃t 1 ,... , t 2 m ∈ { 0 , 1 }m)(∀y ∈ { 0 , 1 }m)[

(^2) ∨m

i=

y ⊕ ti ∈ Sx].

Note that the set {(x, y) |

(^2) ⋃m

i=

y ⊕ ti ∈ Sx

is in P so we have ‘half of’ what we want: x ∈ A implies a Σp 2 statement. We show the converse now. We use the version

x ∈ A ⇒ (∃t 1 ,... , t 2 m ∈ { 0 , 1 }m)(∀y ∈ { 0 , 1 }m)[

(^2) ∨m

i=

y ⊕ ti ∈ Sx].

for this. Assume

(∃t 1 ,... , t 2 m ∈ { 0 , 1 }m)(∀y ∈ { 0 , 1 }m)[y ∈

(^2) ⋃m

i=

Sx ⊕ ti].

We need to show that x ∈ A. Map every y ∈ { 0 , 1 }m^ to the least i such that y ∈ Sx ⊕ti. There exists an i such that at least 2m/ 2 m = 2m−^1 /m strings map to i. These are 2m−^1 /m distinct elements of Sx. Hence

|Sx| ≥ 2 m−^1 /m.

Note that if x /∈ A then |Sx| ≤ 2 m−n. Since m is a polynomial in n, m << 2 n. Hence 2 m−n^ < 2 m−^1 /m ≤ |Sx|.