# A person writes letters to six friends and addresses the corresponding envelopes. In how many ways can the letters be placed in the envelopes so that (a) At least two of them are in the wrong envelopes? (b) All the letters are in the wrong envelopes?

A person writes letters to six friends and addresses the corresponding envelopes.

$$(a) \text { The number of ways in which at least two of them are in the wrong envelopes is}\\ \sum_{r=2}^{6}{ }^{n} C_{n-r} D_{r} ={ }^{n} C_{n-2} D_{2}+{ }^{n} C_{n-3} D_{3} \\ +{ }^{n} C_{n-4} D_{4}+{ }^{n} C_{n-5} D_{5}+{ }^{n} C_{n-6} D_{6} \\ n=6\\ \sum_{r=2}^{6}{ }^{6} C_{6-1} D,{ }^{6} C_{4} \cdot 2 !\left(1-\frac{1}{1 !}+\frac{1}{2 !}\right)+{ }^{6} C_{3} \cdot 3 !\left(1-\frac{1}{1 !}+\frac{1}{2 !}-\frac{1}{3 !}\right)\\ +{ }^{6} C_{2} \cdot 4 !\left(1-\frac{1}{1 !}+\frac{1}{2 !}-\frac{1}{3 !}+\frac{1}{4 !}\right) \\ +{ }^{6} C_{1} \cdot 5 !\left(1-\frac{1}{1 !}+\frac{1}{2 !}-\frac{1}{3 !}+\frac{1}{4 !}-\frac{1}{5 !}\right) \\ +{ }^{6} C_{0} \cdot 6 !\left(1-\frac{1}{1 !}+\frac{1}{2 !}-\frac{1}{3 !}+\frac{1}{4 !}-\frac{1}{5 !}+\frac{1}{6 !}\right) \\= 15+40+135+264+265=719 \\ (b) \text { The number of ways in which all letters are placed in wrong envelopes is}\\ 6 !\left(1-\frac{1}{1 !}+\frac{1}{2 !}-\frac{1}{3 !}+\frac{1}{4 !}-\frac{1}{5 !}+\frac{1}{6 !}\right)\\ =720\left(\frac{1}{2}-\frac{1}{6}+\frac{1}{24}-\frac{1}{120}+\frac{1}{720}\right)\\ =360-120+30-6+1\\=265$$