I ran a million Secret Santa d... Note

I ran a million Secret Santa draws through my generator. Here's what the paper hat gets wrong

The Secret Santa generator, tested through extensive simulations, reveals critical insights into draw fairness and common problems. A traditional hat draw fails approximately 63% of the time for groups of six or more due to someone drawing their own name, necessitating a complete restart for fairness. The common "redraw one person" fix is problematic; it can strand the last person and introduces a significant bias, making some pairings up to n-1 times more likely. The generator employs a uniform shuffle, checks all rules, and restarts if any fail, ensuring a fair distribution.Exclusion rules, such as keeping couples apart, increase the number of attempts needed for a valid draw, costing roughly 5 to 9 full draws for a computer, but making manual draws impractical. A crucial constraint is that no household can comprise more than half the group, otherwise, a valid draw is impossible. For example, in a group of 10, a household of 6 or more members makes a draw impossible.Random draws often result in mutual pairs (two people giving to each other), occurring in about 39% of draws for groups of six or more. To avoid this and ensure a single-loop chain, the generator offers a "one big circle" mode using Sattolo's algorithm. The system also stores seeds for auditable draws, allowing verification of fairness if issues arise. For extremely tight rules where rejection sampling fails, a fallback randomized search is used, though it logs its use due to approximate uniformity. Ultimately, the generator efficiently handles these complexities, confirming its fairness and practical solutions for common Secret Santa challenges.