The Math of Card Shuffling
The article delves into the mathematics of card shuffling, emphasizing riffle shuffling for randomness. It explains the need for seven riffles to shuffle a deck and approximates 236 single card riffles for full shuffling. Visualizations illustrate the process.
Read original articleThe article discusses the mathematics behind card shuffling, particularly focusing on the concept of riffle shuffling to achieve randomness in a deck of cards. It explains that seven riffles are needed to completely shuffle a deck of 52 cards. Additionally, it explores the scenario of single card riffles, where it is calculated that approximately 236 single card riffles are required to achieve a fully shuffled deck. The process is detailed through an iterative explanation, showcasing how the bottom card eventually rises to the top through repeated riffles. The article also provides interactive visualizations to demonstrate the movement of cards during the shuffling process. Overall, the piece delves into the intricate calculations and probabilities involved in achieving randomness through card shuffling techniques.
Related
Everyday is a Birthday A Journey to a classic problem through Math and Rust
This article explores the classic probability problem of ensuring every day of the year is represented by a birthday in a group of people, using mathematical concepts like the Coupon Collector Problem and Inclusion-Exclusion Principle. It calculates needing around 2364 students, adjusting to 2669 with leap days, and discusses the gamma function for probability calculation.
Do not confuse a random variable with its distribution
In probability theory, a random variable and its distribution are distinct concepts. The random variable depends on random outcomes, while the distribution shows variation patterns. Changing variables or probabilities alters distributions. Examples clarify shared distributions with different outcomes, crucial for interpreting probabilities and simulations.
The Magic of Participatory Randomness
Randomness is vital in cryptography, gaming, and civic processes. Techniques like "Finger Dice" enable fair outcomes through participatory randomness, ensuring transparency and trust in provably fair games.
A Quantum Leap in Factoring
Recent quantum computing advancements include Peter Shor's Shor algorithm for factoring large numbers and Oded Regev's new scheme reducing gate requirements. Practical implications and implementation challenges persist despite optimism for future cryptography improvements.
Exploring Randomness in JavaScript
This article compares Math.random() and Crypto.getRandomValues() in JavaScript for generating random values. Despite Crypto being more secure, Math.random() suffices for creating color palettes due to speed and perceived randomness.
(You know you're on to something when so many people misquote and misinterpret your result, and say it sucks!)
Of the many formulations of Gilbert-Shannon-Reeds, an easy one to generalize is running the shuffle in reverse. One could flip a fair coin for each card, to decide if it flies up to the right or left hand. Equivalently, let heads fly up to the same hand as before, and let tails fly up to the other hand. As an unfair coin approaches always tails, the inverse shuffle becomes smoother, approaching a perfect shuffle, which Persi can easily do.
One way to measure how smoothly one shuffles is to flip one hand's packet over before shuffling, then count face up / face down runs. For a perfect shuffle, there will be 52 singleton runs: up, down, up, down... For GSR shuffles there will be 26 1/2 runs on average. Experienced human shuffles tend to exhibit 30 to 40 runs. While only GSR can be solved in closed form, one can run simulations to see what happens with smoother shuffles. As a somewhat surprising coincidence, one approaches randomness most quickly with shuffles corresponding to 30 to 40 runs.
The riffle shuffle also has to be one of the only things you actually get worse at the more you practice it.
This is an understatement. In fact it is virtually certain that no two shuffled decks of 52 cards have ever been in the same order, across all history. That’s how big 52! is. In fact, to get a 50% chance of any two shuffles matching, you’d need to shuffle a billion decks of cards every second for 4x10e17 years.
Related
Everyday is a Birthday A Journey to a classic problem through Math and Rust
This article explores the classic probability problem of ensuring every day of the year is represented by a birthday in a group of people, using mathematical concepts like the Coupon Collector Problem and Inclusion-Exclusion Principle. It calculates needing around 2364 students, adjusting to 2669 with leap days, and discusses the gamma function for probability calculation.
Do not confuse a random variable with its distribution
In probability theory, a random variable and its distribution are distinct concepts. The random variable depends on random outcomes, while the distribution shows variation patterns. Changing variables or probabilities alters distributions. Examples clarify shared distributions with different outcomes, crucial for interpreting probabilities and simulations.
The Magic of Participatory Randomness
Randomness is vital in cryptography, gaming, and civic processes. Techniques like "Finger Dice" enable fair outcomes through participatory randomness, ensuring transparency and trust in provably fair games.
A Quantum Leap in Factoring
Recent quantum computing advancements include Peter Shor's Shor algorithm for factoring large numbers and Oded Regev's new scheme reducing gate requirements. Practical implications and implementation challenges persist despite optimism for future cryptography improvements.
Exploring Randomness in JavaScript
This article compares Math.random() and Crypto.getRandomValues() in JavaScript for generating random values. Despite Crypto being more secure, Math.random() suffices for creating color palettes due to speed and perceived randomness.