[Math] $6$ cards and $6$ envelopes are numbered $1,2,3,4,5,6$ such that card no. $1$ in always in envelope $2$

combinatorics

Six cards and six envelopes are numbered $1,2,3,4,5,6$ and the cards are to be placed into the envelopes so that each envelope contain exactly one card and no card is placed into the envelope bearing the same number and moreover, the card numbered $1$ is always placed in the envelope numbered $2$. What is the number of ways in which this can be done?

Attempt: If we have $6$ cards and $6$ envelopes such that no cards is in their corresponding envelope, then the number of ways is:

$$\displaystyle 6!\bigg(1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+\frac{1}{4!}-\frac{1}{5!}+\frac{1}{6!}\bigg) = 360-120+30-6+1 = 265$$

However, I do not understand how to solve the original question. Could someone help with this?

Best Answer

Given $D_6=265$, it follows that the answer to your problem is $\frac{265}{5}=53$, since the $265$ is all derangements with card 1 going into any of 5 different envelopes, and otherwise these derangements are completely symmetrical.

But here is another way of solving this problem:

You get a recursive formula where every time you are dealing with a bunch of cards and envelopes, one card of which does not math any of the envelopes, and one envelope of which does not match any of the cards. So call these the 'isolated card' and 'isolated envelope'. So, after putting card 1 in envelope 2, card 2 is the isolated card , and envelop 1 the isolated envelope. At each step, you can either put the isolated card into the isolated envelope, giving us a classic deranegment problem, or we put the isolated card into one of the other envelope, but that gives us a new 'isolated card and envelope problem', but with 1 less card and envelope.

That is: you can either put card 2 in envelope 1, giving us the derangement number for 4, or you can put card number 2 in any of the other 4 envelopes, in which case we have the analogous problem but with 1 card and 1 envelope less. So, for each of those 4 cases, you can again either put the isolated card into the isolated envelope (derangement number 3), or put the isolated card into one of the other 3 envelopes ... In which case ... Etc.

So you get:

$$D_4 + 4*(D_3+3*(D_2 + 2* (D_1+ 1*D_0)))=9+4*(2+3*(1+2*(0+1)))=$$

$$9+4*(2+3*(1+2))=9+4*(2+9)=9+4*11=\boxed{53}$$

More formally: Let us say that we have $n$ matching cards and enveloe numbers, and 1 isolated card and 1 isolated envelope. Let us say that $F_n$ is the number of ways we can put the cards into the envelopes so that no numbers match. Then we have in general:

$$F_0=1$$

(If you just have 1 isolated card and 1 envelope, put the card in the envelope)

$$F_{n+1}=D_{n+1}+(n+1)*F_n$$

(You can either put the isolated card into the isolated envelope, giving a classic derangement problem for $n+1$, or put the isolated card into one of the other $n+1$ other envelopes, giving us $F_n$ possibilities for each)