Question: Suppose we have a Monte Carlo algorithm, A, and a deterministic algorithm, B, for testing if the output of A is correct. How can we
Suppose we have a Monte Carlo algorithm, A, and a deterministic algorithm, B, for testing if the output of A is correct. How can we use A and B to construct a Las Vegas algorithm? Also, if A succeeds with probability 1/2, and both A and B run in O(n) time, what is the expected running time of the Las Vegas algorithm that is produced?
Step by Step Solution
3.36 Rating (159 Votes )
There are 3 Steps involved in it
To construct a Las Vegas algorithm from A and B we can use a while loop to k... View full answer
Get step-by-step solutions from verified subject matter experts
