How to compute combinations with repetitions (stars and bars)?
I am studying combinatorics and I understand the basic combinations formula for choosing items from distinct items without repetition.
But I am confused about combinations with repetition (also called multisets). The formula is:
where is the number of types and is the number of items chosen.
Can someone explain:
- Why the formula is using the stars and bars analogy?
- How to apply it to: "How many ways to buy 10 donuts if there are 5 flavors available?"
- What about the equation with ? How many non-negative integer solutions?
- What changes if (positive solutions)?
1 answers609 views
Stars and bars finally makes sense! The donut analogy is perfect.