Find the closed form for the generating fuction

113 Views Asked by At

I am given $g_0 = g_1 = \frac{1}{2}$ and $g_n + (n+1)g_{n+1} = \frac{1}{n!}$ where $n\geq2$.

I need to find the closed form for the generating function $g(z)$ and the closed form for $g_n$.

I'm not sure how to do this.

I multiplied both sides of the recurrence by $z^n$ and summed over all $n\geq0$. I know $\sum_{n\geq0}(n+1)g_{n+1}z^n= Dg(z)$ and $\sum_{n\geq0}\frac{z^n}{n!} = e^z$. Which gives the equation $$g(z) + Dg(z) = e^z$$ Do I treat this as a first order differential equation?

Any help will be much appreciated.

1

There are 1 best solutions below

0
On

Notice that $$n! g_n + (n+1)! g_{n+1} = 1,$$ which suggests letting $h_n = n! g_n$ and solving $$h_n + h_{n+1} = 1 \quad \text{for $n\ge 1$}$$ with initial conditions $h_0=0!g_0=1/2$ and $h_1=1!g_1=1/2$. Let $H(z)=\sum_{n=0}^\infty h_n z^n$ be the generating function for $h_n$. The recurrence relation implies that $$\sum_{n \ge 1} h_n z^n + \sum_{n \ge 1} h_{n+1} z^n = \sum_{n \ge 1} z^n.$$ Equivalently, $$H(z) - h_0 + \frac{1}{z} (H(z) - h_0 - h_1 z) = \frac{z}{1-z},$$ which implies that $$H(z) = \frac{1/2}{1-z} = \sum_{n=0}^\infty \frac{1}{2} z^n,$$ so $h_n = 1/2$ for $n \ge 0$. (You could also have deduced this directly from the recurrence $h_{n+1}=1-h_n$ and initial condition $h_0=1/2$, without using a generating function.) Hence $$g_n = \frac{h_n}{n!} = \frac{1/2}{n!}$$ for $n \ge 0$.