QUESTION: During a period of 7 days, Charles eats a total of 25 donuts. A donut schedule is a sequence of 7 numbers, whose sum is equal to 25, and whose numbers indicate the number of donuts that Charles eats on each day. Three examples of such schedules are (3; 2; 7; 4; 1; 3; 5), (2; 3; 7; 4; 1; 3; 5), and (3; 0; 9; 4; 1; 0; 8). How many donut schedules are there? Answer: 31C6
ATTEMPT: I realized that this is a combination with repetition problem. I used the formula (r+n-1)! / r! * (n-1)! where r is the number of slots and n is the number of options. I used 7 as the number of slots and 25 as the number of options to get my answer to be 31C7. Don't know what I have missed accounting here.
Imagine you have $25$ donuts line up, then you want to make cuts to the line of donuts to divide the donuts into $7$ parts. You need $6$ cuts to divide a line into $7$ parts. So imagine $25+6$ position on a line where you can either place a cut or a donuts, you have to choose 6 out of the 31 positions to place the cuts. So that is $\binom{25+6}{6}$ ways to do it. Is this correct?
So here is an example of how to relate a sequence of donuts and cuts to a schedule: Here I'll use D to denote donuts and c to denote cut.
ccdddddddddddddddddddddddddcccc correspond to $(0,0,25,0,0,0,0)$.
cddccddddddddddddddddddddddcdcc correspond to $(0,2,0,22,1,0,0)$.
So you see you are choosing 6 position to put cuts in 31 position and the rest to put donuts. 6 cuts because 6 cuts divide a line into 7 parts.