0

This question is related to Stars and Bars with bounds

I have what I thought is a fairly simple problem: Count non-negative integer solutions to the equation

$$x_1 + x_2 + x_3 + x_4 + x_5 = 23$$

such that $0 \leq x_1 \leq 9$.

The accepted answer uses nCr such that order does not matter. But if order does matter can the function be replaced from \begin{align*} [x^j](1+x)^n=\binom{n}{j} \end{align*} to then be

\begin{align*} [x^j](1+x)^n=n^j \end{align*}

N. F. Taussig
  • 76,571

1 Answers1

0

My confusion was with why the "Choose" function was used rather than the "Permute" function when order matters. According to @user by the nature of the stars and bars and by extension, generating function it takes the order of the bins into account despite using the choose function as a basis.

This offers the best example for how this happens: https://youtu.be/zjtxJSkjejc?t=308

  • 1
    As already pointed out in another comment the "Choose" function was used only as example to demonstrate what is the action of the coefficient extractor. It is absolutely hopeless trying to modify a method without its understanding. – user Feb 14 '21 at 00:19