Secret Santa draws reframed as a derangement problem with exclusion rules
Drawing names for Secret Santa is more complicated than shuffling a list, because nobody can draw themselves and some pairs, such as couples, must be kept apart. The article notes that the classic hat method can hit a dead end where the last person's only remaining name is their own. The author's team instead treats the whole assignment at once, representing a draw as a permutation with no fixed points, known as a derangement. Derangements make up about 37% of all permutations, so repeatedly shuffling and checking until a valid one appears is a simple, correct approach. The article also compares this with a circular-chain shortcut, which is valid but can only produce a subset of possible draws.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in