Definition. Probabilistic Turing machine [prob-turing-machine]

A computation model that begins with a tree. When you reach a branch, you flip a coin!

We can define complexity classes based on the probability of reaching accept/reject leaves.

Definition 1. Randomized Polynomial Time [RP]

The following are equivalent:

  1. L∈RPL \in \text{RP} (Randomized Polytime) if there is a probabilistic Turing machine that, on input xx, runs in time poly(|x|)\text{poly}\left( |x| \right), and has a greater than or equal to 50% chance of reaching an accepting leaf.

    • L∉RPL \notin \text{RP} if the probabilistic Turing machine has a 0% chance of reaching an accepting leaf. (must reach reject state)
    Algorithm’s Output Accept Reject
    Correct Output
    Accept ≥50%\geq 50\% / true positive ≤50%\leq 50\% / false negative
    Reject 0 / false positive 1 / true negative
  2. L∈RPL \in \text{RP} if there is a PTM that, on input xx, runs in time poly(|x|)\text{poly}\left( |x| \right) and has behavior:

    • x∈Lx \in L: Pr(accept)≥50%\text{Pr}\left( \text{accept} \right) \geq 50\%
    • x∉Lx \notin L: Pr(reject)=100%\text{Pr}\left( \text{reject} \right) = 100\%
  3. L∈RPL \in \text{RP} if there exists a deterministic polytime TM V such that:

    • x∈Lx \in L: for at least half of all yy with |y|=poly(|x|)|y| = \text{poly}\left( |x| \right), Vaccepts(x,y)V\ \text{accepts}\ \left( {x,y} \right)
    • x∉Lx \notin L: for all y with |y|=poly(|x|)|y| = \text{poly}\left( |x| \right), Vrejects(x,y)V\ \text{rejects}\ \left( {x,y} \right)

Question. Why is RP useful?

Answer. Because we can build things that compute in RP, but we cannot easily simulate NP.

…useful picture…

If there was an NP-complete language in RP, then RP would equal NP.

L∈NPL \in \text{NP} if there is a TM that, on input xx, runs in time poly(|x|)\text{poly}\left( |x| \right) and has behavior: Pr(reaching accept)>0\text{Pr}\left( \text{reaching accept} \right) > 0

Definition. co-RP

L∈coRPL \in \text{coRP} if there is a PTM that, on input xx, runs in time poly(|x|)\text{poly}\left( |x| \right), and has the following behavior:

  • x∈Lx \in L (strings in the language) have a 100% chance of being accepted
  • x∉Lx \notin L have at least or equal to 50% chance of being rejected

Example. A Probabilistic Puzzle

Let a=[a1,a2,a3,…an]a = \left\lbrack {a_{1},a_{2},a_{3},\ldots a_{n}} \right\rbrack be a vector of nn bits.

There are two possibilities:

  • aa is all zeros
  • exactly half of aa are zeros

Question. How many bits must you look at to tell?

Answer.

  • Non-probabilistically: n/2 + 1
  • Probabilistically: just one!

Definition 2. Bounded-error Probabilistic Polynomial Time [BPP]

L∈BPPL \in \text{BPP} (Bounded-error Probabilistic Polytime) if there is a probabilistic Turing machine that, on input xx, runs in time poly(|x|)\text{poly}\left( |x| \right) and has behavior:

  • x∈Lx \in L if the probability of accepting is greater than 23\frac{2}{3}
  • x∈Lx \in L if the probability of rejecting is greater than 23\frac{2}{3}
  • (23\frac{2}{3} is arbitrary: we just need pq>12\frac{p}{q} > \frac{1}{2})
Correct Output / Algorithm’s Output Accept Reject
Accept ≥23\geq \frac{2}{3} / true positive ≤13\leq \frac{1}{3} / false negative
Reject ≤13\leq \frac{1}{3} / false positive ≥23\geq \frac{2}{3} / true negative

…helpful diagram…

Definition 3. Amplification [amplification]

Modifying the definition of RP\text{RP} a little bit: L∈RP(p)L \in \text{RP}(p) if there is a PTM that, on input xx, runs in time poly(|x|)\text{poly}\left( |x| \right) and has behavior:

  • Pr(reaching accept)≥p\text{Pr}\left( \text{reaching accept} \right) \geq p
  • Pr(reaching reject)=1\text{Pr}\left( \text{reaching reject} \right) = 1

Example. Claim: RP(12)=RP(34)\text{RP}\left( \frac{1}{2} \right) = \text{RP}\left( \frac{3}{4} \right)

Proof.

Let L∈RP(12)L \in \text{RP}\left( \frac{1}{2} \right). There exists PTM MM such that x∈L:P(Macceptx)≥12x \in L:P\left( {M\ \text{accept}\ x} \right) \geq \frac{1}{2}, x∉L:Pr(Mrejectsx)=1x \notin L:\text{Pr}\left( {M\ \text{rejects}\ x} \right) = 1.

Let NN be the Turing machine on input xx

  • Run MM on input xx
  • Run MM on input xx
  • if either accepted, then accept
  • else reject