Pairs of socks in the dark

Question: You enter a dark closet where there are scattered around socks of 3 different colours blue,red and green. The closet has 3 pairs of each of the colours (but as mentioned before the socks are scattered one by one). What is the minimum number of socks that you need to take out in order to ensure you have a pair of the same color.

Answer: You need to take 4 socks. If you take 3 socks you may have on the worst case scenario one of each, so taking a fourth one would ensure there is at least a pair.  The number of socks of each colour are irrelevant and are only there to confuse you.  If you are asked with a different number of  different colours the answer will be one more than the number how many different colours you have.