Randomness Algorithms: Fisher–Yates Shuffle, Reservoir Sampling, Weighted Random and Random.Shared, Shuffle, GetItems in .NET
The correct shuffle is Fisher–Yates: at each step it picks only from the remaining elements and leaves exactly one path to each of the n! permutations. We measure two common biased shuffles in C#, sample from a stream with reservoir sampling, pick by weight with a cumulative array and the alias method, build a per-user 10 percent rollout with XxHash3, show a Random shared across threads getting corrupted, and close the series.
15 Nov 2026
·
10 min
·
5