MHB John's Cupcake Challenge: Finding the Perfect Distribution

Click For Summary
John has 31 cupcakes to distribute among 5 students, requiring each to receive an odd number. A brute-force approach is inefficient, prompting a discussion on the stars and bars combinatorial method. By initially adding 5 cupcakes to ensure each student receives at least one, the problem transforms into distributing 36 cupcakes into 5 portions. The solution involves calculating the combinations of placing 4 dividers among 17 spaces, leading to the formula 17 choose 4. This method provides a more efficient way to determine the number of distributions.
Monoxdifly
MHB
Messages
288
Reaction score
0
John has baked 31 cupcakes for 5 different students. He wants to give them all to his students but he wants to give an odd number of cupcakes to each one. How many ways can he do this?

Brute-forcing will take about a whole day, I think. If 4 students receive 1 cupcake and the other one receive 27, that's already 4 combinations. If there are 3 1's, the other two might be 3 and 25, 5, and 23, 7 and 21, etc. Is there more efficient way?
 
Mathematics news on Phys.org
Hey Mr. Fly,

It's a variation of the stars and bars problem.
See the linked article how it works.

In this particular case we can add 5 cakes first for a total of 36.
Next we divide them in 18 stacks of 2 cakes each.
If we put 4 dividers (bars) in between them, we get 5 portions. We give them to each of the 5 students.
Oh, and before we do so, we take away 1 cake from each portion, so that each student gets an odd number.

How many ways to divide 4 bars over the 17 spaces between the stacks?
 
klaas van aarsen said:
how many ways to divide 4 bars over the 17 spaces between the stacks?

17c4?
 
Monoxdifly said:
17c4?

Yep. (Nod)
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
3K
  • · Replies 15 ·
Replies
15
Views
6K
  • · Replies 68 ·
3
Replies
68
Views
11K
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 125 ·
5
Replies
125
Views
19K
  • · Replies 93 ·
4
Replies
93
Views
15K
Replies
9
Views
5K
  • · Replies 60 ·
3
Replies
60
Views
12K