Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
RP (complexity)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{short description|Randomized polynomial time class of computational complexity theory}} In [[computational complexity theory]], '''randomized polynomial time''' ('''RP''') is the [[complexity class]] of problems for which a [[probabilistic Turing machine]] exists with these properties: {|class="wikitable" style="float:right;text-align:center;margin-left:1em" !colspan="3"|RP algorithm (1 run) |- ! {{diagonal split header |2=Answer produced |1=Correct<br/>answer}} ! {{yes}} ! {{no}} |- ! {{yes}} | β₯ 1/2 | β€ 1/2 |- ! {{no}} | 0 | 1 |- !colspan="3"|RP algorithm (''n'' runs) |- ! {{diagonal split header |2=Answer produced |1=Correct<br/>answer}} ! {{yes}} ! {{no}} |- ! {{yes}} | β₯ 1 β 2<sup>β''n''</sup> | β€ 2<sup>β''n''</sup> |- ! {{no}} | 0 | 1 |- !colspan="3"|co-RP algorithm (1 run) |- ! {{diagonal split header |2=Answer produced |1=Correct<br/>answer}} ! {{yes}} ! {{no}} |- ! {{yes}} | 1 | 0 |- ! {{no}} | β€ 1/2 | β₯ 1/2 |} * It always runs in polynomial time in the input size * If the correct answer is NO, it always returns NO * If the correct answer is YES, then it returns YES with probability at least 1/2 (otherwise, it returns NO). In other words, the [[algorithm]] is allowed to flip a truly random coin while it is running. The only case in which the algorithm can return YES is if the actual answer is YES; therefore if the algorithm terminates and produces YES, then the correct answer is definitely YES; however, the algorithm can terminate with NO ''regardless'' of the actual answer. That is, if the algorithm returns NO, it might be wrong. Some authors call this class '''R''', although this name is more commonly used for the class of [[recursive language]]s. If the correct answer is YES and the algorithm is run ''n'' times with the result of each run [[Statistical independence|statistically independent]] of the others, then it will return YES at least once with probability at least {{math|1 β 2<sup>β''n''</sup>}}. So if the algorithm is run 100 times, then the chance of it giving the wrong answer every time is lower than the chance that cosmic rays corrupted the memory of the computer running the algorithm.<ref>This comparison is attributed to [[Michael O. Rabin]] on p. 252 of {{citation|contribution=Classifying Problems into Complexity Classes|first=William|last=Gasarch|url=http://www.cs.umd.edu/~gasarch/COURSES/452/F14/mysurvey.pdf|pages=239β292| author1-link=William Gasarch | title=Advances in Computers, Vol. 95|editor-first=Atif|editor-last=Memon|publisher=Academic Press|year=2014}}.</ref> In this sense, if a source of random numbers is available, most algorithms in '''RP''' are highly practical. The fraction 1/2 in the definition is arbitrary. The set '''RP''' will contain exactly the same problems, even if the 1/2 is replaced by any constant nonzero probability less than 1; here constant means independent of the input to the algorithm.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)