Background
I am a software engineer and I have been picking up combinatorics as I go along. I am going through a combinatorics book for self study and this chapter is absolutely destroying me. Sadly, I confess it makes little sense to me. I don't care if I look stupid, I want to understand how to solve these problems.
I am studying counting with repetition. That is, generalized binomial coefficients and generating functions.
Problem
Suppose that an unlimited amount of jelly beans is available in each of the five different colors: red, green, yellow, white, and black.
- How many ways are there to select from twenty jelly beans?
- How many ways are there to select twenty jelly beans if we must select at least two jelly beans of each color?
Attempted Solution
How many ways are there to select from twenty jelly beans?
$5^{20}$
How many ways are there to select twenty jelly beans if we must select at least two jelly beans of each color?
I keep thinking of applying the hypergeometric distribution here, but I think this is dead wrong. The entire chapter is on series, so I am confused as to what these series are and why they are being applied to solve these problems? The above solutions (some I am too embarrassed to share) didn't pass the smell test at all :(
My interpretation is that you want to calculate variations like 5 red, 6 yellow, 9 black.
Then for the first problem, you typically select 4 barriers to place between 20 beans.
Before the first barrier, are the red beans, .. after the last barrier the black ones. The barriers take a position, so we have $24 \choose 4$
A barrier on the first position means you have no red beans.
The second problem would be a small variation, just remove the 10 required colored beans and repeat previous calculation with the remaining 10, so we have $14 \choose 4$