

Credit: Pixabay/CC0 Public Domain
Christmas, they say, is the most wonderful time of the year. But for many, it is preceded by one of the least wonderful times: the awkward social spectacle of the office Secret Santa or Kris Kringle, where employees agree to buy gifts for randomly allocated colleagues.
As you watch your co-workers unwrap their often wildly inappropriate gifts, each chosen by an office mate they barely know, consider the sheer statistical improbability of what you’re seeing. The odds of such a combination of these cheaply re-gifted photograph frames, inexplicably scented candles or unwanted christmas-meme-13776264/”>Lynx Africa gift sets being passed around your office is, in its own way, truly a Christmas miracle.
The 12! ways of Christmas?
To work out how many possible pairings of buyers and recipients there are, you need to calculate the number of permutations of the people involved.
Imagine, for example, a workplace with four employees. If there are no rules to prevent people from selecting their own names, there are four people who could be selected to buy the first person’s gift.
Once this is decided, there are three remaining choices for the second person, then two choices for the third person. And finally, just one choice for the last person’s workplace Santa.
This means there are 4 × 3 × 2 × 1 = 24 possible permutations. Mathematicians write this as 4!, which is pronounced “four factorial.”
But the factorials quickly get out of hand. Spare a thought for poor Santa himself. With nine reindeer, there are 9! = 362,880 ways these could be arranged, although perhaps on one foggy Christmas Eve, this number is reduced by the requirement to have a red nose leading his sleigh.
Once the office workforce swells to 20, there are more than 2.4 quintillion permutations. To put this mind-boggling 20! figure into context, that’s more than three times current estimates of the number of grains of sand on Earth.
Yule buy for someone else
Of course, nobody wants to draw themselves in a Secret Santa.
What a Secret Santa really wants is not a permutation of all employees, but instead what mathematicians call a derangement. This is simply a permutation where no element remains in its original position, which means no employee has to buy their own gift.
The calculation is far from simple, but the number of ways n employees can be assigned another unique co-worker is called the n th de Montmort number.
Amazingly, this is equal to n!/e , rounded to the nearest whole number. The e here is one of the most famous numbers in mathematics, Euler’s number,

