I need n cakes for a party. I

protestommb

protestommb

Answered question

2022-06-24

I need n cakes for a party. I go to the cake shop and there are k different kinds of cake. For variety, I'd like to get at least one of each cake. How many ways can I do this?

Answer & Explanation

Marlee Guerra

Marlee Guerra

Beginner2022-06-25Added 25 answers

Similar to the stars and bars technique, consider the n cakes as a row of n stars *. Instead of permuting them with k 1 bars | (which allows two bars next to each other, giving 0 of a type, place the k 1 bars (needed to split the n stars into k types) into the n 1 spaces between the stars, allowing at most one bar per space. The number of ways to do this is ( n 1 k 1 ) .
Alternately, since you need one of each type, there are only n k cakes for which you are choosing types. Using the stars and bars technique, there are ( ( n k ) + k 1 k 1 ) = ( n 1 k 1 ) ways to do it.

Do you have a similar question?

Recalculate according to your conditions!

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?