Expansion of polynomial to power of N creates 1001 terms. Find N For some particular value of $N$, when $(a+b+c+d+1)^N$ is expanded and like terms are combined, the resulting expression contains exactly $1001$ terms that include all four variables $a, b,c,$ and $d$, each to some positive power. What is $N$?
The solution includes a use of stars and bars (which I generally understand), but how they manipulated the problem to make stars and bars applicable here confuses me.

Every unlike term in the expansion of $(a+b+c+d+1)^N$, ignoring the coefficient, can be formed by placing four bars among $N$ stars and interpreting the number of stars in each bin as the exponent of a variable: $a,b,c,d$ or $1$ (the last one indicating no variable). For example, with $N=12$:
$$a|bb|cccc|d|1111=a^1b^2c^4d^11^4$$
Since the question is about terms with all four variables $abcd$ we may set one of each aside and instead place four bars among $N-4$ stars:
$$abcd\quad |b|ccc||1111$$
1001 such terms exist, so we are looking for $N$ with
$$\binom{N-4+4}4=\binom N4=1001$$
and solving we find that $N=14$.
