Suppose the algorithm errs in both directions with probability \le 1/2 - \varepsilon (where \varepsilon > 0 is the bias).
Run the algorithm k times and output the majority vote.
By Chernoff bounds, majority error probability decays exponentially: \Pr(\text{majority error}) \le e^{-O(k \varepsilon^2)}
Note: This requires independent coin flips across runs; correlated runs do not amplify.
How do we convert an expected-time algorithm (Las Vegas) into a fixed-time algorithm (Monte Carlo)?
Stopping Prematurely (The Cutoff Strategy): Run the Las Vegas algorithm for a fixed time limit t. If it has not finished, stop it prematurely and output a default answer.
Error Probability Bound: By Markov’s Inequality, the probability that running time T exceeds cutoff t is: \Pr(T \ge t) \le \frac{\mathbb{E}[T]}{t}
Setting t = c \cdot \mathbb{E}[T] guarantees a failure probability \le 1/c.
Example: t = 10 \times \mathbb{E}[T] yields failure \le 10\%.
We can convert a Monte Carlo algorithm into a Las Vegas algorithm whenever a cheap verification algorithm (checker) exists.
Expected Runtime Analysis:
Let T_{MC} be the Monte Carlo runtime, T_{check} the verification time, and p the success probability.
The round count N is Geometric: \mathbb{E}[N] = 1/p.
Each round independently costs T_{MC} + T_{check}, so the total expected time is: \mathbb{E}[T] = \mathbb{E}\!\left[\sum_{i=1}^N (T_{MC} + T_{check})\right] \qquad = \mathbb{E}[N]\,(T_{MC} + T_{check}) = \frac{T_{MC} + T_{check}}{p}
Constraint: Requires a checker cheaper than the algorithm itself.
A Deterministic Turing Machine (DTM) is the standard mathematical model of computation:
Components:
Transition Function: \delta: Q \times \Gamma \to Q \times \Gamma \times \{L, R\}
Time Complexity: The machine halts in at most p(|x|) steps for some polynomial p.
We classify decision problems that can be solved efficiently:
Definition: Languages decidable by a DTM in polynomial time.
Formal Definition: L \in \text{P} if there exists a polynomial-time DTM M such that for all x: x \in L \iff M(x) = \text{Accept}
Intuition: “Easy to solve” deterministically. Examples: Sorting, Shortest Path, Primality Testing.
We classify decision problems whose solutions can be verified efficiently:
Definition: Languages verifiable in polynomial time given a short certificate (witness).
Formal Definition: L \in \text{NP} if there exists a polynomial p and a polynomial-time DTM V (verifier) such that for all x: x \in L \iff \exists y \in \{0,1\}^{p(|x|)} \text{ s.t. } V(x, y) = \text{Accept}
Intuition: “Easy to verify”, possibly hard to solve. Examples: SAT, Clique, Traveling Salesperson.
Randomized Complexity Classes — motivation, randomized Turing machines, RP, co-RP, BPP, ZPP, and the Probabilistic Method.
CS G526: Advanced Algorithms & ComplexityTulasimohan Molli