3

Suppose that you have 20 different letters and 10 distinctly addressed envelopes. The 20 letters consists of 10 pairs, where each pair belongs inside one of the 10 envelopes. Suppose that you place the 20 letters inside the 10 envelopes, two per envelope, but at random.

What is the probability that exactly 3 of the 10 envelopes will contain both of the letters which they should contain?

I have seen similar questions to this one but they always assign only one letter to one envelope. Also, the scenario is usually how to choose AT LEAST one right envelope. I am not too clear as to how to adapt to this new scenario.

4 Answers4

4

Well here is my attempt, using inclusion exclusion principle. I am counting number of ways so that exactly three pair gets in their desired envelope:

First we add the term $\binom{10}{3}\cdot 14!\cdot(2!)^3$ to denote number of ways to choose $3$ envelop that will get correct letter pair and shuffling the rest of them. But this has overcounted, as it may contain some other envelopes with correct letter pairs.

So for now, after selecting the three envelope, we focus on other envelopes. We need to subtract the cases where one out of remaining 7 got correct letter, 2 out of remaining 7 got correct letter pair and so on. So we get:

$$\binom{10}{3}\cdot(2!)^3 \left[\sum_{k=0}^{7}(-1)^k (2!)^k\binom{7}{k}(14-2k)!\right]$$

To get the probability we should divide by total number of shuffle ways, which is $20!$

jeea
  • 1,354
  • 1
    Thanks for this answer -- it made me revisit this old question of mine and realize that the proof of that generalized principle is more straightforward than I thought :-) I added that as an answer there. – joriki Mar 12 '20 at 12:36
  • You computed the common $3$-correct case first and do IEP to remaining $7$ envelopes, you can take a look of my answer which directly compute IEP from $10$ envelopes. – linear_combinatori_probabi Sep 03 '20 at 21:57
2

What's easy to compute is that you know at least $j$-envelopes will contain correct pairs, define this as $S_j$, then

$$S_j=\binom{10}{j}(2!)^j(20-2j)!,$$

By exactly-Inclusion-Exclusion Principle

$$\begin{align} E_3&=\sum_{j=3}^{10}(-1)^{j-3}\binom{j}{3}S_j\\ &=\sum_{j=3}^{10}(-1)^{j-3}\binom{j}{3}\left[\binom{10}{j}(2!)^j(20-2j)!\right]\\ &=\sum_{j=3}^{10}(-1)^{j-3}\binom{10}{3}\binom{7}{j-3}(2!)^j(20-2j)!\\ &=\binom{10}{3}\sum_{j=3}^{10}(-1)^{j-3}\binom{7}{j-3}(2!)^j(20-2j)!\\ &=\binom{10}{3}(2!)^3\sum_{j=0}^7(-1)^j\binom{7}{j}(2!)^j(14-2j)!\quad\quad\quad\square \end{align}$$

So the probability is

$$P_{=3}=\frac{\binom{10}{3}(2!)^3\sum_{j=0}^7(-1)^j\binom{7}{j}(2!)^j(14-2j)!}{20!}\quad\quad\quad\square$$

  • 1
    (+1) I believe our approaches are the same except that you counted $2^{10}$ as many cases by differentiating which letter is on top. I counted those as the same. Do you have a reference for the "exactly-Inclusion-Exclusion Principle"? – robjohn Aug 26 '21 at 16:54
  • @robjohn: Thanks for the confirmation. I think I created that phrase for myself, lol. I should schedule a time to elaborate more on it, sorry for the unclearness. (Long time no see btw :) I remember that I learned a lot on this topic from you. I'm busy on some school projects.) – linear_combinatori_probabi Aug 27 '21 at 01:41
2

Let $S_i$ be the arrangements where envelope $i$ has both of its intended letters. The number of intersections of $k$ of the $S_i$ is $$ N_k=\overbrace{\ \ \binom{10}{k}\ \ }^{\substack{\text{number of ways}\\\text{to choose the}\\\text{$k$ envelopes}}}\ \ \overbrace{\frac{(20-2k)!}{2^{10-k}}\vphantom{\binom{10}{k}}}^{\substack{\text{ways to arrange}\\\text{$20-2k$ letters in}\\\text{$10-k$ envelopes}}} $$ The Generalized Principle of Inclusion-Exclusion says that the number of arrangements with exactly $3$ envelopes properly filled is $$ \begin{align} \sum_{k=3}^{10}(-1)^{k-3}\binom{k}{3}\binom{10}{k}\frac{(20-2k)!}{2^{10-k}} &=\binom{10}{3}\sum_{k=3}^{10}(-1)^{k-3}\binom{7}{k-3}\frac{(20-2k)!}{2^{10-k}}\\[6pt] &={75718299600} \end{align} $$ The number of ways to arrange $20$ letters in $10$ envelopes is $$ \frac{20!}{2^{10}}={2375880867360000} $$ Thus, the requested probability is $$ \begin{align} \frac{75718299600}{2375880867360000} &=\frac{21032861}{659966907600}\\[6pt] &\approx0.0000318695691523 \end{align} $$

robjohn
  • 345,667
1

Here a way to it.

(At the moment I must leave, so do not have the opportunity to work it out myself)


First let us solve the analogous question where it concerns $7$ enveloppes and $14$ letters and where we must find the probability that $0$ of the $7$ enveloppes will contain both the letters which they should contain.

Number the envelopes with $1,2,\dots,7$ and let $E_{i}$ denote the event that the $i$-th envelop contains the letters which it should contain.

Then to be found is $P\left(E_{1}^{\complement}\cap\cdots\cap E_{7}^{\complement}\right)=1-P\left(E_{1}\cup\cdots\cup E_{7}\right)$ and for term $P\left(E_{1}\cup\cdots\cup E_{7}\right)$ we can use inclusion/exclusion and symmetry.

Now in the original problem number the envelopes with $1,2,\dots,10$ and to avoid confusion let here $A_{i}$ denote the event that the $i$-th envelop contains the letters which it should contain.

Then the probability on exactly $3$ envelopes that contain the correct letters can be expressed as:

$$\binom{10}{3}P\left(A_{1}^{\complement}\cap\cdots\cap A_{7}^{\complement}\cap A_{8}\cap A_{9}\cap A_{10}\right)=$$$$\binom{10}{3}P\left(A_{1}^{\complement}\cap\cdots\cap A_{7}^{\complement}\mid A_{8}\cap A_{9}\cap A_{10}\right)P\left(A_{8}\cap A_{9}\cap A_{10}\right)$$

Here: $$P\left(A_{8}\cap A_{9}\cap A_{10}\right)=P\left(A_{10}\right)P\left(A_{9}\mid A_{10}\right)P\left(A_{8}\mid A_{9}\cap A_{10}\right)$$ which is not difficult to find, and: $$P\left(A_{1}^{\complement}\cap\cdots\cap A_{7}^{\complement}\mid A_{8}\cap A_{9}\cap A_{10}\right)=P\left(E_{1}\cup\cdots\cup E_{7}\right)$$ where the RHS is found above.


Edit:

Let us choose for a more general approach: $n$ envelopes and $nm$ letters.

Let $X_{n}$ denote the number of envelopes containing the $m$ letters that they should contain.

Our aim is to find an expression for $P\left(X_{n}=k\right)$.

Five the letters the numbers $1,2,\dots,n$ and let $A_i^{(n)}$ denote the event that the $i$-th letter contains the letters that it should contain.

In what follows now $A_i^{(n)}$ is abbreviated as $A_i$.

$\begin{aligned}P\left(X_{n}=k\right) & =\binom{n}{k}P\left(A_{1}\cap\cdots\cap A_{k}\cap A_{k+1}^{\complement}\cap\cdots\cap A_{n}^{\complement}\right)\\ & =\binom{n}{k}P\left(A_{1}\cap\cdots\cap A_{k}\right)P\left(A_{k+1}^{\complement}\cap\cdots\cap A_{n}^{\complement}\mid A_{1}\cap\cdots\cap A_{k}\right)\\ & =\binom{n}{k}P\left(A_{1}\cap\cdots\cap A_{k}\right)P\left(X_{n-k}=0\right) \end{aligned} $

Here:

$\begin{aligned}P\left(A_{1}\cap\cdots\cap A_{k}\right) & =P\left(A_{1}\right)P\left(A_{2}\mid A_{1}\right)P\left(A_{3}\mid A_{1}\cap A_{2}\right)\cdots P\left(A_{k}\mid A_{1}\cap\cdots\cap A_{k-1}\right)\\ & =\left[\frac{m}{nm}\frac{m-1}{nm-1}\cdots\frac{1}{nm-m+1}\right]\left[\frac{m}{nm-m}\frac{m-1}{nm-m-1}\cdots\frac{1}{nm-2m+1}\right]\left[\frac{m}{nm-2m}\frac{m-1}{nm-2m-1}\cdots\frac{1}{nm-3m+1}\right]\cdots\left[\frac{m}{nm-km+m}\frac{m-1}{nm-km+m-1}\cdots\frac{1}{nm-km+1}\right]\\ & =\frac{\left(nm-km\right)!\left(m!\right)^{k}}{\left(nm\right)!} \end{aligned} $

In order to find $P(X_{n-k}=0)$ we now look at the situation where $n$ has changed into $n-k$.

The events $A_1^{(n-k)},\dots,A_{n-k}^{(n-k)}$ are abbreviated as $E_1,\dots,E_{n-k}$ and applying inclusion/exclusion and symmetry we find:

$\begin{aligned}P\left(X_{n-k}=0\right) & =P\left(E_{1}^{\complement}\cap\cdots\cap E_{n-k}^{\complement}\right)\\ & =1-P\left(E_{1}\cup\cdots\cup E_{n-k}\right)\\ & =\sum_{i=0}^{n-k}\binom{n-k}{i}\left(-1\right)^{i}P\left(E_{1}\cap\cdots\cap E_{i}\right)\\ & =\sum_{i=0}^{n-k}\binom{n-k}{i}\left(-1\right)^{i}P\left(E_{1}\cap\cdots\cap E_{i}\right)\\ & =\sum_{i=0}^{n-k}\binom{n-k}{i}\left(-1\right)^{i}\frac{\left(nm-km-im\right)!\left(m!\right)^{i}}{\left(nm-km\right)!} \end{aligned} $

Combining the results we find as final result:

$$P\left(X_{n}=k\right)=\frac{1}{\left(nm\right)!}\binom{n}{k}\sum_{i=0}^{n-k}\binom{n-k}{i}\left(-1\right)^{i}\left(nm-km-im\right)!\left(m!\right)^{k+i}$$

The special case where $n=10$, $m=2$ and $k=3$ gives probability:

$$\frac{1}{20!}\binom{10}{3}\sum_{i=0}^{7}\binom{7}{i}\left(-1\right)^{i}\left(14-2i\right)!2^{3+i}$$

This agrees with the answer of @jeea.

drhab
  • 151,093