A problem that requires a little bit of thinking but has a very simple logic behind it. In fact, isn’t it something many of us would do on a day to day basis, picking out socks?
Let’s revisit the question:
Anisha has twelve red socks and twelve blue socks in her bag. In complete darkness and without looking, what is the minimum number of socks she must take out from the bag in order to be sure to get a pair that matches?
The logic that we need to take care of here is that, to ensure that we get duplicates we have to make sure we pick 1 more than the number of categories. Here’s how this logic can be explained;
There are 2 categories in Anisha’s bag, red & blue (socks). The first sock would belong to one category and the second would belong to either the same or another category. The third sock however, would belong to any one of these categories thereby making a pair.
Therefore, Anishamust pull out 3 socks to find a pair that matches.
This kind of logic can also be applied in problems where there are larger number of categories. In order to get duplicates, one must choose one more than the total number of categories.
An easier way to explain this problem is,
Each sock has the probability to be either red or blue.
Sock 1 = Red or Blue
Sock 2 = Red or Blue
Sock 3 = Red or Blue
If sock 1 is red:
Sock 2 maybe red (which makes a pair)
Sock 2 maybe blue, in which case;
Sock 3 maybe red (which would make a pair with sock 1)
Sock 3 maybe blue (which would make a pair with sock 2)
Therefore the right answer is,
Anisha must pull out 3 socks to find a pair that matches.
However, this solution is feasible only when we have a small number of categories or else, the iterations turn out to be too lengthy.