Daily Shaarli
11/21/18
Continuing on with my “After NLL” series, I want to look at another common error that I see and its solution: today’s choice is about moves from borrowed dat...
A survey of things that Rust doesn’t let you do although arguably safe.
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.