2) Pour out two M&Ms.
3) If they're the same color, put the bag away. You only get to eat those two, until you really can't stand it and get the bag back out.
4) If they're different colors, continue taking out M&Ms one at a time until you get a color that you've already had. Then put the bag away and eat whatever you won.
This has something to do with geometric distribution, but I can't explain it all, I've forgotten most of what little I absorbed in probability. Also, I'm too focused on the chocolate.