## Teaser 2930: Odd socks

**From The Sunday Times, 18th November 2018** [link]

I had a drawer containing some black socks and some white socks. If I drew out two socks at random the chance of getting a black pair was 1 in __.

After many washes all the socks looked grey. So I added some red socks to the drawer. Then if I drew out two at random the chance of getting a grey pair was 1 in __.

After many washes all the socks looked pink. So I added some green socks to the drawer. Then if I drew out two the chance of getting a pink pair was 1 in __.

After many washes all the socks looked brown. So I have now added some yellow socks to the drawer giving me a total of fewer than fifty socks. Now if I draw out two the chance of getting a brown pair is 1 in __.

The gaps above consist of four different prime numbers.

If I draw out two socks at random, what is the chance of getting a yellow pair?

[teaser2930]

## Jim Randell 8:41 am

on25 March 2019 Permalink |This Python 3 program works by finding possible

(prime, X, Y)tuples for choosing a pair ofXsocks fromX+Y, and then links together the appropriate number of tuples to solve the puzzle.It runs in 75ms.

Run:[ @repl.it ]Solution:There is a 1 in 6 chance of getting a yellow pair.There are two scenarios which give the answer:

But in both cases the probability of a yellow pair (from 21 brown and 15 yellow) is 1/6.

In the puzzle I interpreted “some” to mean “at least 2”, and this gives the solution above. However, if we interpret it as “at least 1” then you get 2 further solutions, which give an answer of 1/14. (You can change the value of [[

`m`

]] to [[`1`

]] in the program to see this).Interestingly there are no solutions (even with the relaxation of “some”) where all the numbers of different coloured socks are all even. Which certainly is an “odd” way to acquire socks.

LikeLike