Definition. 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!