To guarantee that you have at least two pairs of matching socks, you need to consider the worst-case scenario. In the drawer, you have socks of three different colors: blue, white, and red.
First, let’s think about how many socks you can pull out without getting a pair. If you take one blue, one white, and one red sock, that’s three socks without any pairs. Pulling out a fourth sock guarantees that you will have at least one pair, since there are only three colors. However, that only gives you one pair.
To ensure that you have two pairs, you need to consider the possibility that, after getting one pair, the next pairs could be of a different color. If you pull an additional three socks, which could also be blue, white, and red, you might still end up with only one pair of socks since you could have chosen one from each color again.
In the worst-case scenario, you would pull out seven socks: three of one color (this would secure one pair) and then a sock from each of the other two colors. This will ensure that the next two socks you pull will definitely create two pairs. Thus, by pulling out seven socks, you are guaranteed to have two pairs of matching socks.
So, the least number of socks you need to pull to ensure you get two pairs of matching socks is seven.