Randomized Algorithms
Randomized Algorithms
Randomized Algorithms in General
The goal of a deterministic algorithm is to return an output for an input . With randomized algorithms the idea is that the algorithm also has access to random variables. The output of the algorithm is thus not only dependent on the input but also on the values of the random variables. We denote the output of the randomized algorithm with where denotes the values of the random variables. We also denote by the random variable corresponding to the value of for a random choice of . With randomized algorithms we may thus receive different results when executing the algorithm multiple times. We distinguish two types of randomized algorithms: Las-Vegas and Monte-Carlo algorithms.
Las-Vegas Algorithms
A Las-Vegas algorithm’s runtime is a random variable, however the algorithm is guaranteed to deliver a correct result. We can look at a Las-Vegas algorithm from a different perspective: we can abort the execution of the algorithm if we reach a certain runtime-limit and output “???”. The two are equivalent.
Monte-Carlo Algorithms
A Monte-Carlo algorithm has a deterministic runtime but a chance of delivering a wrong result.
Reducing the Probability of Failure
Las-Vegas Algorithms
For Las-Vegas algorithms it is enough to output a correct result with a probability at least , where may be arbitrarily small. Through enough repetitions of the algorithm we can generate every arbitrarily small probability of success. The amount of iterations only depends on the original probability of success of the algorithm and the desired overall probability of failure .
📖 Let be a randomized algorithm, that never produces an incorrect result, but outputs “???” at times, where
Then it holds for all : let denote the algorithm that calls until we get a value different from “???” or until “???” has been output times. Then it holds for the algorithm that
Monte-Carlo Algorithms
In the special case where a Monte-Carlo algorithm outputs a boolean value and we know that one of these values is always correct (i.e. an algorithm with a one-sided error) we can apply the following:
📖 Let be a randomized algorithm that always outputs one of or , where
and
Then it holds for all : let denote the algorithm that calls until either is output or until has been output times. Then it holds for the algorithm that
We can similarly reduce the probability of failure of two-sided error Monte-Carlo algorithms when the original probability of success of the algorithm is strictly larger than :
📖 Let and be a randomized algorithm that always outputs one of or , where
Then it holds for all : let denote the algorithm, that makes independent calls of and outputs the majority of the returned results. Then it holds for the algorithm that
For randomized algorithms for optimization problems we usually don’t refer to probabilities of success/failure, but to whether they output the desired result, e.g., if they output a value that is at least as big as the expected value:
📖 Let and be a randomized algorithm for a maximization problem, where
Then it holds for all : let the algorithm, that makes independent calls of and outputs the best of the returned results. Then it holds for the algorithm that
(For minimization problems the analogous statement holds if is swapped with .)