Randomized algorithms use X=random(S) as a primitive, so is a random variable uniformly distributed over . Each random is considered independent.
Correctness and running time are random variables:
- 
- , where  is the random variable associated to worst-case complexity
Usually there are two techniques:
- LAS VEGAS, which are always correct and the randomization only affects running time
- MONTE CARLO, in which algorithms can be incorrect () and may affect running time
See also
- Pigeonhole Principle - if n items fill m containers and n>m, some container has more than one - many randomized correctness proofs use Pigeonhole to show that a bad event is improbable because it requires too many coincidences
References
- Advanced Algorithm Design notes, Randomized Algorithmic Techniques