Turn a Las Vegas algorithm to a Monte Carlo algorithm.
Let A be a randomized algorithm for some decision problem P (e.g., to decide if a graph is connected or not).
Suppose that for any given instance of P of size n, A runs in expected T(n) time and always outputs the correct answer. Use A to give a new randomized algorithm NEWALG for the problem P such that NEWALG always runs in 100T(n) time and
• if the input is a 'Yes' instance¹, then it will be accepted with probability at least 0.999.
• if the input is a 'No' instance, then it will always be rejected.
Describe your algorithm and justify its correctness and running time.
Hint: You may use Markov's inequality.