# Lecture 21

## Probabilistic Turing Machines and Bounded-error Probabilistic Polynomial Time

Definition A probabilistic Turing machine is a non-deterministic Turing machine with $$2$$ transition functions $$\delta_0$$ and $$\delta_1$$. At each step of the computation, the Turing machine flips a coin to determine whether if follows the transition from $$\delta_0$$ or $$\delta_1$$.

Definition The running time of a probabilistic Turing machine $$M$$ is a function $$t:\mathbb{N}\rightarrow\mathbb{N}$$ such that for every input $$x\in\{0,1\}^n$$ and for each possible outcome of the coin flips, $$M$$ terminates after $$t(n)$$ steps.

Definition The probabilistic Turing machine $$M$$ decides $$L\subseteq\{0,1\}^*$$ with bounded error if it always halts and

1. when $$x\in L$$, $$M$$ accepts with probability $$\geq \frac{2}{3}$$.
2. when $$x\not\in L$$, $$M$$ rejects with probability $$\geq \frac{2}{3}$$.

Definition The language $$L\subseteq\{0,1\}^*$$ is in BPP if it is decided with bounded-error by a polynomial-time probabilistic Turing machine.

Thesis BPP captures all languages that can be computed efficiently in any reasonable model of randomized computations.

## Alternative Randomness Models

Definition A super general probabilistic Turing machine is a non-deterministic Turing machine where each transition is associated with a number $$0< p <1$$ that determines the probability that the Turing machine follows this transition at appropriate steps.

Proposition If $$L$$ can be decided by a super general probabilistic Turing machine with running time $$t$$ and all the transition probabilities of $$M$$ are of the form $$p=\frac{c}{2^k}$$ $$c,k\in\mathbb{N}$$, then it can be decided by a probabilistic Turing machine $$M'$$ with running time $$t'=O(t(n))$$.

Proof Build a binary tree of depth $$max(k)$$ for each step.

Theorem If $$L$$ can be decided by a polynomial-time super general probabilistic Turing machine whose transition probabilities are polynomial-time computable, then $$L\in BPP$$.

## Error Reduction

Proposition If $$M$$ decides $$L$$ with bounded error $$\frac{1}{3}$$ then there exists a probabilistic Turning machine $$M'$$ that decides $$L$$ with error at most $$\frac{7}{27}$$

Proof Have $$M'$$ run $$e$$ independent copies of $$M$$ and take the majority. The probability that at least two executions of $$M$$ are correct is $$(\frac{2}{3})^3+3(\frac{1}{3})(\frac{2}{3})^2=\frac{20}{27}$$

Theorem If $$M$$ decides $$L$$ with bounded error $$\frac{1}{3}$$ and running time $$t$$, then for any $$\epsilon >0$$ there is a probabilistic Turing machine $$M'$$ with bounded error $$\epsilon$$ and running time $$t'=O(t(n))$$

Proof Again by majority of enough copies of $$M$$.

Definition $$L$$ is in $$RP$$ if there is a polynomial-time probabilistic Turing machine such that

1. when $$x\in L$$, then $$M$$ accepts with probability $$\geq\frac{1}{2}$$
2. when $$x\not\in L$$, then $$M$$ always rejects.

Definition $$L$$ is in $$PerfectRP$$ if there is a polynomial-time probabilistic Turing machine $$M$$ such that $$M$$ accepts iff $$x\in L$$.

Proposition $$PerfectRP=P$$

## Average-case Running Time

Definition The average-case running time of a probabilistic Turing machine is a function $$t:\mathbb{N}\rightarrow\mathbb{N}$$ such that for every input $$x\in\{0,1\}^n$$, the expected running time of $$M$$ on $$x$$ is at most $$t(n)$$.

Definition $$L\in ZPP$$ (Zero-error Probabilistic Polynomial Time) if there is a probabilistic Turing machine $$M$$ with polynomial average-case running time such that $$M$$ accepts $$x$$ if $$x\in L$$.

Theorem If $$L$$ is decidable with bounded error by a probabilistic Turing machine with polynomial average-case running time, then $$L\in BPP$$

Proof Truncate (terminate) long-running Turing machine and guess.