Grabbing Mugs in the Dark

An office cupboard holds a jumble of coffee mugs that come in several colors, and the lights are out, so you can't see what you grab. First suppose the mugs come in only two colors, navy and cream: how many mugs must you take to be certain of holding two of the same color? Then generalize: with mugs in NN distinct colors, how many grabs guarantee a same-color pair?

Answer

Free accounts unlock one worked solution a day. Pro includes every answer.