In computational complexity theory, randomized polynomial time (RP) is the complexity class of decision problems for which a probabilistic Turing machine exists with these properties:
Formal definition
A language L is in RP if and only if there exists a probabilistic Turing machineM, such that • M runs for polynomial time on all inputs • For all x in L, M outputs 1 with probability greater than or equal to 1/2 • For all x not in L, M outputs 0 Alternatively, RP can be defined using only deterministic Turing machines. A language L is in RP if and only if there exists a polynomial p and deterministic Turing machine M, such that • M runs for polynomial time p on all inputs • For all x in L, the fraction of strings y of length p(|x|) that satisfy is greater than or equal to 1/2 • For all x not in L, and all strings y of length p(|x|), In this definition, the string y corresponds to the output of the random coin flips that the probabilistic Turing machine would have made. For some applications this definition is preferable since it does not mention probabilistic Turing machines. == Related complexity classes ==
Related complexity classes
, co-RP, BPP, BQP, PP), which generalise P within PSPACE. It is unknown if any of these containments are strict. The definition of RP says that a YES-answer is always right and that a NO-answer might be wrong, as a YES-instance can return a NO-answer. The complexity class co-RP is the complement, where a YES-answer might be wrong while a NO-answer is always right. The class BPP describes algorithms that can give incorrect answers on both YES and NO instances, and thus contains both RP and co-RP. The intersection of the sets RP and co-RP is called ZPP. Just as RP may be called R, some authors use the name co-R rather than co-RP. == Connection to P and NP ==
Connection to P and NP
{{unsolved|computer science|{{tmath|1= \mathsf P \overset{?}{=} \mathsf{RP} }}}} P is a subset of RP, which is a subset of NP. Similarly, P is a subset of co-RP, which is a subset of co-NP. It is not known whether these inclusions are strict. However, if the commonly believed conjecture P = BPP is true, then RP, co-RP, and P collapse (are all equal). Assuming in addition that P ≠ NP, this then implies that RP is strictly contained in NP. It is not known whether RP = co-RP, or whether RP is a subset of the intersection of NP and co-NP, though this would be implied by P = BPP. A natural example of a problem in co-RP currently not known to be in P is polynomial identity testing, the problem of deciding whether a given multivariate arithmetic expression over the integers is the zero-polynomial. For instance, is the zero-polynomial while is not. An alternative characterization of RP that is sometimes easier to use is the set of problems recognizable by nondeterministic Turing machines where the machine accepts if and only if at least some constant fraction of the computation paths, independent of the input size, accept. NP on the other hand, needs only one accepting path, which could constitute an exponentially small fraction of the paths. This characterization makes the fact that RP is a subset of NP obvious. ==See also==