5323 shaares
127 private links
127 private links
In “The Danger of Naïvete,” Jeff Atwood explains that the reason the naive shuffle algorithm is biased (and fundamentally broken) is because it overshuffles the cards in the deck by selecting each card’s swap from the entire deck every time. This means that some cards are getting moved multiple times!
The image shows naive shuffle vs. Fisher-Yates shuffle, 1 million tries on a 6-item set. On the X axis there are the different possible final combinations, while the Y axis reports the count for each combination.