Another week, another riddler. This one was from Kathy Bischoping:
I have 10 pairs of socks in a drawer. Each pair is distinct from another and consists of two matching socks. Alas, I’m negligent when it comes to folding my laundry, and so the socks are not folded into pairs. This morning, fumbling around in the dark, I pull the socks out of the drawer, randomly and one at a time, until I have a matching pair of socks among the ones I’ve removed from the drawer.
On average, how many socks will I pull out of the drawer in order to get my first matching pair?
(Note: This is different from asking how many socks I must pull out of the drawer to guarantee that I have a matching pair. The answer to that question, by the pigeonhole principle, is 11 socks. This question is instead asking about the average.)
Extra credit: Instead of 10 pairs of socks, what if I have some large number N pairs of socks?
This problem is just strict probabilities. The form of our answer is:
Where the probability of getting a sock at each pull is recursively discovered with
As an example, here is what the probability looks like when you have three pairs of socks:
Putting it together:
Extending this to 10 gives us an answer of 5.675 socks removed from the drawer, on average.