The Problems with Secret Santa - Numberphile - YouTube

Channel: Numberphile

[0]
If you imagine the scenario that you are in an office with lots of people who you quite like, but not enough
[6]
to spend time and money on getting them an individual gift, a Secret Santa is the perfect way around that. Because what you do,
[14]
everybody puts their names into a hat,
[16]
everyone picks a single name out of a hat, and you buy one crappy present
[21]
for just one person in the office, then everyone gets to walk away with a crappy present. The important thing, though,
[27]
about Secret Santa, is
[29]
kind of clue's in the name. It is supposed to be secret. Nobody is supposed to know who bought
[34]
anybody else's present, apart from the one that you buy. Everything is completely anonymous. That's sort of a
[39]
fundamental rule of, of the Secret Santa agreement.
[42]
I guess it's so you can get away with buying basically junk for other people.
[46]
I mean they're always crummy, they're always crummy, aren't they? Because people don't really know you. So it's always like,
[52]
bath bubbles! Hooray!
[55]
Or, like, I don't know, a book on numbers.
[60]
Brady: "What about?! You churn out books on numbers!"
[63]
I know. I know that's true.
[67]
But, yeah, like an encyclopedia of numbers, you know?
[70]
Brady: "Right, because you're the math person."
[72]
Yeah, exactly, exactly. Or like, you know, there's a,
[74]
there's a guy who's a geographer here, and every single time he always gets something with a map on it.
[79]
Just a generic bland map. Because obviously he must love maps.
[82]
I think there are two fundamental things that you need for a perfect secret Secret Santa: 1) total anonymity,
[88]
and 2) everyone should have an equal probability of being selected by anybody else, right?
[94]
Those are kind of two fundamental things. Now the normal way that you do this,
[98]
of everybody writing their name down putting in a big bowl and picking a name of a hat, fails on both of those fronts.
[104]
Okay, so imagine you've got everybody who's involved in your Secret Santa sitting around a table.
[108]
Everybody writes their own name onto a piece of paper and drops it into a bowl in the middle.
[112]
And then that bowl is passed around the table and people pick out names of who they're gonna buy the gift for.
[118]
If they pull out their own name, though, they read it and replace it back in the bowl, and then pick another name.
[123]
By doing that, you have to sort of consider the situation where the last person around the table picks out their own name.
[131]
Now if they do that, what, how do you solve it without violating the rule of anonymity?
[138]
Because they can't swap it with anyone else,
[140]
because by doing so, they would know exactly who is buying them a present.
[144]
So, the only real fair thing to do in that situation
[146]
is to scrap whole thing, start all over again. There's quite a good chance of that happening.
[149]
So, if you have twenty people sitting around your table,
[152]
there's a 4% chance that the last person will pull their own name,
[155]
and you have to scrap it, and completely start all over again. If the second to last person pulls their name, if the third to last person
[161]
pulls their name, you know, all sorts of anonymity issues can be violated.
[166]
The chance of anybody pulling anybody else's name is not uniform.
[171]
It depends on where you're sitting around that table. Because what you're looking for in this scenario,
[176]
you are looking for something called a derangement.
[180]
So it's a type of permutation where nobody ends up with their own name, effectively.
[185]
Okay, so imagine you've just got three people playing. You've got A, B and C. Now even though there are six ways
[191]
that this can be reordered, there are only two extra permutations here that could work for Secret Santa.
[198]
Two derangements, they're called. So there are other permutations, of course.
[201]
But the problem is, is that any of these three, in every case, somebody, if they're sitting around table in A, B and C,
[208]
somebody will end up with their own name. So this column here is kind of who that person is pulling out.
[212]
So if A is the first person on the table, they're going to pick their own name in this permutation,
[217]
B will pick their own name in this permutation, and C will pick their own name in that permutation.
[220]
So none of those are allowed. None of those are allowable Secret Santas.
[224]
The question is, how likely is it that each of the people end up
[229]
buying for a particular person? And it turns out that the order that you're sitting around the table
[234]
makes a difference to that. A picks first, then B goes second, and C goes third.
[240]
So, if we think about the bowl of names for A, we know that if A picks out
[244]
their own name, he's going to replace it. Or she.
[249]
They replace it back in the bowl.
[251]
So really there's only two things that, that A can, can pick out
[255]
from that bowl, and then Secret Santa carry on. So that's either B or C. And there's a probability of a half in each case.
[260]
Brady: "Because if they pick A it's a non-game."
[262]
Exactly.
[264]
They read their own name, put it back in the bowl, and then pick again. Okay, so if A ends up picking out B,
[270]
now it's B's go. So B's already out of the pile. So there's only two names left, and either one that B
[277]
can pick is totally fine.
[278]
They're either going to pick A or C. And each of those has probability of a half. However, if A has picked B
[284]
and B has picked A,
[285]
there's only one name left for C to pick from, which is their own name. And that, my friend, is a fail.
[292]
There's a failed Secret Santa. Which means the only fair thing to do, if you want to preserve
[296]
everyone's anonymity, is to start all over again from scratch,
[299]
put your names back in the hat, and then
[302]
start from the beginning. If, instead, B ends up picking C, then we're okay.
[306]
There's only one name left in the hat, and that is A's name, and that's absolutely fine.
[309]
And that's got a probability of happening of 1. So, that's if A ended up picking B in the first place.
[316]
If A ends up picking C, you can still work this through, but there's less going on in this case.
[320]
There's only two names left in the hat, it's B and A.
[323]
B can't pick themselves. If they did, they'd read it, put it back, which means that
[327]
B really only has one name that they can pick out, and the Secret Santa continue, which has to be A.
[333]
And that's gonna happen probability of 1.
[336]
Which means now, once you get to C, there's only one name in the hat, and it's B's name.
[341]
Which also happens with probability of 1.
[344]
Okay, so, now you've got these, there's one failure, one absolutely fine derangement that works for Secret Santa, here, and another one here,
[351]
but you can work out the
[352]
probabilities of each of these happening, if you kind of travel down these arms of the tree.
[356]
This permutation here of C-A-B
[359]
which we have up here, this one here,
[362]
this one is gonna happen with the probability of a half, because it's a half times 1 times 1. This one here, this,
[368]
this other successful arm of
[370]
B-C-A, is gonna happen with the probability of
[373]
a half times a half, which is a quarter. And then the other branch of this, if you like, is a failure.
[379]
So you're also gonna fail with the probability of a quarter.
[383]
Which means that A is much more likely to end up buying for C than they are for B.
[390]
So even though they're, they're just as likely
[393]
to pull out the second person's name as they are the third person's name,
[396]
if they pull out the second person's name, half of the time, the whole thing will then fail,
[400]
so they'll have to start over from scratch.
[402]
So what you end up with in this situation is not only the chance of failure, and having to start it all over again,
[408]
but you also end up with a situation which isn't perfectly random.
[411]
You don't have an equal chance of buying for other people in the office.
[415]
Brady: "So if I'm sitting in a row of three, and I'm the last picker, I know it's most likely that the first picker is buying me a present."
[423]
Yeah, it's twice as likely that the first picker's buying you a present than the second picker.
[427]
Which might help you when you try and
[428]
decide where to sit around the table, because,
[431]
yeah, you don't want, like, some person who's rubbish at presents to be buying for you.
[435]
So the exact probabilities change
[437]
depending on how many people you have, but the, the overall idea is the same. That the probability of
[443]
you buying for a person later on if you go first
[447]
is different to the probability of you buying for somebody earlier on the tree. Um, so overall, I mean, I think
[452]
this version of Secret Santa is pretty rubbish, really. It's got two massive problems with it.
[457]
So what you could do if you wanted, you wait until everyone's got a name, everyone's picked a name out of the hat,
[462]
and that's when you look at it,
[464]
and that's when you decide if, if somebody's got their own name. You call a failure,
[468]
and you start all over again.
[469]
Unfortunately that one's got a 37 percent chance of failing,
[472]
and a 5 percent chance of failing more than three times in a row, by which time I think people are gonna be
[477]
less keen to buy each other presents, and maybe just want to call it a day.
[483]
However, we've got a solution. We've got a Secret Santa system that does actually work. Okay, what you do now
[488]
if you want the perfect Secret Santa setup, you create a series of cards.
[492]
The cards are kind of split in two. And at the top of the card, you write: you are number 4,
[500]
and on the bottom of card, you write: you are buying for number 4.
[505]
So whatever the number is on top, the same number is on bottom. So you do lots of cards, you do one for
[509]
each person. So if you've got 20 people, you write 20 cards. If you've got, whatever,
[513]
three people, you write three cards. You get all of these cards, you lay them on a table,
[517]
shuffle them all around, so you have no idea what order they're in, and then, when you're happy that they're neatly shuffled,
[523]
you go along with a pair of scissors and cut the cards in two.
[527]
So now you have no idea
[529]
what cards are next to each other, and you're kind of cutting along the line. And these scissors that everyone draws in school?
[534]
How do they do them? Like that? They go?
[536]
That's my scissors.
[539]
It's not great.
[541]
You go along and you cut them all up. Now at that point,
[544]
you can create your derangement. And you can do that just by shifting
[549]
the top half of all of the cards along by one. By doing that, you're guaranteeing that the
[554]
number on the top of the card isn't gonna match the number on the bottom of the card.
[558]
So you've definitely got a derangement, definitely got a Secret Santa system that works.
[562]
But, also, because you shuffled them, you have no idea
[565]
what numbers are matching with what numbers. So the next step, everybody
[568]
who's playing Secret Santa comes along, picks up
[571]
a new whole card, so top and bottom half that are now matched up together. Say you pick one up
[576]
and it says you are number 3
[578]
and you're buying for number 27. Then the final thing that happens is
[582]
that you write a list of all of the numbers, put it on the wall of the office or whatever, everyone then comes along,
[588]
they know what number they are,
[590]
because the card that they picked up would have told them, and then they come along and then they write their name.
[594]
Everyone now knows their own number,
[597]
they know the person they're buying for, but they have no idea who else is buying for anyone else in the Secret Santa system,
[603]
and everyone has an equal chance of buying for everybody else.
[607]
I mean there is a final
[609]
way that you could do this, it's a bit simpler, which is just to go online and use one of the free apps.
[614]
But, this is much nicer.
[617]
Brady: "It's fun, you gotta, there gotta be hats and tickets and pulling cards and things."
[621]
Yeah, I agree.
[622]
Let's do the traditional way, non-computer way.
[625]
Brady: "Let me ask you this, mathematician Hannah. Have you ever done this?"
[629]
Nope.
[632]
I'm famously stingy when it comes to buying Christmas presents. I won't get involved.
[637]
If you're in the market for some gifts, and Hannah hasn't put you off the idea of a mathematics book,
[643]
these are books that she's written. You could try them out.
[645]
I'll put links in the description along with links to some Numberphile merchandise
[649]
you could try, like t-shirts and posters. And if you want to see more of Hannah besides here on Numberphile,
[654]
why not check out her recent guest appearance on Objectivity? Links for that as well.