*Originally posted by sonhouse*

**Where does the 32 come in? There are 33 pills and the regimen disposes of them at the last day, yes it is decreasing. I didn't know there could be THAT many solutions! Why are they factorials? why aren't they just summation kind of things?
**

Can you give specific examples of what works? I know what I worked out but would be interested in other possibilitie ...[text shortened]... ay one step with X pills next step even down, even down, etc. Does that constrain the solutions?

I'll try,

for starters lets say you had 7 pills to take in 3 days.

1+1+1+1+1+1+1 = 7 ( you should notice there are 7 1's, and 6 +'s in the sequence )

If you randomly pick 2 of the plus signs, and remove the rest ( I'll pick plus sign 2 and 5 for instance, removing 1,3,4,6) you get a sequence that looks like

1...1+1...1...1+1...1 = 7

That breaks the sum into 3 smaller summands, grouped it would look like this.

(1...1)+(1...1...1)+(1...1) = 7, where what is inside the parenthesis are the sums

(2)+(3)+(2) = 7, meaning that if you were to take 7 pills over 3 days, one way to do it would be:

Day1: 2 pills

Day2: 3 pills

Day3: 2 pills

But this is only one way, what if I had selected plus sign's 1 & 2 as the ones to keep, then:

1+1+1...1...1...1...1 = 7

(1)+(1)+(1...1...1...1...1) = 7

(1)+(1)+(5) = 7

Day1: 1pills

Day2: 1 pills

Day3: 5 pills

In total the number of ways of selecting 2 plus signs out of 6 ( with no distinction between any plus signs) is given by:

C(n,r) = n!/(r!(n-r)!)

So for our example:

n = 6 ( then number of +'s in the sequence, which is one less than the number of pills in our case)

r = 2 ( the number of summands you wish to have minus one)

So, C(6,2) = 6!/(2!(6-2)!) = 6*5*4!/(2*4!) = 6*5/2 = 15

That is to say there are 15 distinct ways you can take 7 pills over 3 days.

From here its just arithmetic to extend the idea to 33 pills over 7 days!

And to answer your question,yes, every constraint you make weeds out some of the solutions, it gets more complicated to determine because every constraint limits the ways you can pick the +'s in the sequence, thus making the denominator of our equation larger, and the number of possible solutions smaller.