# My grandfather's socks

My grandfather has a big drawer where he keeps his socks. The drawer contains more than 900 but less than 1000 individual socks. Each of his socks is black or blue, and there are more blue socks than black socks. The socks aren't paired by color within the drawer, but if he reaches into it and grabs two socks at random, then exactly half the time he will pull a matching pair.

My grandfather has always been extremely careful when doing the laundry, and has only ever lost a single sock in his entire life.

What color was that lost sock?

• Your grandfather either has giant furniture or very tiny socks. – Engineer Toast Feb 26 '15 at 18:29
• He could save himself time by always pulling out three socks. – Dewi Morgan Feb 27 '15 at 4:32
• Why do we care about a lost sock? Did we even notice? – Erno de Weerd Feb 27 '15 at 14:28
• Plot twist, the socks are really white and gold – Nadine Feb 27 '15 at 16:41
• Plot twist... Martin is actually a sockpuppet :D – d'alar'cop Apr 14 '15 at 11:02

Your grandfather lost a black sock.

This is because

Let $a$ be the number of blue socks and $b$ be the number of black socks.
To get exactly 50% matching, you will need
$~~~~~ a(a-1) + b(b-1) = 2ab$
which can be rewritten as
$~~~~~ (a-b)^2 = a+b$.
As $a+b$ is a square with $900 < a+b < 1000$, we get $a+b=961$. Then $a > b$ yields $a-b=31$. The only remaining possibility is $a=496$ blue socks and $b=465$ black socks, and the lost sock was black.

• Could you explain the first step, ie. why it is 2ab on the RHS? – Francis Davey Feb 27 '15 at 15:02
• a(a-1) is all combinations of 1st sock blue, 2nd sock blue. ab is all combinations of 1st sock blue, 2nd sock black. b(b-1) is all combinations of 1st sock black, 2nd sock black. ba is all combinations of 1st sock black, 2nd sock blue. Add same colored combinations on left, different colored combinations on right. ab + ba = 2ab. – Joel Rondeau Feb 27 '15 at 16:17

Assuming he bought pairs of socks, then either the number of blue socks $(u)$ or the number of black socks $(k)$ is odd with the other is even.

$$u>k$$ $$p = .5 = \frac u {(k+u)}\frac k {(k+u-1)}+\frac k {(k+u)}\frac u {(k+u-1)}$$ $$p = .5 = \frac {2uk} {(k+u)(k+u-1)}$$ $$p = .5 = \frac u {(k+u)}\frac {u-1} {(k+u-1)}+\frac k {(k+u)}\frac {k-1} {(k+u-1)}$$ $$p = .5 = \frac {u^2-u+k^2-k} {(k+u)(k+u-1)}$$ $$0=u^2+k^2-u-k-2uk$$

$$u=n^2/2+n/2$$ $$k=n^2/2-n/2$$ $$u+k=n^2$$

so

$$n=31$$ $$u=496$$ $$k=465$$

This means grandpa lost a black sock.

• Was working on this when the other was posted; the Joel's answer is correct and well explained as well. – kaine Feb 26 '15 at 17:57
• You should add this in spoiler tags. – Spotlight Feb 27 '15 at 4:20

The lost sock was

black

Let $B$ be the event that grandpa pulls a blue sock and $K$ be the event that he pulls a black sock. Also let $b$ be the number of blue socks and $k$ be the number of black socks. We are told that $b>k$ and $900<b+k<1000$.

There are four possibilities for the events of pulling two socks: $BB$, $BK$, $KB$, and $KK$. The probability of choosing a matching pair, i.e. pulling two socks without replacement, is $P(BB) + P(KK)$.

Calculations:

\begin{align} P(BB) & = \left( \frac b{b+k} \right) \left( \frac {b-1}{b+k-1} \right) \\ \\& = \frac {b^2-b}{b^2+2bk+k^2-b-k} \\ \\P(KK) & = \left( \frac k{b+k} \right) \left( \frac {k-1}{b+k-1} \right) \\ \\& = \frac {k^2-k}{b^2+2bk+k^2-b-k} \\ \\P(BB) + P(KK) & = \frac {b^2-b}{b^2+2bk+k^2-b-k} + \frac {k^2-k}{b^2+2bk+k^2-b-k} \\ \\& = \frac {b^2-b+k^2-k}{b^2+2bk+k^2-b-k}\end{align}

But we know that:

\begin{align} P(BB) + P(KK) & = \frac 12 \\ \\ \frac {b^2-b+k^2-k}{b^2+2bk+k^2-b-k} & = \frac 12\end{align}

Multiplying both sides by both denominators:

\begin{align}2b^2-2b+2k^2-2k & = b^2+2bk+k^2-b-k \\b^2-2bk+k^2 & = b+k \\(b-k)^2 & = b+k\end{align}

So

$b+k$ is a perfect square and $900<b+k<1000$. The only perfect square in that range is $961=31^2$, so $b+k=961$, i.e. there are 961 socks total. But this is $(b-k)^2$, so $b-k=31$.

Finally:

\begin{align} b+k & = 961 \\ b-k & = 31 \\ 2b &= 992 \\ b &= 496 \\ k &= 465 \\ \end{align}

Since the odd number is

$k$

the missing sock was

black.

• And now I know how to combine the spoiler tag with MathJax's block quoting with alignment. If it weren't for that, I'd have had this answer in much earlier. – shoover Feb 26 '15 at 18:47

I'm going to feel very stupid if this is wrong, but...shouldn't the lost sock be

black since he has more blue socks than black ones, and his odds of pulling a matching pair are 50%?

Even looking at all of the computations, I can't see a reason that my logic would be insufficient.

• 1) No one ever said he bought as many pairs of blue and black socks. If he bought 50 pairs of blue and 100 pairs of black and lost a black sock, he would still have more black socks than blue socks. 2) the 50% means he is as likely to select a matching pair as a non-matching pair. Aka bb or kk is as likely as bk. These are not equal if b=k as picking one black sock slightly decreases the probability of picking another one if there is no replacement. 3) if the total number of socks were between 800 and 900, then the lost one would be blue. – kaine Feb 26 '15 at 20:36
• #3 did it for me. Appreciate setting me straight. – WildM Feb 26 '15 at 21:17

"Each of his socks is black or blue, and there are more blue socks than black socks"

followed by

"My grandfather has always been extremely careful when doing the laundry, and has only ever lost a single sock in his entire life."

I stopped going further immediately, given that socks are only ever sold in pairs, it had to be black. Sorry, was this question supposed to only be looking for mathematical proofs, and not common sense?

• This is false. See WildM's answer comment for why. – March Ho Mar 1 '15 at 13:01