Modulo-based random selection skews uniform distributions
A technical explainer breaks down a widely used pattern in which a random 64-bit integer is reduced via the modulo operator to select among a fixed number of choices. It shows mathematically that when the number of choices does not evenly divide the range of the random number generator, some choices end up more likely than others, breaking the assumption of equal probability.