First suppose . Run the RP algorithm for and the RP algorithm for its complement with fresh random bits. If the first accepts, output one; if the second accepts, output zero; otherwise repeat. Neither output can be wrong, and on every input the appropriate algorithm accepts in each round with probability at least . The number of rounds is dominated by a geometric distribution of mean two, so this is an always-correct algorithm with polynomial expected running time.
Conversely, let be always correct when it halts and have expected running time at most . Run it for steps. Markov inequality givesAccept exactly when halts and outputs one; this is an RP algorithm for . Accepting exactly when it halts and outputs zero is an RP algorithm for the complement. Thereforeis equivalent to zero-error expected polynomial time.
Articles by others on the same topic
There are currently no matching articles.