• Aucun résultat trouvé

RANDOMIZED SPACE-BOUNDED COMPUTATION

Dans le document This page intentionally left blank (Page 165-168)

PART ONE BASIC COMPLEXITY CLASSES

CHAPTER 7 Randomized computation

7.7 RANDOMIZED SPACE-BOUNDED COMPUTATION

7.7 RANDOMIZED SPACE-BOUNDED COMPUTATION

We can extend the definition of space-bounded computation from Chapter4 to the probabilistic setting, saying that a PTM uses spaceS(n)if in any branch of its compu-tation on a lengthninput, the number of work-tape cells that are ever nonblank is at mostO(S(n)). The most interesting case is when the work tape hasO(logn)size. The classesBPLandRLare the two-sidederror andone-sidederror probabilistic analogs of the classLdefined in Chapter4.

Definition 7.18 (The classes BPL andRL) A language L is in BPLif there is an O(logn)-space probabilistic TMMsuch that Pr[M(x)=L(x)] ≥2/3.

A languageLis inRLif there is anO(logn)-space probabilistic TMM such that if xLthen Pr[M(x)=1] ≥2/3andifxLthen Pr[M(x)=1] =0.

The reader can verify that the error reduction procedure described in Chapter7can be implemented with only logarithmic space overhead. Hence, also in these definitions the choice of the precise constant is not significant. We note thatRLNL, andthus RLP. The exercises ask you to show thatBPLPas well.

One famousRL-algorithm is the algorithm for solvingUPATH, the restriction of theNL-completePATHproblem (see Chapter4) to undirected graphs. That is, given an n-vertex undirected graphGandtwo verticessandt, determine whethersis connected totinG.

Theorem 7.19 ([AKL+79])UPATH∈RL.

The algorithm forUPATHis actually very simple: Take a random walk of length =100n4starting froms. That is, initialize the variablevto the vertexsandin each step choose a random neighboruofv, andsetvu. Accept iff the walk reachestwithin steps. This is a logspace algorithm since it only needs to store a counter, the index of the current vertex, andsome scratch space to compute the next neighbor in the walk.

Clearly, ifsis not connectedtot, then the algorithm will never accept. It can be shown that ifsis connectedtotthen the expectednumber of steps it takes for a walk froms to hittis at most 10n4andhence our algorithm will accept with probability at least 3/4.

We leave the analysis as Exercise7.11. Chapter21introduces some general tools for the analysis of random walks on graphs, from which this bound(andbetter ones) easily follow.7In Chapter21(Section21.4) we show a recentdeterministiclogspace algorithm for the same problem.

More generally, we do know some nontrivial relations between probabilistic and deterministic logspace computation. It is known thatBPL(andhence alsoRL) is con-tainedinSPACE(log3/2n). See Section21.6andthe chapter notes of Chapter21for more on this topic.

7 The best boundknown on the expectednumber of steps for a walk fromsto visit all the vertices connectedto sin ann-vertex graph is274n3+o(n3)[Fei95] andthis is tight, as can be shown by analyzing the random walk on the “lollipop graph,” consisting of a path of lengthn/3 connectedto a clique of length 2n/3.

What have we learned?

• The classBPPconsists of languages that can be solvedby a probabilistic polynomial-time algorithm. The probability is only over the algorithm’s coins andnot the choice of input. It is arguably a better formalization of efficient computation thanP.

RP,coRP, andZPPare subclasses ofBPPcorresponding to probabilistic algorithms with one-sidedandzero-sidederror.

• Using repetition, we can considerably amplify the success probability of probabilistic algorithms.

• We only know thatPBPPEXP, but we suspect thatBPP=P.

BPPis a subset of bothP/polyandPH. In particular, the latter implies that ifNP=P, thenBPP=P.

• Randomness is used in complexity theory in many contexts beyondBPP. Two exam-ples are randomized reductions and randomized logspace algorithms, but we will see many more later.

CHAPTER NOTES AND HISTORY

Early researchers realizedthe power of randomization since their computations—e.g., for design of nuclear weapons—used probabilistic tools such as Monte Carlo simula-tions. Turing machines were defined by De Leeuw et al. [dLMSS56]. The definitions ofBPP(bounded-error probabilistic polynomial-time),RP(randomized polynomial-time) andZPP(zero-error probabilistic polynomial-time) are from Gill [Gil77]. The reasonBPPis not calledsimplyPP(i.e., “probabilistic-time”) is that Gill gave the name PPto a much more powerful class in [Gil74] (see Chapter17).

The algorithm usedto show PRIMES is in coRP is due to Solovay and Strassen [SS77]. Another primality test from the same era is due to Rabin [Rab80].

Over the years, many better primality tests were proposed. In a recent breakthrough, Agrawal, Kayal, andSaxena finally provedthat PRIMES ∈ P [AKS04]. Both the probabilistic and deterministic primality testing algorithms are described in Shoup’s book [Sho05]. The fingerprinting technique usedin the polynomial identity-testing algo-rithm is by Karp andRabin [KR81]. Lovász’s randomizedNCalgorithm [Lov79] for deciding theexistenceof perfect matchings is unsatisfying in the sense that when it out-puts “Accept,” it gives no clue how to finda matching! Subsequent probabilisticNC algorithms can finda perfect matching as well; see [KUW85,MVV87]. Readers inter-estedin randomizedalgorithms are referredto the books by Mitzenmacher andUpfal [MU05] andMotwani andRaghavan [MR95].

BPPP/poly (Theorem7.14) is from Adelman [Adl78]. BPPPH is due to Sipser [Sip83], andthe stronger formBPPp2p2(Theorem7.15) is due to P. Gács.

The proof we presentedis due to Lautemann [Lau83]. Recent work shows thatBPPis containedin classes that are seemingly weaker thanp2p2[Can96,RS95].

Even though a hierarchy theorem forBPPseems beyondour reach, there has been some success in showing hierarchy theorems for the seemingly relatedclassBPP/1 (i.e., BPP with a single bit of nonuniform advice) [Bar02, FS04, GST04]. We note

Exercises 141 that the problematic issues with both existence of complete problems andof hierarchy theorems do not occur in the generalization ofBPPtopromise problems, or equivalently to Boolean functions that may be defined only on a subset of{0, 1}.

The notationBP·NPdefined in Section7.6can be generalizedto arbitrary com-plexity classes other than NP, see Lecture G of [Koz06]. Under this generalization, BP·P=BPP.

Chapter21contains a much more through treatment of random walks, covering both the randomness-efficient error reduction procedure mentioned in Section 7.4.1 andanalysis of the logspace connectivity algorithm sketchedin Section7.7.

EXERCISES

7.1. Show that one can efficiently simulate choosing a random number from 1 toNusing coin tosses. That is, show that for everyN andδ > 0 there is a probabilistic algo-rithmArunning in poly(logNlog(1/δ))-time with output in{1,. . .,N,?}such that (1) conditioned on not outputting?,A’s output is uniformly distributed in[N]and (2) the probability thatAoutputs?is at mostδ.

7.2. Show that for everyc > 0, the infinite sum

i1ic

2i is bounded by some constant (depending onc). That is, prove that for everyc>0 there isDsuch that for every n≥1,n

i=1 ic 2iD.

7.3. Show, given the numbersa,n,p (in binary representation), how to compute an (modp)in polynomial time.

H534

7.4. (Error Reduction forRP) LetL⊆ {0, 1}be such that there exists a polynomial-time PTMMsatisfying for everyx∈ {0, 1}: (1) IfxL, then Pr[M(x)=1)] ≥n−cand (2) ifxL, then Pr[M(x)=1] =0.

Prove that for everyd > 0 there exists a polynomial-time PTMMsuch that for everyx∈ {0, 1},(1)ifxLthen Pr[M(x)=1] ≥1−2−nd and(2)ifxLthen Pr[M(x)=1] =0.

H534

7.5. Let us study to what extent Lemma7.12truly needs the assumption thatρis efficiently computable. Describe a real numberρsuch that given a random coin that comes up

“Heads” with probabilityρ, a Turing machine can decide an undecidable language in polynomial time.

H534

7.6. (a) Prove that a languageLis inZPPiff there exists a polynomial-time PTMM with outputs in{0, 1,?}such that for everyx∈ {0, 1}, with probability 1,M(x)∈ {L(x),?}andPr[M(x)=?] ≤1/2.

(b) Prove Theorem7.8: Show thatZPP=RPcoRP.

7.7. A nondeterministic circuit has two inputs x,y. We say that C accepts xiff there existsysuch thatC(x,y)=1. The size of the circuit is measuredas a function of|x|. LetNP/polybe the languages that are decided by polynomial size nondeterministic circuits. Show thatBP·NPNP/poly.

7.8. Show that if3SAT ∈ BP·NP, thenPHcollapses top3. (Thus it is unlikely that 3SAT≤r3SAT.)

H534

Dans le document This page intentionally left blank (Page 165-168)