Abby has 18 blue socks and 4 white socks. How many socks does she need to pull out in order to have a matching pair of socks?

3

The first two she pulls out could be one of each color. The third must match at least one of the first two.

To determine the minimum number of socks Abby needs to pull out in order to have a matching pair, we can use the concept of the pigeonhole principle.

The pigeonhole principle states that if you have more pigeons (or in this case, socks) than you have holes (or different colors of socks), then at least two pigeons (or socks) must end up in the same hole (or matching pair).

In this case, Abby has 18 blue socks and 4 white socks. Since she wants to have a matching pair, the worst-case scenario is that she pulls out all of her blue socks first and then pulls out a white sock. Therefore, Abby needs to pull out 19 socks in order to guarantee that she has a matching pair.