A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

BPP and Randomized Complexity

Graduate Depth 94 in the knowledge graph I know this Set as goal
16topics build on this
566prerequisites beneath it
See this on the map →
NP and Polynomial-Time VerificationProbabilistic Computation and BPPInteractive ProofsRandomized Algorithms and Probabilistic Complexity Classes+1 more
complexity randomness derandomization BPP

Core Idea

BPP (Bounded-error Probabilistic Polynomial time) is the class of decision problems solvable by a probabilistic Turing machine in polynomial time with error probability at most 1/3 on every input. The error can be driven exponentially small by independent repetition and majority voting. BPP sits between P and PSPACE (P is in BPP is in PSPACE), and is widely conjectured to equal P — meaning randomness likely does not help for decision problems. The Adleman-Sipser-Gacs theorem shows BPP is in P/poly (solvable by polynomial-size circuits), and conditional derandomization results based on circuit lower bounds support BPP = P.

How It's Best Learned

Study the Miller-Rabin primality test as a concrete BPP algorithm: it runs in polynomial time, always says "prime" for primes, and says "composite" with high probability for composites. Then prove the error-reduction lemma (amplification by repetition) to see why the 1/3 threshold is arbitrary. Finally, study Adleman's theorem (BPP is in P/poly) to understand the derandomization paradigm.

Common Misconceptions

Explainer

You already know that NP captures problems where a lucky guess — a non-deterministic choice — can verify a solution in polynomial time. BPP introduces a different kind of luck: instead of a single all-knowing guess, the machine flips coins and must get the right answer with high probability regardless of the input. The key word is "regardless": a BPP algorithm must work well on every input, not just on easy ones or on average. This is much stronger than an average-case guarantee.

The defining threshold of 2/3 correctness (equivalently, error at most 1/3) looks arbitrary — and it is. The power of BPP comes from error amplification: run the algorithm independently k times and take a majority vote. The probability that the majority is wrong drops exponentially in k by the Chernoff bound. So a BPP machine with 51% success probability can be boosted to 1 − 2−100 confidence using polynomially many repetitions. The 1/3 threshold is just a convenient landmark; any constant less than 1/2 gives the same class.

Where does BPP sit in the complexity landscape you know? P ⊆ BPP ⊆ PSPACE — randomness cannot help you escape polynomial space, but it might help you avoid exponential time. The biggest open question is whether BPP = P, meaning whether every randomized polynomial-time algorithm could be derandomized into a deterministic one. Most complexity theorists believe the answer is yes. Adleman's theorem provides indirect evidence: every BPP problem can be solved by polynomial-size Boolean circuits (BPP ⊆ P/poly). The circuit proof is elegant — for each input length, a good random seed exists by a counting argument, and hardwiring that seed into the circuit gives a deterministic solution.

A concrete anchor is the Miller-Rabin primality test: given a number n, it samples random witnesses and declares n composite if any witness exposes it. For a composite n, at least 3/4 of all possible witnesses are revealing, so the error probability after k rounds is at most (1/4)k — exponentially small. Prime numbers never get a false composite verdict. This is a canonical BPP algorithm: polynomial time, bounded error on every input, and practically fast. (It has since been superseded by AKS, a deterministic polynomial algorithm — consistent with the BPP = P conjecture.) Understanding BPP through this example illustrates how randomness can substitute for exponential search while keeping error tightly controlled.

Practice Questions 5 questions

Prerequisite Chain

Understanding ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersDividing IntegersUnit RatesProportionsPercent ConceptConverting Between Fractions, Decimals, and PercentsOperations with Rational NumbersTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionSine, Cosine, and Tangent RatiosTrigonometric Ratios ReviewRadian MeasureConverting Between Degrees and RadiansThe Unit CircleGraphing Sine and CosineGraphing Tangent and Reciprocal Trigonometric FunctionsDerivatives of Trigonometric FunctionsAntiderivativesIndefinite IntegralsBasic Integration RulesRiemann SumsDefinite Integral DefinitionProbability Density Functions and Continuous DistributionsCumulative Distribution FunctionsContinuous Random VariablesProbability Density FunctionsExpected ValueWeak Law of Large NumbersProbability Axioms and RulesConditional ProbabilityProbabilistic Computation and BPPBPP and Randomized Complexity

Longest path: 95 steps · 566 total prerequisite topics

Prerequisites (2)

Leads To (3)