Las Vegas Algorithms

444 Views Asked by At

In some notes i'm reading it says that the definition of a Las Vegas Algorithm is

An algorithm which always outputs the correct answer but has unbounded running time, with the expected running time required to be bounded. It says as an exercise (equivalently) we require the running to be bounded but allow the algorithm to output a special answer '?' so that the probability of outputting '?' is $\leq \frac{1}{2}$.

I faily to see exactly why these are equivalent. I can see that we can turn any Las Vegas algorithm into the the one stated as being equivalent as follows

If $X$ is the random variable representing the running time then using Markov's inequality $\mathbb{P}(X \geq C) \leq \mathbb{E}(X)/C$ so we can pick $C$ large enough to ensure this is less than $1/2$. Then if the running time goes above $C$ the algorithm outputs '?'.

How do we show any algorithm which halts in finite time but can output '?' with probability $1/2$ is equivalent to a Las Vegas Algorithm?

1

There are 1 best solutions below

3
On BEST ANSWER

Run the algorithm repeatedly (and independently) until you don't get '?'.