36

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?

Alexis
  • 8,302
  • 2
  • 30
  • 83

5 Answers5

38

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.

Gamow
  • 45,573
  • 10
  • 147
  • 381
Joel Rondeau
  • 7,540
  • 1
  • 30
  • 44
  • 1
    Could you explain the first step, ie. why it is 2ab on the RHS? – Francis Davey Feb 27 '15 at 15:02
  • 2
    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
15

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.

kaine
  • 9,102
  • 27
  • 71
11

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.

shoover
  • 5,201
  • 22
  • 29
  • 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
1

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.

WildM
  • 11
  • 1
  • 5
  • 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