2

This has been rattling my brain for a while now.

I've got 5 pairs of socks, so 10 in total.

I'm pulling them out of the laundry one by one.

By the time I'm done with my laundry, what is the probability of getting two socks from the same pair in a row (at least once)?

An example line-up: A B C D D E A B C E

I know the number of total possible combinations is 10!, divided by 25, but finding the number of desired outcomes (at least one pair anywhere in the lineup) has proven too challenging for me.

Thanks!

Enic
  • 83
  • 1
    Hehe, you mean 'racking' your brain; a rattlebrain, on the other hand, means a foolish person. – ryang Aug 22 '22 at 16:07

2 Answers2

4

If we assume that two socks in a pairs are identical :

By P.I.E ,we want the cases where the sequence contains $AA$ or $BB$ or $CC$ or $DD$ or $EE$.

  • The number of sequences containing $AA$ : $$\frac{9!}{2^4}$$

The foregoing expression is also valid for the rest.

  • The number of sequences containing two consequtive pairs such as $AA$ and $BB$ : $$\frac{8!}{2^3}$$

  • The number of sequences containing three consequtive pairs such as $AA$ and $BB$ and $CC$: $$\frac{7!}{2^2}$$

  • The number of sequences containing four consequtive pairs such as $AA$ and $BB$ and $CC$ and $DD$: $$\frac{6!}{2}$$

  • The number of sequences containing four consequtive pairs such as $AA$ and $BB$ and $CC$ and $DD$ and $EE$: $$5!$$

By P.I.E : $$\binom{5}{1} \frac{9!}{2^4} -\binom{5}{2} \frac{8!}{2^3}+\binom{5}{3} \frac{7!}{2^2}-\binom{5}{4} \frac{6!}{2}+\binom{5}{5} 5!$$

So , the probability is $$\frac{\binom{5}{1} \frac{9!}{2^4} -\binom{5}{2} \frac{8!}{2^3}+\binom{5}{3} \frac{7!}{2^2}-\binom{5}{4} \frac{6!}{2}+\binom{5}{5} 5!}{\frac{10!}{2^5}}$$

NOTE: If two socks in a pair were non-identical , then the selection order of $A_1$ and $A_2$ must have been taken into account . Moreover , the denominator part would be $10!$ , because all socks are different.

2

There may well be a more elegant approach than this answer, which uses Inclusion-Exclusion. See this article for an introduction to Inclusion-Exclusion. Then, see this answer for an explanation of and justification for the Inclusion-Exclusion formula.

This answer will also employ Stars and Bars analysis. See this article and this one.

Re-label the socks 1,1,2,2,3,3,4,4,5,5.
Using the syntax from the second Inclusion-Exclusion link, for $k \in \{1,2,3,4,5\}$, let $S_k$ denote the subset of arrangements that feature socks $(k,k)$ together.

Then, the desired probability is

$$\frac{|S_1 \cup S_2 \cup \cdots \cup S_5| \times 2^5}{(10)!}. \tag1 $$

Therefore, the problem reduces to computing

$$|S_1 \cup S_2 \cup \cdots \cup S_5|.$$

Following the syntax in the 2nd link, for $r \in \{1,2,3,4,5\}$, let $T_r$ denote the $~\displaystyle \binom{5}{r}~$ terms given by

$\displaystyle \sum_{1 \leq i_1 < i_2 < \cdots < i_r \leq 5} \left[S_{i_1} \cap S_{i_2} \cap \cdots \cap S_{i_r}\right].$

Then, in accordance with Inclusion-Exclusion theory,

$$|S_1 \cup S_2 \cup \cdots \cup S_5| = \sum_{r=1}^5 (-1)^{r+1}T_r. \tag2 $$


$\underline{\text{Computation of} ~T_1}$
First compute $|S_1|$. There are $(9)$ different positions for the pair $(1,1)$. So, you start with a factor of $(9)$, and then assume that pair $(1,1)$ start in position $(1).$

Now, the other $4$ pairs can occur anywhere in positions $(3)$ through $(10)$. This generates a factor of $~\displaystyle \frac{8!}{2^4}.$

Therefore, $~\displaystyle |S_1| = 9 \times \frac{8!}{2^4}.$

By symmetry, $|S_1| = |S_2| = \cdots = |S_5|$.

Therefore,

$$T_1 = 5 \times 9 \times \frac{8!}{2^4} = 113400. \tag3 $$


$\underline{\text{Computation of} ~T_2}$
First compute $|S_1 \cap S_2|$. This computation will have two parts. The first part will use Stars and Bars Theory to determine the number of ways of positioning pairs (1,1) and (2,2). Then, a second factor will enumerate the number of ways of positioning the remaining 3 pairs of socks.

The two pairs, (1,1) and (2,2) can be permuted in $(2!)$ ways. So, start with a factor of $(2!)$, and now assume that (1,1) precedes (2,2).

Consider the number of non-negative integer solutions to

$$x_1 + x_2 + x_3 = 6 ~: ~\binom{8}{2} = 28 ~~\text{solutions}.$$

In the above equation, the three variables refer to the regions before (1,1), between (1,1) and (2,2), and after (2,2). So, you now have an additional factor of $(28)$.

Therefore, in the computation of $|S_1 \cap S_2|$, the first part of the computation yields:

$$(2!) \times (28).$$

For each of the $(56)$ ways of positioning (1,1) and (2,2), there will be $(6)$ remaining positions for the $(6)$ remaining socks. This generates a factor of $~\displaystyle \frac{6!}{2^3}.$

Therefore,

$$|S_1 \cap S_2| = (2!) \times \binom{8}{2} \times \frac{6!}{2^3}.$$

By symmetry, each of the other $~\left[\binom{5}{2} - 1\right]~$ terms in the enumeration of $~T_2~$ will have the same computation.

Therefore,

$$T_2 = (2!) \times \binom{8}{2} \times \frac{6!}{2^3} \times \binom{5}{2} = 50400. \tag4 $$


$\underline{\text{Computation of} ~T_3}$
The analysis in this section will parallel the analysis in the previous section. To compute $|S_1 \cap S_2 \cap s_3|$, you start with a factor of $(3!)$.

Then, you consider the number of non-negative integer solutions to

$$x_1 + x_2 + x_3 + x_4 = 4 ~: ~\binom{7}{3} ~~\text{solutions}.$$

Then, you apply a factor of $~\displaystyle \frac{4!}{2^2}~$ to account for the $(2)$ remaining pairs of socks.

Therefore,

$$|S_1 \cap S_2 \cap S_3| = (3!) \times \binom{7}{3} \times \frac{4!}{2^2}.$$

By symmetry, each of the other $~\left[\binom{5}{3} - 1\right]~$ terms in the enumeration of $~T_3~$ will have the same computation.

Therefore,

$$T_3 = (3!) \times \binom{7}{3} \times \frac{4!}{2^2} \times \binom{5}{3} = 12600. \tag5 $$


$\underline{\text{Computation of} ~T_4}$
The analysis in this section will parallel the analysis in the previous sections. You start with a factor of $(4!)$.

Then, you consider the number of non-negative integer solutions to

$$x_1 + x_2 + x_3 + x_4 + x_5 = 2 ~: ~\binom{6}{4} ~~\text{solutions}.$$

Then, you apply a factor of $~\displaystyle \frac{2!}{2^1}~$ to account for the $(1)$ remaining pairs of socks.

Then, you apply the factor of $~\displaystyle \binom{5}{4}.$

Therefore,

$$T_4 = (4!) \times \binom{6}{4} \times \frac{2!}{2^1} \times \binom{5}{4} = 1800. \tag6 $$


$\underline{\text{Computation of} ~T_5}$
There is no wiggle room here, since the 5 pairs (in some order) must specifically go into positions [1,2], [3,4], ..., [9,10].

Therefore,

$$T_5 = 5! = 120.\tag 7$$


$\underline{\text{Final Computations}}$

$$|S_1 \cup \cdots \cup S_5| = \left[T_1 + T_3 + T_5\right] - \left[T_2 + T_4\right]$$

$$= \left[113400 + 12600 + 120\right] - \left[50400 + 1800\right] = 73920.$$

Therefore, the desired probability is

$$\frac{73920 \times 2^5}{(10)!} = \frac{88}{135}.$$

user2661923
  • 35,619
  • 3
  • 17
  • 39