Combinatorics -- Marble Problems Pretend that I have a bag of marbles, and let's say that there's 10 red, 10 blue, 5 yellow, and 8 purple. What's the minimum number of marbles that I need to draw to make sure that the number of marbles of some color is at least two more than the number of marbles of a different color?
If I were trying to figure out how many I have to draw to guarantee that I have 5 blue and 2 purple, it would just be (10*9*8*7*6) * (8*7). However, we don't have the numbers 5 and 2, but n and n+2, and we don't know the colors. 
Any additional commentary on solving these types of problems would be greatly appreciated! 
 A: First ask how many marbles you can pick while maintaining a difference of at most 1 between any two colors. There is a nice graphical way to represent that: you want to fill-up piles of marbles in a way that the min height and max height differ by at most 1. The result is this:

That is, 23 marbles. You would add them by filling the rows left-to-right, then bottom-to-top. So the minimum number of marbles for this to be impossible is $23+1=24$.
If you want to be more general, the formula would be
$$
a\times b+c+1
$$
where:


*

*$a$ is the number of colors ($a=4$ in the example)

*$b$ is the number of marbles for colors
that have the smallest number of marbles ($b=5$ in the example)

*$c$ is the number of colors that have at least $b+1$ marbles ($c=3$ in the example).



$$
a\times b+c+1=4\times5+3+1=24.
$$
This remains an easy calculation with large numbers of colors and marbles.
You can easily generalize the formula if you want, say, a difference of at most $k$ between colors, just draw the rectangles and you will figure it out! (of course in the general case there will be several colors that have the same number of marbles, but that will not be a problem).
A: The guarantee means you have to take into account all possible strategies and find the ones with the maximum number of draws. To do this, avoid two marbles of a different color as long as possible.
To do this just choose the colors alternately as long as possible. For example, red blue yellow purple red blue yellow...
How long can you do this? Well for 5 rounds until you run out of yellow, 20 draws (5 of each color). Now you have 5 red, 5 blue and 3 purple remaining. Pick one of each. We're up to 23 draws. On the 24th draw, you'll have to select one more red blue or purple, and that will be two more of the final color you choose than the yellow. So the answer is 24 moves.
About strategy in this case: Imagine physically doing the problem. Perhaps simplify: you could use two colors and smaller numbers, say 3 red and 1 blue. Then perhaps 3 colors. Playing with the problem for a while you can get a feel for what's happening.
