# Coloring Red and Blue Problem

We color the integers from 1 to 999 with red and blue, so that each integer is assigned one of the two colors. How many different colorings can we construct with the property that there are more red integers within the numbers {1,...,500} than within the numbers {501,...999}

• Please edit your question to show what you have attempted. For instance, have you solved the problem of determining how many ways we can color the integers from $1$ to $9$ in such a way that there are more red integers within the set $\{1, 2, 3, 4, 5\}$ than there are in the set $\{6, 7, 8, 9\}$? – N. F. Taussig Dec 2 '18 at 18:06
• Hint: Can you see that the number of colorings with more reds among $\{1,\dots,500\}$ than reds among $\{501,\dots,599\}$ is the same as the number of colorings with more reds among $\{1,\dots,500\}$ than blues among $\{501,\dots,599\}$? – bof Dec 3 '18 at 11:16
• Hint: Can you see that the condition "more reds among $\{1,\dots,500\}$ than blues among $\{501,\dots,599\}$" is equivalent to "more reds than blues overall"? – bof Dec 3 '18 at 11:18
• How many ways can you color the integers from $1$ to $999$ with red and blue, so that there are more reds than blues? – bof Dec 3 '18 at 11:19

First you can chose how many red numbers there will be in $$\{1,..,500\}$$
Suppose you chose to color $$k$$ red numbers in that set. ($$k$$ can take any value from 0 to 500)
In the $$\{501,..,999\}$$ set, you can color from $$0$$ to $$k-1$$ numbers in red (k possibilities)
Thus if we iterate over every possible value for $$k$$ you have $$\sum_{k=0}^{500}k^2$$ distinct possiblilites
We can generalize for a set of length $$n$$: {$$1,..,n$$} and {$$n+1,.., 2n-1$$}
There are a total of $$\sum_{k=0}^nk^2=\frac{n(n+1)(2n+1)}{6}$$ possiblilites
• This answer doesn't take into account the process of actually choosing $k$ numbers from 1 to 500, and similar for the other set. – platty Dec 3 '18 at 10:42