Explanation
A dark drawer
It's dark, and your drawer has ten black socks and ten white socks. How many must you pull out to be sure you have a matching pair?
A dark drawer: 10 black socks, 10 white socks
Unluckiest picks
Imagine the unluckiest picks. First black, then white.
No pair yet. But the third sock must be black or white, so it matches.
Three socks.
Unluckiest picks: black, white → then any sock makes a pair → 3
"To be sure" = plan for the worst luck
Whenever a puzzle says 'to be sure' or 'guarantee', don't think about good luck. Picture the worst possible picks, then add one.
"To be sure" = plan for the worst luck
Pigeonhole
This is the pigeonhole principle. Put five pigeons into four holes, and at least one hole gets two.
More things than boxes means some box is shared.
Pigeonhole: 5 pigeons, 4 holes → some hole has 2
Sure of 2 black? Worst
Careful: sure of two black socks is a different question. The worst case is all ten white socks first, then two black.
Twelve.
Sure of 2 black? Worst: all 10 white first → 12
Worked example
A drawer has 5 red, 4 blue and 3 green socks. Sure of a pair of any colour: worst is one of each (3), so 4.
Sure of a red pair: worst is all 4 blue, all 3 green and 1 red (8), so 9.