The Sock Drawer
Skill: planning for the unluckiest case instead of the average one
Problem
A drawer holds loose socks: 5 red, 4 blue, and 6 black. The room is dark, so you cannot see the colours.
1. What is the smallest number of socks you must take to be certain of holding two of the same colour?
2. What is the smallest number you must take to be certain of holding two black socks?
Hints
Hint 1
"Certain" means it must work even in the unluckiest order. What is the worst possible start?
Hint 2
In the worst case for part 1, the first three socks are three different colours. What must the fourth one be?
Hint 3
For part 2, the worst case is that every sock you touch is not black. How many of those are there?
Solution
Understand what "certain" means.
A number only counts as an answer if it works in the unluckiest possible order. Someone could hand you socks in any order, so plan for the order that delays your goal for as long as possible. That is the opposite of planning for a typical draw.
Part 1: build the worst start.
The drawer has three colours. You could take one red, one blue and one black and still have no pair. So 3 is not enough, however lucky a particular draw might be.
Part 1: one more forces a pair.
The fourth sock must be red, blue or black, and every one of those colours is already in your hand. Whichever colour it is, it matches a sock you already hold. Four is enough and three is not, so the answer is 4. This is the pigeonhole principle: four socks placed into three colour slots must put two in the same slot.
Part 2: build the worst start.
To avoid a black pair, take every sock that is not black first. That is 5 red plus 4 blue, so 9 socks can leave you with no black socks at all. Even 10 socks can leave you with exactly one black sock and nine others.
Part 2: the eleventh sock must be black.
After 10 socks the worst case is 9 non-black socks plus 1 black sock. The 11th sock cannot be red or blue, because all 9 of those are already out, so it must be black. That gives a black pair. The answer is 11.
Answer: 4 socks for any matching pair, and 11 socks for a black pair.
Why this works
A guarantee is about the worst case. To find one, build the largest draw that still fails, then take one more sock. The extra sock has no way to avoid the goal, so the guarantee follows.
The two answers are far apart because the second goal names a colour. Red and blue socks can delay a black pair, and there are nine of them, so almost the whole drawer has to come out first.
Try a related problem
A drawer holds socks in four colours, 12 socks in total. How many must you take to be certain of a matching pair?