Main

Lecture 3: Models & Complexity Classes

Las Vegas vs Monte Carlo, the amplification gap that splits BPP from PP, the class zoo (RP/ZPP/PP/BPP), and why a weak δ-random source is secretly as good as a perfect one.

Last updated 27 June 2026

Lecture 3 — Models of Probabilistic Computation & Complexity Classes

Course 2-INF-135/15 Pravdepodobnostné algoritmy, LS 2025/26. Source slides: 03_slidy.pdf (28 pages).

What this lecture is about

Lectures 1–2 built and analysed randomized algorithms. This lecture steps back and asks the structural questions:

  1. Where can the randomness sit, and what kind of error does it cause? (Two ways to classify every randomized algorithm.)
  2. How do we drive the error down? (Repetition + majority — and the one number, the gap ε\varepsilon, that decides whether this is cheap or ruinously expensive.)
  3. Which complexity classes do these algorithms define? (RP, coRP, ZPP, PP, BPP — their definitions, the lemmas that make them robust, and how they nest.)
  4. What if our coins are bad? (A weak random source — biased and correlated — can wreck an algorithm; yet we will prove that for BPP it makes no difference at all.)

The single thread running through all of it: a randomized algorithm is a deterministic algorithm plus a string of coin flips rr. Everything below is about how good those coins have to be and what we promise about the answer.


1. Two ways to place the randomness

There are two equally valid pictures of where the probability lives.

Model I — a distribution over deterministic strategies. We have a fixed pool of deterministic algorithms {A1,,Am}\{A_1, \dots, A_m\}. On input ww we pick an index iR{1,,m}i \in_R \{1, \dots, m\} once, uniformly at random, and then run that one deterministic computation Ci=Ai(w)C_i = A_i(w).

Picture: roll a die once, then follow the rulebook it selected. The only randomness is the initial choice of strategy. Examples: the database equality test X=?YX \overset{?}{=} Y (the random choice is which position to probe), Freivalds’ AB=?CAB \overset{?}{=} C (random vector).

Model II — a nondeterministic algorithm with a distribution over its choices. The algorithm branches as it runs, and each branch point is resolved by a coin flip. Randomness is used repeatedly, throughout the computation.

Picture: flip a fresh coin every time the algorithm reaches a fork. Example: randomized QuickSort re-randomizes the pivot at every level of recursion.

The two models have the same power (Model II’s coin-flip choices, read off in order, are a long random string — exactly the rr from the spine sentence). But they sharpen different intuitions: Model I = “randomly pick a method”, Model II = “randomness woven through the run”.


2. Classification by error: Las Vegas vs Monte Carlo

Let A()A(\cdot) be the algorithm and F()F(\cdot) the function we are trying to compute. There are three error regimes.

Type Promise Errs on… Example
Las Vegas Pr[A(x)=F(x)]=1\Pr[A(x) = F(x)] = 1 never (only time is random) boss-election, R-Select / Lazy-Select
Monte Carlo, one-sided xL: Pr[A(x)=1]12x\in L:\ \Pr[A(x)=1]\ge \tfrac12; xL: A(x)=0x\notin L:\ A(x)=0 only on yes-instances database equality test
Monte Carlo, two-sided Pr[A(x)=F(x)]12+ε\Pr[A(x)=F(x)] \ge \tfrac12 + \varepsilon either direction (but biased right) database inequality test

The three differ in what they promise:

Why the +ε+\varepsilon matters so much.12+ε\ge \tfrac12 + \varepsilon” is not cosmetic. The whole machinery of §4 and the gulf between BPP and PP in §6 turn on whether that ε\varepsilon is a constant or is allowed to shrink to 00 as the input grows. Keep your eye on the gap.


3. A worked two-sided example: testing XYX \neq Y

The cleanest illustration. Computer RIR_I holds X=x1xnX = x_1\dots x_n, RIIR_{II} holds Y=y1ynY = y_1\dots y_n, and we want to decide L={(X,Y)XY}L = \{(X,Y) \mid X \neq Y\} using few communicated bits.

Protocol. RIR_I picks a position jR{1,,n}j \in_R \{1,\dots,n\} and sends the pair (j,xj)(j, x_j) to RIIR_{II}. Then RIIR_{II}:

{accept (declare XY)if xjyj,flip a biased coin: {acceptw.p. 1212nrejectw.p. 12+12nif xj=yj. \begin{cases} \textbf{accept} \ (\text{declare } X\neq Y) & \text{if } x_j \neq y_j,\\[4pt] \text{flip a biased coin: } \begin{cases} \textbf{accept} & \text{w.p. } \tfrac12 - \tfrac{1}{2n}\\ \textbf{reject} & \text{w.p. } \tfrac12 + \tfrac{1}{2n} \end{cases} & \text{if } x_j = y_j. \end{cases}

Communication cost: 2logn2\log n bits (send an index and one bit) versus nn for any deterministic protocol. This is the payoff.

Correctness — check both kinds of input. The worst case for detecting a difference is when the strings differ in exactly one position, $\exists! j: x_j \neq y_j$ (fewest chances to catch it), so we analyse that.

The point. A single probe and a tiny engineered bias (12n\tfrac{1}{2n}) are enough to beat 12\tfrac12 in both directions. That is precisely a two-sided-error Monte Carlo algorithm — correct with probability >12> \tfrac12 on every input. The gap here (ε1n2\varepsilon \sim \tfrac{1}{n^2}) is not constant, which (foreshadowing §6) is exactly the kind of vanishing gap that lands a problem in PP rather than BPP.


4. Driving the error down by repetition

4a. Las Vegas has two faces, and they are interchangeable

There are two ways to define Las Vegas, and proving them equivalent is a tiny gem that reuses Markov’s inequality from Lecture 2.

  1. “Never lies, may shrug”: A?A^? outputs A?(x)=F(x)A^?(x) = F(x) or $A^?(x) =
    \ ?$ (“don’t know”), with Pr[?]12\Pr[\,?\,] \le \tfrac12.
  2. “Always correct, random time”: Pr[A(x)=F(x)]=1\Pr[A(x) = F(x)] = 1.

121 \Rightarrow 2: repeat A?A^? until it returns a real answer. Each trial succeeds with probability 12\ge \tfrac12, so

E[#repetitions]=1Pr[answer]11/2=2.E[\#\text{repetitions}] = \frac{1}{\Pr[\text{answer}]} \le \frac{1}{1/2} = 2.
We get a guaranteed-correct algorithm at the price of 22 runs in expectation.

212 \Rightarrow 1: run AA for at most 2E[T]2\,E[T] steps. By Markov, Pr[T>2E[T]]12\Pr[T > 2E[T]] \le \tfrac12, so with probability 12\ge \tfrac12 it has finished (and is correct); otherwise output “??”.

Deep point. “Always right but slow sometimes” and “fast but occasionally admits ignorance” are the same class, convertible for a factor of 22. Markov is the bridge from the random-time form to the shrug form — the very same “restart on FAIL, E[runs]<2E[\text{runs}] < 2” move that made R-Select linear in Lecture 2.

4b. Bounded two-sided error: a constant number of repetitions

Suppose Pr[A(x)=F(x)]12+ε\Pr[A(x) = F(x)] \ge \tfrac12 + \varepsilon. Run AA a total of tt times and decide by majority. Let XX = number of correct runs; $X \sim \mathrm{Bin}(t, p)$ with p=12+εxp = \tfrac12 + \varepsilon_x, $\varepsilon_x \ge \varepsilon$. Majority is wrong iff fewer than half the runs are correct:

1Pr[majority correct]=i=0t/21Pr[X=i]. 1 - \Pr[\text{majority correct}] = \sum_{i=0}^{t/2 - 1} \Pr[X = i].

The elementary bound (no Chernoff needed). Write $p(1-p) = (\tfrac12 + \varepsilon_x)(\tfrac12 - \varepsilon_x) = \tfrac14 - \varepsilon_x^2$. For a losing term (i<t/2i < t/2, so the exponent on the smaller factor $(\tfrac12 - \varepsilon_x)$ dominates),

Pr[X=i]=(ti)(12+εx)i(12εx)ti(ti)(14εx2)t/2. \Pr[X=i] = \binom{t}{i}\Big(\tfrac12+\varepsilon_x\Big)^{i}\Big(\tfrac12-\varepsilon_x\Big)^{t-i} \le \binom{t}{i}\Big(\tfrac14-\varepsilon_x^2\Big)^{t/2}.
Summing over all ii and using i=0t(ti)=2t\sum_{i=0}^{t}\binom{t}{i} = 2^t:
i=0t/21Pr[X=i]<(14εx2)t/22t=(14)t/22t=1(14εx2)t/2=(14εx2)t/2(14ε2)t/2. \sum_{i=0}^{t/2-1}\Pr[X=i] < \Big(\tfrac14-\varepsilon_x^2\Big)^{t/2}\cdot 2^t = \underbrace{\big(\tfrac14\big)^{t/2} 2^t}_{=\,1}\,(1-4\varepsilon_x^2)^{t/2} = (1-4\varepsilon_x^2)^{t/2} \le (1-4\varepsilon^2)^{t/2}.

Set the target error δ\delta: solving (14ε2)t/2=δ(1-4\varepsilon^2)^{t/2} = \delta,

t=2lnδln(14ε2). \boxed{\,t = \dfrac{2\ln\delta}{\ln(1-4\varepsilon^2)}\,}.

The headline. If ε\varepsilon and δ\delta are constants, then tt is a constant. A bounded-error algorithm can be amplified to any fixed confidence with O(1)O(1) repetitions — this is exactly what makes BPP a well-behaved class. (Push δ=2p(n)\delta = 2^{-p(n)} and you still only pay t=O(p(n))t = O(p(n)) repetitions, because the denominator is a constant.)

4c. Unbounded error: the gap can cost you everything

Now suppose Pr[A(x)=F(x)]>12\Pr[A(x) = F(x)] > \tfrac12 but the gap is allowed to shrink with the input, e.g. ε=2x\varepsilon = 2^{-|x|}. The same formula gives

t=2lnδln(1422x)  ln(14y)4y  2lnδ422x=12(lnδ)22x. t = \frac{2\ln\delta}{\ln(1 - 4\cdot 2^{-2|x|})} \;\overset{\ln(1-4y)\le -4y}{\ge}\; \frac{2\ln\delta}{-4\cdot 2^{-2|x|}} = -\tfrac12 (\ln\delta)\, 2^{\,2|x|}.
The number of repetitions needed is exponential in x|x|.

The single most important contrast in this lecture. The amplification formula is the same; only the gap ε\varepsilon changes.

  • Constant gap (bounded away from 12\tfrac12) \Rightarrow constant amplification \Rightarrow the friendly class BPP.
  • Vanishing gap (may approach 12\tfrac12) \Rightarrow exponential amplification \Rightarrow the monstrous class PP (which, we’ll see, contains all of NP).

Everything separating BPP from PP is whether the gap is bounded.


5. The complexity classes

All classes below use polynomial-time probabilistic Turing machines (PTMs). They differ only in the promise on yes- and no-instances.

RP — one-sided error, “yes” is trustworthy

LRP:{xLPr[A(x)=1]12(may miss),xLA(x)=0(never a false "yes"). L \in \mathsf{RP}:\quad \begin{cases} x \in L &\Rightarrow \Pr[A(x)=1] \ge \tfrac12 \quad(\text{may miss}),\\ x \notin L &\Rightarrow A(x) = 0 \quad(\text{never a false "yes"}). \end{cases}

coRP is the mirror image: errs only on no-instances (“no” is trustworthy, “yes” might be a false alarm). coRP \subseteq coNP.

ZPP — zero error (the Las Vegas class)

ZPP:=RPcoRP,ZPPNPcoNP.\mathsf{ZPP} := \mathsf{RP} \cap \mathsf{coRP}, \qquad \mathsf{ZPP} \subseteq \mathsf{NP}\cap\mathsf{coNP}.

Deep point. RP errs one way, coRP the other; intersecting them cancels both error directions and leaves no error at all — only an occasional “don’t know”, i.e. extra expected time. ZPP = zero-error = Las Vegas. The intersection of two opposite one-sided errors is honesty.

PP — unbounded two-sided error

LPP:xL    Pr[A(x)=1]>12.L\in\mathsf{PP}:\quad x\in L \iff \Pr[A(x)=1] > \tfrac12.

The threshold is just a strict 12\tfrac12the gap may be exponentially small (this is the §4c regime). Consequences:

PP is essentially a counting class (it can detect a strict majority of an exponential tree). Its power comes entirely from the unbounded gap; the moment you demand a constant gap you drop to BPP.

BPP — bounded two-sided error (the practical class)

LBPP:xLPr[A(x)=1]34,xLPr[A(x)=0]34. L\in\mathsf{BPP}:\quad x\in L \Rightarrow \Pr[A(x)=1]\ge \tfrac34,\quad x\notin L \Rightarrow \Pr[A(x)=0]\ge \tfrac34.

(Any constant >12> \tfrac12 works — the 34\tfrac34 is just a convenient choice; what matters is a constant gap ε>0\varepsilon > 0.)

This is the class of randomized algorithms we actually trust: constant gap, amplifiable to astronomically small error for free.

BPP ⊆ P/poly (Adleman’s theorem)

A BPP language can be decided by polynomial-size circuits — one fixed “advice string” per input length works for all inputs of that length.

Proof (probabilistic method on the coins, with a union bound over inputs). First amplify so a single run errs with probability \le small, then take mm runs and majority-vote; by Chernoff, with m/4m/4 runs bad in expectation,

Pr[#badm/2]eδ2μ/3=em/12.\Pr[\#\text{bad} \ge m/2] \le e^{-\delta^2\mu/3} = e^{-m/12}.
Fix an input xx and let SxS_x = set of random-string-vectors $A(n) = (r_1,\dots,r_m)$ for which the majority is wrong. Then $E[|S_x|] \le e^{-m/12},2^{|A(n)|}, and summing over all $2^n inputs of length nn:
E[xSx]2nem/122A(n). E\Big[\sum_x |S_x|\Big] \le 2^n\cdot e^{-m/12}\cdot 2^{|A(n)|}.
If this is <2A(n)< 2^{|A(n)|} then some vector A(n)A(n) lies in no SxS_x — i.e. it is correct on every xx of length nn. The condition is 2nem/12<12^n e^{-m/12} < 1, satisfied by m=12(n+1)m = 12(n+1). Hard-code that one vector as advice \Rightarrow a poly-size circuit per length.

Same engine as the non-uniform derandomization tool (Adleman, RP\subseteq P/poly). Amplify until the bad-fraction is below 2n2^{-n}, union-bound over the 2n2^n inputs, conclude one random string is good for all of them, and freeze it. The probabilistic method applied to the coins themselves. Caveat (same as there): this proves existence of the advice; it does not hand you an efficient way to find it.

The class zoo, nested

PZPPRPBPPPPPSPACE, \mathsf{P}\subseteq\mathsf{ZPP}\subseteq\mathsf{RP}\subseteq\mathsf{BPP}\subseteq\mathsf{PP}\subseteq\mathsf{PSPACE},

with the one-sided wings and the NP connections:

RPNP,coRPcoNP,ZPP=RPcoRPNPcoNP,BPPP/poly. \mathsf{RP}\subseteq\mathsf{NP},\quad \mathsf{coRP}\subseteq\mathsf{coNP},\quad \mathsf{ZPP}=\mathsf{RP}\cap\mathsf{coRP}\subseteq\mathsf{NP}\cap\mathsf{coNP},\quad \mathsf{BPP}\subseteq\mathsf{P/poly}.

                 ┌── RP ──┐               ┌── NP ──┐
   P ── ZPP ──┤          ├── BPP ── PP ── PSPACE
                 └─ coRP ─┘               └─ coNP ─┘

A reading of the picture: error-free in the middle (P, ZPP), one-sided just outside (RP/coRP, each tucked under NP/coNP), bounded two-sided wider still (BPP), unbounded two-sided enormous (PP \supseteq NP), all swallowed by PSPACE. The famous open question lives here: is BPP = P? (Lecture 5’s PRGs say yes, under plausible hardness assumptions — randomness is a convenience, not a necessity.) Note BPP vs NP is not known either way.


6. Where do the coins come from? Sources of randomness

Every class above silently assumed perfect coins. Time to question that.

The perfect random source

A random variable producing an infinite stream x1x2{0,1}x_1 x_2 \dots \in \{0,1\}^* such that every length-nn prefix is uniform:

(y1,,yn):Pr[x1=y1,,xn=yn]=2n.\forall (y_1,\dots,y_n):\quad \Pr[x_1=y_1,\dots,x_n=y_n] = 2^{-n}.
Two requirements rolled into one:

This is an idealisation. Real physical sources (thermal noise, radioactive decay timings, mouse jitter) are biased and correlated. So:

The δ-random source (Santha–Vazirani)

Drop both guarantees. Fix 0<δ120 < \delta \le \tfrac12. The probability that bit ii is 11 may depend arbitrarily on all previous bits, written p(y1,,yi1)p(y_1,\dots,y_{i-1}), subject to only one constraint:

p(y1,,yi1)[δ,1δ]. p(y_1,\dots,y_{i-1}) \in [\delta,\, 1-\delta].
Pr[x1=y1,,xn=yn]=i=1n(yip()+(1yi)(1p())). \Pr[x_1=y_1,\dots,x_n=y_n] = \prod_{i=1}^{n}\Big( y_i\, p(\cdot) + (1-y_i)\big(1 - p(\cdot)\big)\Big).

Read it as an adversary. A demon sets each bit’s probability, looking at everything you’ve flipped so far, free to bias it as hard as it likes — except it can never push past δ\delta or 1δ1-\delta. So no bit is ever fully predictable (δ>0\delta>0), but bits can be heavily skewed and tangled. δ=12\delta = \tfrac12 forces every bit to a fair, independent coin (perfect source); δ=0\delta = 0 lets the demon fix bits outright (no randomness left).

Cautionary tale: 2-SAT random walk

Why we should worry. The classic 2-SAT algorithm (Papadimitriou): start with a random assignment αR{0,1}n\alpha \in_R \{0,1\}^n; while some clause is unsatisfied, pick one and flip a random one of its two variables.

With a fair coin, E[#flips]n2E[\#\text{flips}] \le n^2. Track the Hamming distance ii to a fixed satisfying assignment bb^*; let t(i)t(i) = expected flips from distance ii. An unsatisfied clause has 1\ge 1 of its two variables set wrong, so flipping a random one of the two moves toward bb^* with probability 12\ge \tfrac12:

t(0)=0,t(i)12(t(i1)+t(i+1))+1,t(n)t(n1)+1. t(0)=0,\qquad t(i) \le \tfrac12\big(t(i-1) + t(i+1)\big) + 1,\qquad t(n)\le t(n-1)+1.
Comparing with the equality version x(i)=12(x(i1)+x(i+1))+1x(i) = \tfrac12(x(i-1)+x(i+1))+1 gives t(i)x(i)=2ini2n2t(i) \le x(i) = 2in - i^2 \le n^2, hence E[#flips]n2E[\#\text{flips}] \le n^2. (A symmetric random walk on a line of length nn has quadratic hitting time — gambler’s ruin.)

With a δ-random source, the adversary can bias every flip away from bb^* (still within [δ,1δ][\delta,1-\delta]), turning the symmetric walk into one that drifts the wrong way \Rightarrow exponentially many flips.

Lesson. An analysis that leaned on true 12\tfrac12-coins (here: the symmetric walk) can be destroyed by a weak source. So: which classes survive a δ-source? That is the question the rest of the lecture answers — and the answer for BPP is wonderfully clean.

δ-RP, δ-BPP and the two easy boundary cases

Define δ-RP and δ-BPP exactly like RP/BPP, but the machine is fed by a δ-random source. Label each node’s edges F(0-son)+F(1-son)=1F(0\text{-son}) + F(1\text{-son}) = 1 with each value in [δ,1δ][\delta, 1-\delta]; $\Pr[\text{leaf}] = \prod_{\alpha \in \text{path}} F(\alpha)$.

The whole game is the strict interior 0<δ<120 < \delta < \tfrac12.


7. The theorem: a weak source is as good as a perfect one for BPP

Theorem. For every 0<δ<120 < \delta < \tfrac12,  δ-BPP=BPP\ \delta\text{-BPP} = \mathsf{BPP}.

The construction

Let NN be a BPP machine for LL with error reduced to 132\le \tfrac1{32}, input xx, running time p(x)p(|x|), needing n=p(x)n = p(|x|) random bits. Choose a constant block size

k=3logn+52δ2δ2. k = \frac{3\log n + 5}{2\delta - 2\delta^2}.
Pull nn blocks β1,,βn\beta_1,\dots,\beta_n, each kk bits, from the δ-source. For each “seed” Z{0,1,,2k1}Z \in \{0,1,\dots,2^k - 1\}, extract one bit per block by the inner product mod 22:
βiZ==1k(βi)Z(mod2). \beta_i \cdot Z = \sum_{\ell=1}^{k} (\beta_i)_\ell\, Z_\ell \pmod 2.
Run 2k2^k parallel simulations of NN: simulation ZZ uses the extracted random string (β1 ⁣ ⁣Z, β2 ⁣ ⁣Z, , βn ⁣ ⁣Z)(\beta_1\!\cdot\!Z,\ \beta_2\!\cdot\!Z,\ \dots,\ \beta_n\!\cdot\!Z). Decide by majority over the 2k2^k simulations.

Let T={(β1 ⁣ ⁣Z,,βn ⁣ ⁣Z):Z=0,,2k1}T = \{(\beta_1\!\cdot\!Z,\dots,\beta_n\!\cdot\!Z) : Z = 0,\dots,2^k-1\} be the T=2k|T| = 2^k extracted strings, and BB the set of “bad” strings on which NN errs, B2n/32|B| \le 2^n/32. The majority is wrong exactly when at least half the extracted strings are bad:

Pr[majority wrong]=Pr[TBT/2]. \Pr[\text{majority wrong}] = \Pr\big[\, |T \cap B| \ge |T|/2 \,\big].
Goal: show this is 14\le \tfrac14, so the simulation is correct with probability 34\ge \tfrac34 — landing LL in δ-BPP.

Why inner products extract randomness — three lemmas

Define the bias of an extracted bit as $\mathrm{bias}(\beta_i!\cdot!Z) = \big(\Pr[\beta_i!\cdot!Z = 1] - \Pr[\beta_i!\cdot!Z = 0]\big)^2$ and the collision probability of a source block Pr[β]2\Pr[\beta]^2.

Finish with Markov.

Pr[TB>T/2]E[TB]T/2T/8T/2=14. \Pr\big[\,|T\cap B| > |T|/2\,\big] \le \frac{E[|T\cap B|]}{|T|/2} \le \frac{|T|/8}{|T|/2} = \frac14.
So majority over the 2k2^k extracted simulations is correct with probability 34\ge \tfrac34, i.e. Lδ-BPPL \in \delta\text{-BPP}. \blacksquare

The punchline. A random source can be biased and adversarially correlated and it still does not matter for BPP — provided it is not fully predictable (δ>0\delta > 0). The recipe: chop the weak stream into blocks, distil near-fair, near-independent bits by inner products, run exponentially many (2k2^k) simulations on the distilled strings, and vote. Bias is bounded by a collision (Lemma 1–2), collision decays in the block size (Lemma 2), so few extracted bits are skewed, so few simulations are bad (Lemma 3), so the majority is right (Markov).

Randomness quality is free; only randomness quantity / predictability (the δ>0\delta > 0) is the real resource. The two boundaries pin it exactly: δ=0\delta = 0 (fully predictable) collapses to P, δ=12\delta = \tfrac12 is already perfect, and everything strictly in between is secretly just as powerful as perfect randomness. This is the historical seed of the entire theory of randomness extractors.


Closing themes

Idea One-line takeaway
Two placements of randomness distribution over deterministic strategies (Model I) vs. coin at every fork (Model II) — same power, different intuition.
Error taxonomy Las Vegas (never lies, random time) · one-sided MC (one trustworthy answer) · two-sided MC (biased toward truth).
Las Vegas duality “always correct, random time” \Leftrightarrow “fast, may shrug” — bridged by Markov, cost factor 22.
The gap ε\varepsilon is everything constant gap \Rightarrow O(1)O(1) amplification \Rightarrow BPP; vanishing gap \Rightarrow exponential amplification \Rightarrow PP.
Class zoo PZPPRPBPPPPPSPACE\mathsf{P}\subseteq\mathsf{ZPP}\subseteq\mathsf{RP}\subseteq\mathsf{BPP}\subseteq\mathsf{PP}\subseteq\mathsf{PSPACE}; RPNP\mathsf{RP}\subseteq\mathsf{NP}, ZPP=RPcoRP\mathsf{ZPP}=\mathsf{RP}\cap\mathsf{coRP}.
ZPP = zero error intersecting two opposite one-sided errors cancels both ⇒ honesty (= Las Vegas).
BPP ⊆ P/poly probabilistic method on the coins + union bound over 2n2^n inputs ⇒ one advice string per length (Adleman).
Weak sources a biased, correlated δ-source (δ>0\delta>0) is as good as perfect for BPP; extract by inner products, simulate, vote. Quality is free; only predictability (δ=0\delta=0) kills it.

complexity-classesrandomnessBPPRPerror-reduction

← Back to Randomized Algorithms