Stars and Bars
Lesson · Intermediate
Combinatorics
71.1
are positive integers.

There are
ways to place two dividers between 20 stars.
71.2
71.3
Transform the variables as follows:
Then
so the number of solutions is
71.4
Consider the possible values of :
71.5
Total:
Unfavorable:
Set
Then
and the number of unfavorable solutions is
Therefore,

There are stars and bars. Each answer of 's corresponds to a permutation of stars and bars.
Find the number of nonnegative integer solutions to
such that
Without restrictions,
Now define the bad conditions
For , set
giving
so
For ,
giving
so
But solutions satisfying both conditions were subtracted twice.
Set
Then
so
By inclusion-exclusion, the answer is
How many positive integer solutions to
have all four variables odd?
Write
where
Then
so
Therefore, the number of solutions is