0

Can Someone help me to get my head around this. I can't work out how to answer it;

Six friends hold a Christmas present swap. Each person brings a present, and puts it into a sack. Once all six presents are in the sack, each participant in turn then draws out a present at random (presents are not replaced once drawn). The swap is deemed lucky if no participant draws out the present that he or she put in. What is the probability that the swap is lucky?

I get that there are $6!$ total possibilities, but how can I work out the number of possibilities where someone picks their own?

Bernard
  • 175,478

2 Answers2

2

These are called Derangements. From Wikipedia:

a derangement is a permutation of the elements of a set, such that no element appears in its original position.

The number of derangements for a set of size $n$ is written as $!n$, and on the Wikipedia page you'll find a formula.

It turns out there are $!6=265$ derangements, so the probability of a lucky swap is:

$$\frac{!6}{6!}=\frac{265}{720}$$

If you want to compute this number by hand:

Think of the types of derangements you could have.

For example, we could have person 1 drawing the present f person 2, person 2 draws the present of person 3, etc. until person 6 gets the present from 1, i.e. you get one big cycle $1\rightarrow 2\rightarrow 3\rightarrow 4\rightarrow 5\rightarrow 6\rightarrow 1$, which we may more easily represent as $123456$. So, how many such one-big-cycles are there? Well, person 1 gets the present from one of 5 people, after which that person 2 gets the present from one of $4$, etc. i.e. there are $5!=120$ of these.

OK, but you can get another derangement by having persons $1$ and $2$ swap presented, and same for $3$ and $4$, and for $5$ and $6$. In other words, you can have $3$ cycles of length $2$. How many of that kind are there? Well, for the first person you again have $5$ choices, which fixes the second person (for they get the present from the first person), but then for the third person you have $3$ choices ... and that fixes everything. So: $15$ derangements of the type where there are $3$ cycles of length $2$

OK, and then just figure out what other types you can have. In terms of cycles-sizes, I just did one cycle of length $6$, and $3$ cycles of length $2$, but you can also have $2$ cycles of length $3$, and one cycle of length $4$ together with one cycle of length $2$.

Now, for two cycles of length $3$: focusing on one person, there are ${5 \choose 2}=10$ ways to pick a $2$ more people for the cycle that that one person is in, which will also fix the $3$ people for the other cycle. And, each cycle can go in one of two directions, so that is $2\cdot 2 \cdot 10=40$ possibilities that way.

Finally, for the one cycle of length $4$ together with one cycle of length $2$: There are ${6 \choose 2}=15$ ways to pick two people for a cycle of two, fixing the $4$ people for the cycle of $4$. But, that cycle of $4$ can go around in $3 \cdot 2 \cdot 1 = 6$ ways, so that gives a total of $90$ possibilities for a derangement of that type.

Total: $120+15+40+90=265$ possibilities

Bram28
  • 100,612
  • 6
  • 70
  • 118
  • We aren't taught derangements, nor are we given a calculator. I'm starting to think this might not be in this years spec, cos would there of been a relatively simple way of working this out without that knowledge? – Dan D'silva Apr 13 '18 at 17:05
  • @DanD'silva Yeah, you can probably do this by hand without too much effort. Let me add something to my Answer about that. – Bram28 Apr 13 '18 at 17:36
  • Is there any chance you could clarify what your doing by hand a bit more, it would really help. – Dan D'silva Apr 20 '18 at 18:07
  • @DanD'silva OK, just added some further explanation ... – Bram28 Apr 20 '18 at 19:00
  • Let me add that for a general $n$, the probability $!n/n!=e^{-1}|_n$, where the right-hand side is the $n$th partial sum of the series for $e^x$ at $x=-1$. As $n\to\infty$, the limiting probability is $1/e$. – Alexander Burstein Apr 20 '18 at 19:11
  • @AlexanderBurstein Huh! Good to know, thanks! – Bram28 Apr 20 '18 at 19:45
  • @Bram28 In fact, the way to calculate $!n$ quickly is to find the closest integer to $n!/e$. Say, the closest integer to $720/e=264.87...$ is $265$. – Alexander Burstein Apr 20 '18 at 19:47
  • @AlexanderBurstein Hey, that's cool, thanks again! – Bram28 Apr 20 '18 at 20:23
2

This is a problem of derangements. Imagine the friends and the presents are numbered 1 to 6. Say the friends pick in the order 1,2,... and that the presents they pick are $P_1, P_2, ...$. Then your asking for the the probability that $P_n\ne n, n=1,\dots,6$. That is, what is the probability than a random permutation of $6$ items is a derangement?

saulspatz
  • 53,131