Math Fundamentals18 sections · 814 units
Open in Course

Randomized Algorithms

(Using probability for speed)

A randomized algorithm makes random choices during execution. Quicksort picks a random pivot. This avoids worst-case behavior on sorted input.

The expected running time is O(n log n) even though worst-case is O(n²). Probability ensures good performance on average.

Monte Carlo algorithms accept a small error probability in exchange for speed. They use probability to estimate results.