A).
There are two colors: these are the pigeonholes. We want to know the least number of pigeons needed to insure that at least one of the pigeonholes contains two pigeons. By the pigeonhole principle, the answer is 3. If three socks are taken from the drawer, at least two must have the same color. On the other hand two socks are not enough, because on might be brown and the other black. Note that the number of socks was irrelevant (assuming it was at least 3).
1(RED)+1(BLACK)+1(either red or black)=3
B).
He needs to take out 14 socks in order to insure at least two are black socks. If he does so, then at most 12 of them are brown, so at least two are black. On the other hand, if he removes 13 or fewer socks, then 12 of them could be brown, and he might not get his pair of black socks. This time the number of socks did matter
12(RED)+1(BLACK)+1(BLACK)=14