In computational complexity theory, ZPP (zero-error probabilistic polynomial time) is the complexity class of decision problems for which a probabilistic Turing machine exists with the following properties:
- It always returns the correct YES or NO answer.
- The running time is polynomial in expectation for every input.
In other words, if the algorithm is allowed to flip truly random coins while running, it will always return the correct answer and, for a problem of size n, there is some polynomial p(n) such that the average running time will be less than p(n), even though it might occasionally be much longer. Such an algorithm is called a Las Vegas algorithm.
Alternatively, ZPP can be defined as the class of problems for which a probabilistic Turing machine exists with these properties:
- It always runs in polynomial time.
- It returns one of the answers YES, NO, or DO NOT KNOW.
- The answer is always either DO NOT KNOW or the correct answer.
- It returns DO NOT KNOW with probability at most 1/2 for every input (and the correct answer otherwise).
These two definitions are equivalent.
Intersection Definition
The class ZPP is exactly equal to the intersection of the classes RP (randomized polynomial time) and co-RP. This is often taken to be the definition of ZPP. Formally:
ZPP = RP ∩ co-RP
This equivalence can be proven in both directions:
- Any problem in both RP and co-RP has a Las Vegas algorithm (showing RP ∩ co-RP ⊆ ZPP).
- Any Las Vegas algorithm can be converted into both an RP algorithm and a co-RP algorithm (showing ZPP ⊆ RP ∩ co-RP).
Relationship to Other Complexity Classes
- P ⊆ ZPP: The class P (deterministic polynomial time) is contained in ZPP. Some computer scientists have conjectured that P = ZPP, though this remains unproven.
- ZPP ⊆ RP and ZPP ⊆ co-RP: Since ZPP = RP ∩ co-RP, it is contained in both.
- ZPP ⊆ BPP: ZPP is contained in BPP (bounded-error probabilistic polynomial time).
- There exists an oracle relative to which ZPP = EXPTIME. A proof that ZPP = EXPTIME without an oracle would imply that P ≠ ZPP, since P ≠ EXPTIME by the time hierarchy theorem.
Complexity-Theoretic Properties
- ZPP is closed under complement: ZPP = co-ZPP.
- ZPP is low for itself: ZPP^ZPP = ZPP, meaning a ZPP machine with access to a ZPP oracle is no more powerful than a standard ZPP machine.
- ZPP^NP^BPP = ZPP^NP.
- NP^BPP is contained in ZPP^NP.
Witness Perspective
ZPP can be understood in terms of proofs of membership. For the classes RP and ZPP, any randomly chosen string is likely to be a witness for membership (or non-membership, in the case of co-RP). ZPP is the class of sets for which any random string is likely to be a witness of x in X, or x not in X, whichever the case may be.