Skip to content
Omnikalc

Derangement calculator: what are the odds nobody draws their own name?

Enter the number of people in a gift exchange to get the number of valid draws, the chance nobody draws their own name and the average number of redraws.

Updated on
Your inputs

Value out of range

Value out of range

Results

Chance that nobody draws their own name

36.79%

About a 37 % chance: a simple redraw rule works fine
Number of valid arrangements (derangements)
1,334,961
Total number of ways to hand out the names
3,628,800
Chance that at least one person draws their own name
63.21%
Chance that exactly k people draw their own name
36.79%
Average number of draws until everyone is fine
2.72

In a Secret Santa, everybody draws a name from a hat, and nobody wants to draw their own. How likely is it that the draw works the first time? The answer is a classic of combinatorics: counting derangements, arrangements in which nothing stays in its place. This calculator gives the number of valid draws, the chance that nobody draws their own name, the chance that exactly k people do, and the average number of redraws needed.

How the calculation works

  • Total arrangements = n!
  • Derangements !n = the whole number nearest to n! ÷ e, or n! × (1 − 1/1! + 1/2! − … ± 1/n!)
  • Chance nobody draws their own name = !n ÷ n!
  • Exactly k fixed names = C(n, k) × !(n − k) ÷ n!
  • Average number of draws = n! ÷ !n

Example

For 10 people, there are 3,628,800 ways to hand out the names, and 1,334,961 of them are derangements. The chance that nobody draws their own name is 36.79 %, so at least one person draws their own name 63.21 % of the time. The chance of exactly one person drawing their own name is also 36.79 %. On average you need 2.72 draws before the result is valid.

Why it matters

The result is surprising: the chance does not shrink as the group grows. With 5 people it is 36.67 %, with 10 it is 36.79 % and with 15 it is 36.79 % again. This means you never need a clever algorithm for a gift exchange: draw, check, and redraw if someone has their own name. The same maths answers the classic problem of the hat-check girl who returns hats at random, and the number of matching letters when n letters go into n envelopes by chance.

Good to know

The calculation treats every arrangement as equally likely and ignores rules such as “couples cannot draw each other”, which reduce the number of valid draws and raise the number of redraws. For groups larger than 15 the counts grow beyond the precision of a calculator, but the probability stays at 1/e. This tool is for education and party planning.

In practice

For a fair, hassle-free exchange, have each person draw in private, ask anyone with their own name to say so quietly and redraw only those names, or use an app that excludes couples. Keep the list of exclusions short so a valid arrangement still exists.

The permutations calculator counts ordered arrangements, the birthday paradox calculator covers another surprising probability and the expected value calculator averages outcomes.

Frequently asked questions

What is a derangement?

A derangement is a rearrangement of items in which none ends up in its original place. In a Secret Santa, it is a draw in which nobody gets their own name. The number of derangements of n items is written !n and called the subfactorial.

How do I count derangements?

The number is !n = n! × (1 − 1/1! + 1/2! − 1/3! + … ± 1/n!), which is the whole number nearest to n! ÷ e. For 10 people there are 1,334,961 derangements out of 3,628,800 possible arrangements.

Why does the probability settle near 37 %?

As n grows, the chance that nobody gets their own name tends to 1/e, which is about 36.79 percent, and it is already very close for 5 or more people. The size of the group hardly matters.

What happens if I just redraw when someone picks their own name?

On average you need about e, or 2.7, full draws before everyone is fine, regardless of the number of people. That is why redrawing the whole thing is a perfectly practical method.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.