A drawer contains 20 black socks and 20 white socks. If the light is off and you reach into the draw to get your socks, what is the minimum number of socks you must pull out in order to be sure that you have a matching pair?

Gaah

3 is answer but I don't know how

In order to be sure that you have a matching pair of socks, you need to consider the worst case scenario where you pick the maximum number of socks of one color before picking a sock of the other color.

The minimum number of socks you must pull out to be sure that you have a matching pair is 3.

This is because in the worst case scenario, you could first pick a black sock, then another black sock, and finally a white sock. Therefore, you need to pull out at least 3 socks to guarantee a matching pair.

To determine the minimum number of socks you must pull out to be sure that you have a matching pair, let's consider the worst-case scenario.

In this case, the worst-case scenario is that the first sock you pick is black and the second sock you pick is white, or vice versa. Therefore, after picking two socks, it is not guaranteed that you have a matching pair.

However, the moment you pick a third sock, it will create a matching pair with either of the first two socks, irrespective of their colors. This is because you have 20 black socks and 20 white socks, and by picking three socks, you will have more than enough to ensure at least one matching pair according to the pigeonhole principle.

Hence, the minimum number of socks you must pull out, regardless of their colors, to be absolutely sure that you have a matching pair is 3.