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

BPP: Bounded Error Probabilistic Polynomial Time

Research Depth 101 in the knowledge graph ☐ I know this ☆ Set as goal
20topics build on this
521prerequisites beneath it
See this on the map →
Complexity Class P: Polynomial TimeProbabilistic Turing Machines+1 more→→BQP and Quantum Complexity ClassesDerandomization Techniques+4 more
complexity-classes randomized-algorithms

Core Idea

BPP is the class of languages decided by a probabilistic PTM in polynomial time with two-sided error at most 1/3 (amplifiable to any ε > 0 via repetition). BPP trivially contains P. It is widely believed (but unproven) that BPP ⊆ NP and BPP ⊆ P with high probability, though NP ⊆ BPP would cause PH to collapse, suggesting BPP is 'small' relative to NP. BPP captures practical randomized algorithms where error probability is controllable and output distribution matters.

Explainer

You already know that P captures problems solvable efficiently by deterministic machines, and that probabilistic Turing machines extend the deterministic model by allowing random coin flips during computation. BPP (Bounded-error Probabilistic Polynomial time) is the complexity class that asks: what can we solve efficiently if we allow randomness, provided we keep errors under control? Specifically, a language L is in BPP if there exists a probabilistic Turing machine that runs in polynomial time and, for every input, gives the correct answer with probability at least 2/3. The machine can err on both sides — it might say "yes" when the answer is "no," or "no" when the answer is "yes" — but each type of error occurs with probability at most 1/3.

The choice of 1/3 as the error bound might seem arbitrary, and in a deep sense it is. The remarkable property of BPP is error amplification: by running the same algorithm multiple times and taking a majority vote, you can drive the error probability down exponentially. Run it 100 times and accept the majority answer, and your error probability drops to something astronomically small — far below the chance of a cosmic ray flipping a bit in your deterministic computer. This means the 1/3 threshold is not special; any constant strictly between 0 and 1/2 defines the same class. What matters is the gap between the success probability and 1/2.

Every problem in P is trivially in BPP — a deterministic algorithm is just a probabilistic one that never flips coins, so its error probability is zero. The deeper question is whether BPP is *strictly* larger than P. Most complexity theorists believe BPP = P, meaning randomness does not actually help for decision problems when you have enough time. Evidence for this belief comes from derandomization results: under plausible circuit complexity assumptions, every BPP algorithm can be simulated deterministically in polynomial time using pseudorandom generators. The celebrated proof that primality testing is in P (the AKS algorithm) is a concrete example — the randomized Miller-Rabin test was in BPP for decades before a deterministic polynomial algorithm was found.

BPP's relationship to NP is subtle. BPP is not known to be contained in NP, nor is NP known to be contained in BPP. However, if NP ⊆ BPP, the polynomial hierarchy would collapse to its second level — a consequence considered unlikely. This suggests that BPP is "small" and does not contain the hard problems in NP. In practice, BPP captures the power of real-world randomized algorithms: problems like polynomial identity testing and certain approximation tasks where flipping coins yields efficient solutions with controllable, negligible error. The class formalizes the intuition that an algorithm you can trust 99.9999% of the time is, for all practical purposes, as good as a deterministic one.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Finite State Machines (FSMs) → Deterministic Finite Automata (DFA) → Nondeterministic Finite Automata (NFA) → Two-Way Finite Automata → NFA to DFA Conversion (Subset Construction) → DFA Properties and Minimization Algorithms → Regular Languages: Definition and Characterization → Context-Free Grammars (CFGs) → Pushdown Automata (PDA) → Equivalence of CFGs and Pushdown Automata → Closure Properties of Context-Free Languages → Limitations of Context-Free Languages → Pumping Lemma for Context-Free Languages → Turing Machines → Variants of Turing Machines and Equivalence → Nondeterministic Time Complexity and NP → The P vs. NP Problem → Complexity Class P: Polynomial Time → Complexity Class NP: Nondeterministic Polynomial Time → NP-Completeness and Cook-Levin Theorem → The Cook-Levin Theorem → Boolean Satisfiability, Cook-Levin, and Reductions → Polynomial Many-One Reductions → BPP: Bounded Error Probabilistic Polynomial Time

Longest path: 102 steps · 521 total prerequisite topics

Prerequisites (3)

Leads To (6)