Overview
Knuth Shuffle is a randomness and sampling method that generates samples, estimates, or pseudorandom values while controlling distribution and variance. It is most useful when repeatable sample behavior matters as much as raw randomness.
Knuth Shuffle draws samples while controlling distribution, coverage, or variance.
Compact metadata for implementation and discovery.
Knuth Shuffle is a randomness and sampling method that generates samples, estimates, or pseudorandom values while controlling distribution and variance. It is most useful when repeatable sample behavior matters as much as raw randomness.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n)
Average
O(n)
Worst
O(n^2)
Space
O(n)
Show samples accumulating over the target distribution or sample space.
Knuth Shuffle operates in O(n) time and O(n) space within the Randomness and Sampling family. Often compared with Rejection Sampling and Importance Sampling.
What each reference supports for this entry.
Random-number reference for Knuth/Fisher-Yates shuffling and unbiased random permutations.
Good next jumps from the relationship graph, ranked for useful discovery.
Knuth Shuffle and Rejection Sampling address nearby randomness and sampling problems but make different implementation tradeoffs.