I want to count in how many ways three dice can sum to a given number without brute forcing it. In fact, I would like to do it using generating functions and without having to expand out the product.
To do this, I have thought of making a differential equation out of $y=(x+x^2+x^3+x^4+x^5+x^6)^3$ and then solving the equation through the use of power series, or getting the $n$th taylor coefficient from the equation.
What I attempted was:
$$y=(x+x^2+x^3+x^4+x^5+x^6)^3$$
$$y'=3y^{2/3}(1+2x+3x^2+4x^3+5x^4+6x^5)$$
Then, by setting $x=0$ we see $y(0)=0$ and $y'(0)=0$, which is what I want, however, when trying to obtain $y''(0)$ by differentiating both sides, I get division by $0$ on the RHS.
Am I making a mistake in the set up or is calculating the expression through the use of a differenrial equation impossible?
2026-04-03 02:36:46.1775183806
Counting the number of ways three dice can sum to $n$
91 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
Here is an alternate approach. We could at first transform $y(x)$ so that an expansion after that becomes less cumbersome. Maybe this variant is also useful for your needs.
It is convenient to use the coefficient of operator $[x^n]$ to denote the coefficient of $x^n$ of a series. We also use Iverson brackets \begin{align*} [[P(x)]]=\begin{cases} 1&\qquad P(x) \ \text{ true}\\ 0&\qquad P(x) \ \text{ false} \end{cases} \end{align*} This way we can treat multiple cases in one expression.
Comment:
In (1) we apply the coefficient of rule \begin{align*} [x^p]x^qA(x)=[x^{p-q}]A(x) \end{align*} and we use the formula for the finite geometric series. Since there is no contribution to the coefficient of $x^n$ if $n<3$ we respect this by using $[[n\geq 3]]$.
In (2) we expand the binomial and we also expand $\frac{1}{(1-x)^3}$ using the binomial series expansion.
In (3) we use the linearity of the coefficient of operator and we use the binomial identity \begin{align*} \binom{-p}{q}=\binom{p+q-1}{q}(-1)^q=\binom{p+q-1}{p-1}(-1)^q \end{align*}
In (4) we select the coefficient of $x^{n-k}, k\in\{3,9,15,21\}$.
Note: The usage of the Iverson brackets covers the general case. If we need to calculate a specific case only, the calculation becomes even more straight forward.