I have one question on my Discrete Math homework that involves using generating functions, and I'm at a complete loss for how they work. The question asks:
"Use the generating function method to solve the following recurrent relations:
$ S_{n}= S_{n-1} + n$
$A_{0} = 0$ "
Any help would be appreciated!
Let generating function $g(x) = s_0 + s_1 x + s_2 x^2 + ... $ So $$-xg(x) = -s_0 x - s_1 x^2 -s_2x^3+ ... $$ Also $$-x\frac{1}{(1-x)^2} = -1x - 2x^2 - 3x^3 - ... $$ Now $$ g(x) - xg(x) - x\frac{1}{(1-x)^2} = s_0 + (s_1 - s_0 - 1)x + (s_2 - s_1 - 2)x^2 + ... + (s_{n+1} - s_n - (n + 1))x^{n+1} + ... $$ Here $s_0 = A_0 = 0$, and $s_{n + 1} = s_n + (n+1)$. Thereforwe, $$ g(x) - xg(x) - x\frac{1}{(1-x)^2} = 0$$ so $$g(x) = \frac{x}{(1-x)^3} = \sum_{k = 0}^{\infty}\frac{(k+2)(k+1)}{2}x^{k+1} = \sum_{k = 1}^{\infty}\frac{(k+1)k}{2}x^{k}$$ So $$S_k = s_k = \frac{(k+1)k}{2}$$ by equationg terms of $x_k$