Help to write the generating function

82 Views Asked by At

How do I write the generating function and the closed for form the generating function

The sequence is 0 0 0 1 1 1 1 1 1

Is this correct? $$A(x) = 0+0x+0x^2+1x^3+1x^4+1x^5+1x^6+1x^7+1x^8$$ This is the generating function, what about the closed form?

2

There are 2 best solutions below

4
On

$$A(x)=x^3+...+x^8=x^3(1+...+x^5)=x^3\frac{1-x^6}{1-x}=\frac{x^3-x^9}{1-x}$$

5
On

Note that:

$$\frac{1}{1-x} = 1 + x + x^2 +x^3 + ... + x^n$$

And that:

$$x^3*\left(\frac{1}{1-x}\right) = x^3(1 + x + x^2 +x^3 + ... + x^n) = x^3 + x^4 + x^5 +\dots$$

$$x^3 + x^4 + x^5 + \dots +x^8 = x^3(1+ x +x^2 +\dots + x^5)$$ However, since we are only interested in the first $6$ terms (Until $x^5$), we can subtract all the other terms by doing a simple substitution:

Since it starts at $x^9$:

$$x^9*\left(\frac{1}{1-x}\right) = x^9 + x^{10} + x^{11} + \dots + x^n$$

Therefore

$$A = x^3 + x^4 + x^5 + \dots + x^8 = x^3(1 + x + x^2 + \dots + x^5) \\= x^3*\left(\frac{1}{1-x} - \frac{x^6}{1-x}\right) = \frac{x^3(1-x^6)}{1-x} = \frac{x^3 - x^9}{1-x}$$