[Math] A store is selling 5 types of hard candies. How many ways are there to chose

discrete mathematics

The choices are lemon, cherry, strawberry, orange, and pineapple.

How many ways are there to chose $35$ candies? I thought it would be $35^5$ because there are $35$ choices with $5$ options but that is not correct.

Next, how many ways can you get at least one of each flavor?

Then, how many ways can you get at least $2$ cherry and at least $4$ lemon?

Best Answer

You have 35 candies to choose. Let's say you have four "bars"; they separate the types of candies from each other. e.g.:

-------|-------|-------|-------|-------

Means 7 candies of each. The answer is 39C4 because this is only a rearrangement problem.

The second one, assume that each has one candies. Then it's just 30 candies to choose and 4 bars again.

Same for the last one; you choose 35-2-4=29 candies with 4 bars.

If you want to learn more, search "sticks and bars". It's a powerful method.