PP (复杂度)

在计算复杂度理论内，PP是一个复杂度类，包含可以在多项式时间里面以概率图灵机解决，无论输入如何错误率均小于1/2的决定型问题。PP这个缩写即代表了概率多项式时间（probabilistic polynomial time）。这个复杂度类是由Gill于1977年定义。
"n", where "n" is the length of the input.
Because these two probabilities are so close together, especially for large "n", even if we run it a large number of times it is very difficult to tell whether we are operating on a YES instance or a NO instance. Attempting to achieve a fixed desired probability level using a majority vote and the Chernoff bound requires a number of repetitions that is exponential in "n".
PP compared to other complexity classes.
PP contains BPP, since probabilistic algorithms described in the definition of BPP form a subset of those in the definition of PP. 
PP also contains NP. To prove this, we show that the NP-complete satisfiability problem belongs to PP. Consider a probabilistic algorithm that, given a formula "F"("x"1, "x"2, ..., "x""n")" chooses an assignment "x"1, "x"2, ..., "x""n" uniformly at random. Then, the algorithm checks if the assignment makes the formula "F" true. If yes, it outputs YES. Otherwise, it outputs YES with probability 1/2 and NO with probability 1/2.
If the formula is unsatisfiable, the algorithm will always output YES with probability 1/2. If there exists a satisfying assignment, it will output YES with probability more than 1/2 (exactly 1/2 if it picked an unsatisfying assignment and 1 if it picked a satisfying assignment, averaging to some number greater than 1/2). Thus, this algorithm puts satisfiability in PP. As SAT is NP-complete, and we can prefix any deterministic polynomial-time many-one reduction onto the PP algorithm, NP is contained in PP. Because PP is closed under complement, it also contains co-NP.
PP also contains BQP, the class of decision problems solvable by efficient polynomial time quantum computers. In fact, BQP is low for PP, meaning that a PP machine achieves no benefit from being able to solve BQP problems instantly. The class of polynomial time on quantum computers with postselection, PostBQP, is equal to PP (see #Quantum computation reformulation below).
A polynomial time Turing machine with a PP oracle (PPP) can solve all problems in PH, the entire polynomial hierarchy. This result was shown by Seinosuke Toda in 1989 and is known as Toda's theorem. This is evidence of how hard it is to solve problems in PP. The class #P is in some sense about as hard, since P#P = PPPand therefore P#P contains PH as well.
PP strictly contains TC0, the class of constant-depth, unbounded-fan-in boolean circuits with majority gates. (Allender 1996, as cited in Burtschick 1999).
PP is contained in PSPACE. This can be easily shown by exhibiting a polynomial-space algorithm for MAJSAT, defined below; simply try all assignments and count the number of satisfying ones.
Complete problems and other properties.
Unlike BPP, PP is a syntactic, rather than semantic class. Any polynomial-time probabilistic machine recognizes some language in PP. In contrast, given a description of a polynomial-time probabilistic machine, it is undecidable in general to determine if it recognizes a language in BPP. 
PP has natural complete problems, for example, MAJSAT. MAJSAT is a decision problem in which one is given a Boolean formula F. The answer must be YES if more than half of all assignments "x"1, "x"2, ..., "x""n" make F true and NO otherwise.
Proof that PP is closed under complement.
Let "L" be a language in PP. Let formula_1 denote the complement of "L". By the definition of PP there is a polynomial-time probabilistic algorithm "A" with the property that formula_2 and formula_3. We claim that without loss of generality, the latter inequality is always strict; once we do this the theorem can be proved as follows. Let formula_4 denote the machine which is the same as "A" except that formula_4 accepts when "A" would reject, and vice-versa. Then formula_6 and formula_7, which implies that formula_1 is in PP.
Now we justify our without loss of generality assumption. Let formula_9 be the polynomial upper bound on the running time of "A" on input "x". Thus "A" makes at most formula_9 random coin flips during its execution. In particular, formula_11 since the probability of acceptance is an integer multiple of formula_12. Define a machine "A' " as follows: on input "x", "A' " runs "A" as a subroutine, and rejects if "A" would reject; otherwise, if "A" would accept, "A' " flips formula_13 coins and rejects if they are all heads, and accepts otherwise. Then 
formula_14
and formula_15. This justifies the assumption (since "A' " is still a polynomial-time probabilistic algorithm) and completes the proof.
David Russo proved in his 1985 Ph.D. thesis that PP is closed under symmetric difference. It was an open problem for 14 years whether PP was closed under union and intersection; this was settled in the affirmative by Beigel, Reingold, and Spielman. Alternate proofs were later given by Li and Aaronson (see #Quantum computation reformulation below).
Other equivalent complexity classes.
PostBQP.
The quantum complexity class BQP is the class of problems solvable in polynomial time on a quantum Turing machine. By adding postselection, a larger class called PostBQP is obtained. Informally, postselection gives the computer the following power: whenever some event (such as measuring a qubit in a certain state) has nonzero probability, you are allowed to assume that it takes place. Scott Aaronson showed in 2004 that PostBQP is equal to PP. This reformulation of PP makes it easier to show certain results, such as that PP is closed under intersection (and hence, under union), that BQP is low for PP, and that QMA is contained in PP.
PQP.
PP is also equal to another quantum complexity class known as PQP, which is the unbounded error analog of BQP. It denotes the class of decision problems solvable by a quantum computer in polynomial time, with an error probability of less than 1/2 for all instances.