1

I wish to find the number of derangements for an $n$-membered set. I am not familiar with formal language in combinatorics, so I will just use the nice analogy that was given to me:

There are $n$ chairs at a table, each with a name card wit hthe name of one of $n$ people (with one name card for each person). The $n$ people sit at the table. Let $D_n$ be the number of ways the $n$ people can sit at the table such that not a single person is sitting in the correct seat. ($D_n$ is called the number of derangements of an $n$-member set.)

I am also told to use the Principle of Inclusion-Exclusion to find an expression for $D_n$, and here is my attempt:

From the $n$ people, we at first choose one of them to necessarily be seated incorrectly. There are $n$ ways to do so. There are $n-1$ ways that this person can be seated. Now that this person is seated, there are $(n-1)!$ ways to permutate the others. Our running total is $$n(n-1)(n-1)!.$$

Note that some people other than the one we originally chose may be seated incorrectly, and thus we reconcile accordingly. We see that the permutations where two people are necessarily seated incorrectly have been overcounted twice, so we count and subtract. There are $\dbinom{n}{2}$ ways to choose two people to be seated incorrectly, $\dbinom{n-2}{2}$ ways to seat these two people, $2$ ways to permutate these two people, and $(n-2)!$ ways to permutate the rest. Our running total is now $$n(n-1)(n-1)!-\dbinom{n}{2}\dbinom{n-2}{2}(n-2)!\cdot2.$$

Note again that still more people than we have now counted may be seated incorrectly. With similar reasoning as above, we see that the permutations where three people are necessarily seated incorrectly have been counted 3 times by the first expression and $-\dbinom{3}{2}=3$ times (negative as shown by the minus sign in our running total from just above), and after a while (with induction?) we go on to find that the expression is $$\sum^n_{k=1}\binom{n}{k}\binom{n-k}{k}(n-k)!k!=\sum^n_{k=1}\frac{n!}{k!}\binom{n-k}{k}k!$$ $$=n!\sum^n_{k=1}\binom{n-k}{k}.$$

The final expression is quite clean, in my opinion, but the expression is incorrect. I don't believe that the problem is in my algebra because I've double-checked, and instead is in my counting, but I could be wrong. What did I overlook?

RobPratt
  • 45,619
mpnm
  • 1,097

1 Answers1

2

There are numerous errors here. First, you should imagine that the people are numbered, say according to the order in which they arrived, and you’re seating them in order of their numbers. Thus, you seat Number $1$ first, and no choice is involved, so that your first term should have been simply $(n-1)(n-1)!$. (By the way, there is no verb to permutate: it’s simply to permute.) This clearly overcounts the permutations in which Number $1$ is the only person in the wrong seat, so if that’s what we were counting, we would indeed have to subtract the number of permutations in which that person and at least one other were both in the wrong seats. That would end up subtracting too much, so we’d have to add back in the number of permutations in which Number $1$ and two others were in the wrong seats, and so on.

But we don’t actually want the number of permutations in which Number $1$ is the only person in the wrong seat, so you’re setting out to perform the wrong calculation, and in any case you’re doing it incorrectly: the correct calculation would result in an alternating sum of terms. Instead you just added a bunch of correction terms, including the one for $k=2$ that you initially said was to be subtracted.

I’m going to write out in detail how the inclusion-exclusion argument should actually go, so that you can use it as a model for future inclusion-exclusion problems. For $k\in[n]=\{1,\ldots,n\}$ let $A_k$ be the set of permutations that have person number $k$ in the right seat. Then $\bigcup_{k\in[n]}A_k$ is the set of permutations that have at least one person in the right seat. We want the number of permutations that have no one in the right seat, and there are $n!$ permutations, so we want $n!-\left|\bigcup_{k\in[n]}A_k\right|$.

The inclusion-exclusion principle says that

$$\left|\bigcup_{k\in[n]}A_k\right|=\sum_{\varnothing\ne I\subseteq[n]}(-1)^{|I|+1}\left|\bigcap_{k\in I}A_k\right|\;.$$

Suppose that $I$ is a non-empty subset of $[n]$; how many permutations are in $\bigcap_{k\in I}A_k$, i.e., how many put everyone whose number is in $I$ in the right seat? Once the $|I|$ people in question have been seated in their proper seats, there are $(n-|I|)!$ ways to seat the remaining $n-\ell$ people, so there are $(n-|I|)!$ such permutations,

$$\left|\bigcap_{k\in I}A_k\right|=(n-|I|)!\;,$$

and

$$\left|\bigcup_{k\in[n]}A_k\right|=\sum_{\varnothing\ne I\subseteq[n]}(-1)^{|I|+1}(n-|I|)!\;.$$

The possible cardinalities of $I$ are $1,2,\ldots,n$, and for each $k\in[n]$ there are $\binom{n}k$ subsets of $[n]$ of cardinality $k$, so

$$\left|\bigcup_{k\in[n]}A_k\right|=\sum_{k=1}^n(-1)^{k+1}\binom{n}k(n-k)!\;,$$

and therefore

$$\begin{align*} n!-\left|\bigcup_{k\in[n]}A_k\right|&=n!-\sum_{k=1}^n(-1)^{k+1}\binom{n}k(n-k)!\\ &=\binom{n}0(n-0)!+\sum_{k=1}^n(-1)^k\binom{n}k(n-k)!\\ &=\sum_{k=0}^n(-1)^k\binom{n}k(n-k)!\\ &=\sum_{k=0}^n(-1)^k\frac{n!}{k!}\\ &=n!\sum_{k=0}^n\frac{(-1)^k}{k!}\;. \end{align*}$$

Brian M. Scott
  • 616,228