Randomized algorithm
Builds on AlgorithmProbabilistic Turing machineRandom variableExpected value
Definition
A randomized algorithm is an algorithm that, besides its input , reads a sequence of independent uniformly random bits. Its steps may depend on the values of these bits. For a fixed input , its output and its running time are random variables that depend on . Two kinds are standard.
- A Las Vegas algorithm always gives a correct output, and its quality is measured by the expected value of .
- A Monte Carlo algorithm has a running time bounded by a function of the input size. It may give a wrong output with bounded probability.
A formal model is the probabilistic Turing machine.
Remarks
Example: randomized quicksort chooses each pivot uniformly at random among the current items. It always returns the sorted list, so it is Las Vegas, and its expected number of comparisons is for every input of distinct items.
Example: to test whether for matrices, Freivalds' algorithm picks a random vector and checks in time . If it always says yes; if it says yes with probability at most , so it is Monte Carlo with one-sided error.
Non-example: an algorithm that runs on a fixed pseudorandom seed stored in its code makes no random choices, so it is deterministic.
The error probability of a Monte Carlo algorithm can be reduced by running it several times with independent random bits.
Reading path
To understand this page from the ground up, read these 5 pages in order. The foundations come first.
Show the path as a graph
- no evidence level
- Algorithm concept
- Expected value concept
- Probabilistic Turing machine concept
- Random variable concept
- Randomized algorithm definition
Further reading
About this page
| Tag | 51DJRE9GVH |
|---|---|
| URI | m2://51DJRE9GVH |
| Kind | definition |
| Writing | W0 stub |
| MSC | 68W20, 68Q87 |
| Defines | Randomized algorithm |
| Uses | Algorithm, Probabilistic Turing machine, Random variable, Expected value |
| Changed | 3 November 2026 |
Markdown · JSON · Edit on GitHub
What this page needs for W1
- an inventory row: the row of the inventory that the node accounts for (0 of 1)
- a source with a locator (0 of 1)
The writing levels say how complete the text of a page is. They do not measure its truth.
What links here
No page links to this page yet.