Generating function

96 Views Asked by At

Let f(n,m) the number of der path from (0,0) to (n,m) $\in \mathbb{N}^2$ wich consists the steps (0,1), (1,0) and (1,1)and set f(0,0) to 1. Let $a_i = \sum_{n+m=i}f(n,m), i\geq 0$

i) Show that: $$\sum_{i\geq0}a_it^i = \frac{1}{1-2t-t^2} $$ how can i find a recursion for $a_i$

ii) Specify a formula which can calculate explicitly $a_i$

$a_i+2-2a_i+1-a_i=0$

$\Rightarrow d=2,\alpha_1=-2,\alpha_2=-1$

$\Rightarrow Q(t)= 1-2t-t^2$

P(t): $(1-2t-t^2)\sum \limits_n a_nt^n = P(t), deg(P)\leq2=d$

$(1-2t-t^2)(a_0t^0+a_1t^1)=A+Bt$

$(1-2t-t^2)(1+2t)=A+Bt$

$1-2t-\underbrace{t^2}_0+2t-\underbrace{4t^2-2t^3}_0=A+Bt$

$\Rightarrow P(t)=1$

$\Rightarrow \sum \limits_n a_nt^n=\sum \limits_{i\geq0}(\sum \limits_{n+m=i} f(n,m)t^i)$\ $=\frac{1}{1-2t-t^2}$

is this right?

1

There are 1 best solutions below

4
On

In order to reach $\langle n,m\rangle$, where $m,n>0$, you must first reach $\langle n-1,m\rangle$, $\langle n,m-1\rangle$, or $\langle n-1,m-1\rangle$. This immediately gives you a recurrence for $f(n,m)$ in terms of $f(n-1,m)$, $f(n,m-1)$, and $f(n-1,m-1)$ when $n,m>0$:

$$f(n,m)=f(n-1,m)+f(n,m-1)+f(n-1,m-1)\tag{1}$$

You already know that $f(0,0)=1$, so all that remains is to work out $f(n,0)$ and $f(0,m)$ for $n,m>0$. This makes it easy to gather some data:

$$\begin{array}{c|cc} &0&1&2&3&4\\ \hline 0&1&1&1&1&1\\ 1&1&3&\color{blue}5&\color{blue}7&9\\ 2&1&5&\color{blue}{13}&\color{red}{25}&41\\ 3&1&7&25&63&129\\ 4&1&9&41&129&321 \end{array}$$

From this little table we can see that $a_0=1,a_1=2,a_2=5,a_3=12,a_4=29$, and $a_5=70$. More important, we can see how $a_n$ is related to $a_k$ for $k<n$. First, each number not an the left or top edge is the sum of the number to its left, the number above it, and the number diagonally above and to the left of it. For instance, the red $25$ is the sum of the three blue numbers.

When we form the (underline) numbers that are added to get $a_4$, for instance, the red ones in the table below are sums of the blue, the green, and the brown numbers. Each blue number is used twice, once contributing to the number to its right and once contributing to the number below it. Each green number is used just once, contributing to the number diagonally down and to the right. And each of the brown numbers is used once, one of them for the number below it, the other for the number to its right.

$$\begin{array}{c|cc} &0&1&2&3&4\\ \hline 0&1&1&\color{green}1&\color{brown}1&\underline 1\\ 1&1&\color{green}3&\color{blue}5&\color{red}{\underline 7}&9\\ 2&\color{green}1&\color{blue}5&\color{red}{\underline{13}}&25&41\\ 3&\color{brown}1&\color{red}{\underline7}&25&63&129\\ 4&\underline1&9&41&129&321 \end{array}$$

No matter which of the diagonals we look at, we’ll see a similar pattern: the numbers on that diagonal that are not the $1$s on the ends of it are formed by adding the numbers in the two previous diagonals, except that each number on the immediately preceding diagonal that is not one of the $1$s on the ends is used twice:

$$\color{red}{\text{red}}=2\cdot\color{blue}{\text{blue}}+\color{brown}{\text{brown}}+\color{green}{\text{green}}\;.$$

Finally, the underlined black $1$s at the ends of the $a_4$ diagonal can be combined with the brown $\color{brown}1$s at the ends of the $a_3$ diagonal, effectively doubling them:

$$2\cdot\color{blue}{\text{blue}}+\color{brown}{\text{brown}}+2=2a_3\qquad\text{ and }\qquad\color{green}{\text{green}}=a_2\;,$$

so

$$a_4=\color{red}{\text{red}}+2=2\cdot\color{blue}{\text{blue}}+\color{brown}{\text{brown}}+2+\color{green}{\text{green}}=2a_3+a_2\;.$$

From these ideas you should be able to work out and prove a recurrence for the numbers $a_n$. You can of course get the same results by working directly with the recurrence $(1)$ for $f$ and the definition

$$a_n=\sum_{k=0}^nf(k,n-k)\;,$$

but if you’re a visual thinker, the more pictorial approach to the problem may be easier to work with.

Getting a closed form for $a_n$ from the generating function is straightforward, once you have the right generating function: it should be

$$f(t)=\frac1{1-2t-t^2}\;.$$

  • Decompose it into partial fractions.
  • Write each of the partial fractions as a power series.
  • Combine the two power series into a single power series, and read off the coefficient of $t^n$.