Final answer:
You need to pull out 6 socks to guarantee a pair of one color, 11 socks to guarantee two pairs, and 7 socks to be certain you have a pair of black socks.
Step-by-step explanation:
To guarantee that you have a pair of one color when selecting from a mix of 10 pairs of socks (5 black and 5 blue), you must consider the worst-case scenario. This occurs when you alternatively pick one of each color. Therefore, after picking 5 black and 4 blue socks, the next sock you pick will guarantee a pair. So, you need to pull out 6 socks to ensure a pair of one color (5 of one color and 1 of the other).
To have two good pairs, you would continue this pattern. After the first pair is secured with 6 pulls, you would possibly pick the alternating color for the next 4 pulls, and then any subsequent sock would complete a second pair of one color. In total, this would require pulling out 11 socks to ensure two pairs.
To be certain you have a pair of black socks, prepare for the possibility of pulling out all 5 blue socks first. After these 5, the next 2 socks you pull out will be black, giving you at least one pair of black socks. Therefore, you would need to pull out 7 socks to be certain.