This is a good question about computational complexity, specifically about the class BPP (Bounded-Error Probabilistic Polynomial time). Let me break this down carefully.
Definition of BPP
BPP (Bounded-Error Probabilistic Polynomial time) is defined as follows:
A language L is in BPP if there exists a probabilistic Turing machine M such that:
- M runs in polynomial time
- For any input x:
- If x ∈ L, then Pr[M accepts x] ≥ 2/3
- If x ∉ L, then Pr[M rejects x] ≥ 2/3 (equivalently, Pr[M accepts x] ≤ 1/3)
The "bounded-error" refers to the error probability being bounded by a constant strictly less than 1/2 (specifically 1/3 in the definition, though any constant less than 1/2 works).
The definition uses 2/3 as a standard choice, but it could be any constant probability p where 1/2 < p < 1.
Why Majority Voting Works - Probability Amplification
The key insight is that we can amplify the success probability even though individual runs have a relatively small advantage over random guessing.
Intuition:
- If a machine M has a 2/3 probability of being correct on one run, it has a 1/3 error probability
- If we run M multiple times independently and take the majority answer, the error probability drops exponentially
Mathematical Analysis:
Let's say we run the machine k times independently and take the majority vote.
For a language L and input x:
When x ∈ L (correct answer is YES):
-
Each run accepts with probability ≥ 2/3
-
We need at least ⌈k/2⌉ + 1 accepts out of k runs to accept via majority vote
-
Each run fails with probability ≤ 1/3
The probability that majority voting produces the wrong answer is bounded by the probability that fewer than half the runs succeed. Using Chernoff bounds, this tail probability decreases exponentially in k, giving us an error bound of 2^{-Ω(k)}.
More concretely, running the algorithm k times reduces the error to roughly 2^{-Ω(k)}, or equivalently, a polynomial factor times e^{-Ω(k)}. For instance, with k=5 runs the error drops to about 1/49, and with k=101 it becomes approximately 2^{-50}. Since we can set k = O(n) while keeping the total runtime at O(n · p(n)) where p(n) is the original polynomial bound, the amplification stays within polynomial time.
The success probability must exceed 1/2 for majority voting to be effective—anything better than random guessing works. Each run needs to use independent random bits to ensure the amplification actually reduces error exponentially. The specific threshold like 2/3 or 3/4 is somewhat arbitrary; what matters is that it's a constant strictly greater than 1/2, and all such constants are equivalent for defining BPP.
Any language recognized by a BPP machine with error probability 1/3 can be converted to one with exponentially small error through repeated trials and majority voting, or conversely reduced back to 1/3 without loss of generality. This amplification property is fundamental to why BPP remains a well-defined and robust complexity class despite its probabilistic foundation.
BPP: Definition and Probability Amplification
Definition of BPP
Bounded-Error Probabilistic Polynomial Time is the class of languages L where there exists a probabilistic Turing machine M such that:
- M runs in polynomial time
- For all inputs x:
- x ∈ L ⟹ Pr[M accepts x] ≥ 2/3
- x ∉ L ⟹ Pr[M rejects x] ≥ 2/3 (i.e., Pr[M accepts x] ≤ 1/3)
The error is bounded by a constant (1/3) strictly less than 1/2.
Why Majority Voting Amplifies Probability
The Core Idea
A machine with 2/3 accuracy has a 1/3 error probability. When we run it k times independently and take the majority answer, the error probability drops exponentially.
Mathematical Analysis
Let M be a machine with error probability ε ≤ 1/3. After k independent runs with majority voting:
Pr[majority vote fails]≤Pr[more than k/2 runs fail]
By Chernoff bounds (or a straightforward binomial calculation):
Pr[majority fails]≤2−Ω(k)
Numerical example (k odd runs, single threshold):
- k=1: error = 1/3
- k=3: error ≈ 1/9
- k=5: error ≈ 1/49
- k=101: error ≈ 2^{-50}
Key Insight: Preserved Polynomial Time
If the original machine runs in p(n) time and we run majority voting k = O(n) times:
Total time=O(n)×p(n)=polynomial in n
This is crucial—we get exponential error reduction with only polynomial time overhead.
Why This Works (Intuition)
| Aspect | Explanation |
|---|
| Threshold > 1/2 | Majority voting only works if each trial is better than a coin flip |
| Independence | Random bits across runs must be independent |
| Exponential tail bound | The binomial distribution's tail decays exponentially in k |
Why 2/3?
The exact constant doesn't matter—any probability p > 1/2 is equivalent. A machine with error 1/3 can be transformed to one with error 2^{-poly(n)} while staying in polynomial time.