TITLE: In how many different ways can I sort balls of two different colors
QUESTION [15 upvotes]: Let's say, I have 4 yellow and 5 blue balls. How do I calculate in how many different orders I  can place them? And what if I also have 3 red balls?

REPLY [3 votes]: For some reason I find it easier to think in terms of letters of a word being rearranged, and your problem is equivalent to asking how many permutations there are of the word YYYYBBBBB. 
The formula for counting permutations of words with repeated letters (whose reasoning has been described by Noldorin) gives us the correct answer of 9!/(4!5!) = 126.