Contents

The Sock Drawer

Contents
A sock drawer with yellow and blue socks

Problem

A drawer contains yellow socks and blue socks. When two socks are drawn at random, the probability that both are yellow is $\frac{1}{2}$.

Questions: (a) How small can the number of socks in the drawer minimally be?
(b) How small can it minimally be if the number of blue socks is even?

Solution

Solution to (a)

(a) Minimum number of socks:

Let:

  • $y \in \mathbb{N}$ = number of yellow socks
  • $b \in \mathbb{N}$ = number of blue socks
  • $n = y + b$ = total number of socks

The probability that both of the drawn socks are yellow is:

$$ \frac{y(y-1)}{n(n-1)} $$

We want the smallest $n$ such that some $y < n$ satisfies this equation:

$$ \frac{y(y-1)}{n(n-1)} = \frac{1}{2} $$

Try small values of $n$:

  • $n = 3$, $y = 2$ $\Longrightarrow$ $\frac{y(y-1)}{n(n-1)}=\frac{2(1)}{3(2)} = \frac{1}{3}$ ❌
  • $n = 4$, $y = 3$ $\Longrightarrow$ $\frac{y(y-1)}{n(n-1)}=\frac{3(2)}{4(3)} = \frac{1}{2}$ ✔️

Answer: The smallest number $n$ of socks there can be in the drawer is $n = 4$.

Solution to (b)

(b) Minimum number of socks with an even number of blue socks:

We now look for the smallest $n$ such that:

  • $\frac{y(y-1)}{n(n-1)} = \frac{1}{2}$
  • and $n-y$ (=the number of blue socks) is even

You can find valid $(n, y)$ pairs using this brute-force Python script:

1
2
3
4
5
for n in range(1, 100):
    for y in range(2, n):
        if y * (y - 1) == (n * (n - 1)) / 2:
            if (n - y) % 2 == 0:
                print(f"n = {n}, y = {y}")

There is only one such pair : $$(n,y)=(21,15)$$

$n-y=6$ is even so the answer is:

Answer: The smallest number $n$ of socks there can be in the drawer with an even number of blue socks is $n = 21$.