Live model · Secret Santa
How Secret Santa Draws Actually Work
Drawn from a hat with no rules, a Secret Santa works only about 37% of the time: the share of draws where nobody gets their own name settles at 1/e once five or more people play. So draws put names back or reshuffle, and every valid draw splits into loops of who gives to whom.
A hat draw, name by name, then its loops
How to read the stage
Eight names go in the hat, and Ana and Ben are a couple. Each person draws in turn and puts back their own name or their partner's. On the first try Hana is last, and the only name left is her own, so the whole hat starts over. The second try works, and following the arrows splits the eight into loops of 3, 3 and 2.
Three ways to draw
Drawing again on your own name is the usual hat rule, but it isn't fair. With 8 people and no couples, some valid draws come up 7 times as often as others, and 9% of tries strand the last person. Reshuffling the whole hat until no one holds their own name picks every valid draw equally often. Sattolo's shuffle always makes one loop through everyone.
Why every draw splits into loops
Start with anyone and follow who they give to: you always come back to the start, because everyone gives once and receives once. A loop of two means two people buy for each other, which can spoil the surprise. Of the 14,833 valid draws for 8 people, 5,040 are one loop through everyone, about a third. Sattolo's shuffle makes one every time.
Why the odds settle at 37%
The second stage draws 1,000 hats for each group size from 2 to 12, with no redraws. With 8 people, 361 hats left no one holding their own name; the exact chance is 14,833 orderings of 40,320, or 36.8%. That's 1/e, and the share is near it from five people on. On average exactly one person a hat draws their own name.
11,000 plain hat draws, counted
What the model leaves out
A real draw can add rules of its own, like no repeats from last year; the model knows only couples. Its seeded random numbers stand in for a fair hat, and it takes up to 12 people and four couples. Before drawing, it checks that the rules allow any draw at all, so an impossible set of couples gets an answer rather than a hat that never finishes.
Questions
- What are the chances someone picks their own name in Secret Santa?
- With no redraws and five or more people, about 63%: only 36.8% of draws, 1/e, leave everyone holding someone else's name. With 3 people it's 67%, since only 2 of the 6 orderings work, and with 4 people it's 62.5%, since 9 of 24 work.
- Is drawing again when you get yourself fair?
- Not quite. Putting your own name back, and starting over when the last person is stuck, makes some valid draws likelier than others: with 4 people the likeliest comes up 3 times as often as the least likely, and with 8 people 7 times. Reshuffling the whole hat until no one has their own name is fair.
- How do you keep couples from drawing each other?
- Treat a partner's name like your own: a name that goes back in the hat. The stage does that, and it checks first that some valid draw exists. With three people where one is coupled with both others, none does.
- How do you make one big gift loop through everyone?
- Use Sattolo's shuffle. It's the Fisher–Yates shuffle with one change: each step swaps with an earlier slot, never the slot itself. Every one of the (n − 1)! loops through everyone comes out equally often.
Drill the mechanism
Finding the loops is following pointers: each person points to the one they give to, and you walk until you're back where you began. Linked List Cycle asks whether a walk like that ever loops back, and Find the Duplicate Number reads an array as pointers and walks it the same way, with a fast walker and a slow one.