Advanced Topics, Frontiers & Applications

BPP

Imagine an algorithm that is allowed to flip coins as it runs, and most of the time gives you the right yes-or-no answer, but on any given run has a small chance of being wrong. That sounds dangerous, yet it is exactly the deal a lot of fast, practical algorithms offer. BPP is the official home for problems solvable this way: by an algorithm that runs in polynomial time, uses random bits, and answers correctly with high probability on every input.

Precisely, a decision problem is in BPP if there is a polynomial-time algorithm using random coin flips such that, for every input, it gives the correct answer with probability at least 2/3 (and the wrong one at most 1/3). The 2/3 is not magic: because the errors on independent runs are independent, you can run the algorithm many times and take a majority vote, and the chance of the majority being wrong shrinks astronomically fast. Run it a few hundred times and the failure probability drops below the chance of a cosmic ray flipping a bit in your computer. So 'usually right' becomes 'right for all practical purposes', cheaply.

BPP captures the idea of efficient computation if we are willing to accept a vanishingly small, controllable error. Clearly P (the deterministic polynomial-time problems) sits inside BPP, since an algorithm that never flips coins is a special case. The deep and beautiful surprise, discussed under derandomization, is that complexity theorists now widely believe P = BPP: that randomness, for decision problems, buys you essentially no extra computational power, only sometimes simpler or faster algorithms. That belief is still a conjecture, not a theorem.

For decades the fastest practical primality test was randomized (Miller-Rabin): to test whether n is prime, pick a random a and run a quick check that a 'witnesses' n being composite; a true prime always passes, and a composite fails for most a, so repeating with fresh random a makes a mistaken 'prime' verdict exponentially unlikely. PRIMES is thus easily in BPP — and was later shown to be in P outright.

A BPP algorithm flips coins, is usually right, and majority voting drives its error toward zero.

BPP error must be bounded away from 1/2 on EVERY input (the 'bounded-error' in the name); an algorithm that is right only 50.0001% of the time, with the gap shrinking as inputs grow, does not qualify, because amplification by voting no longer works cheaply.

Also called
bounded-error probabilistic polynomial timerandomized polynomial time隨機化複雜度有界錯誤機率多項式時間