High School Mathematics Extensions/Counting and Generating Functions/Solutions

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

Note: The best way to view these pages is to set your Math Preferences to "Always Render PNG".

Contents

[edit] Counting and Generating functions

At the moment, the main focus is on authoring the main content of each chapter. Therefore this exercise solutions section may be out of date and appear disorganised.

If you have a question please leave a comment in the "discussion section" or contact the author or any of the major contributors.


These solutions were not written by the author of the rest of the book. They are simply the answers I thought were correct while doing the exercises. I hope these answers are useful for someone and that people will correct my work if I made some mistakes.

[edit] Generating functions exercises

1.

(a)S = 1 - z + z2 - z3 + z4 - z5 + ...
zS = z - z2 + z3 - z4 + z5 - ...
(1 + z)S = 1
 S = \frac{1}{1+z}
(b)S = 1 + 2z + 4z2 + 8z3 + 16z4 + 32z5 + ...
2zS = 2z + 4z2 + 8z3 + 16z4 + 32z5 + ...
(1 - 2z)S = 1
 S = \frac{1}{1-2z}
(c)S = z + z2 + z3 + z4 + z5 + ...
zS = z2 + z3 + z4 + z5 + ...
(1 - z)S = z
 S = \frac{z}{1-z}
(d)S = 3 - 4z + 4z2 - 4z3 + 4z4 - 4z5 + ...
z(S + 1) = 4z - 4z2 + 4z3 - 4z4 + 4z5 - ...
S + z(S + 1) = 3
S + zS + z = 3
(1 + z)S = 3 - z
 S = \frac{3 - z}{1+z}

2.

(a) S = \frac{1}{1 + z}
 S = \frac{1}{1 - -z}
S = 1 - x + x2 - x3 + x4 - x5 + ...
f(n) = ( - 1)n
(b) S = \frac{z^3}{1 - z^2}
(1 - z2)S = z3
S = z3 + z5 + z7 + z9 + ...
 f(n) = 1 ; \mbox{for n} \ge 2 \mbox{ and even}
f(n) = 0;for n is odd

2c only contains the exercise and not the answer for the moment

(c)\frac{z^2 - 1}{1 + 3z^3}

[edit] Linear Recurrence Relations exercises

This section only contains the incomplete answers because I couldn't figure out where to go from here.

1.


\begin{matrix}
x_n &=& 2x_{n-1}& - &1; \ \mbox{for n} \ge 1\\
x_0 &=& 1
\end{matrix}

Let G(z) be the generating function of the sequence described above.

G(z) = x0 + x1z + x2z2 + ...
(1 - 2z)G(z) = x0 + (x1 - 2x0)z + (x2 - 2x1)z2 + ...
(1 - 2z)G(z) = 1 - z - z2 - z3 - z4 - ...
(1 - 2z)G(z) = 1 - z(1 + z + z2 + ...)
(1-2z)G(z) = 1-\frac{z}{1-z}
(1-2z)G(z) = \frac{1-2z}{1-z}
G(z) = \frac{1}{1-z}
xn = 1

2.


\begin{matrix}
3x_n &=& -4x_{n-1}& + & x_{n-2}; \ \mbox{for n} \ge 2 \\
x_0 &=& 1\\
x_1 &=& 1\\
\end{matrix}

Let G(z) be the generating function of the sequence described above.

G(z) = x0 + x1z + x2z2 + ...
(3 + 4z - z2)G(z) = 3x0 + (3x1 + 4x0)z + (3x2 + 4x1 - x0)z2 + (3x3 + 4x2 - x1)z3 + ...
(3 + 4z - z2)G(z) = 3x0 + (3x1 + 4x0)z
(3 + 4z - z2)G(z) = 3 + 7z
G(z) = \frac{3 + 7z}{-z^2+4z+3}

3. Let G(z) be the generating function of the sequence described above.

G(z) = x0 + x1z + x2z2 + ...
(1 - z - z2)G(z) = x0 + (x1 - x0)z + (x2 - x1 - x0)z2 + (x3 - x2 - x1)z2 + ...
(1 - z - z2)G(z) = 1
G(z) = \frac{1}{1-z-z^2}
G(z) = \frac{-1}{z^2+z-1}
We want to factorize f(z) = z2 + z - 1 into (z - α)(z - β) , by the converse of factor theorem, if (z - p) is a factor of f(z), f(p)=0.
Hence α and β are the roots of the quadratic equation z2 + z - 1 = 0
Using the quadratic formula to find the roots:
\alpha=\frac{\sqrt{5}-1}{2} , \beta=-\frac{\sqrt{5}+1}{2}
In fact, these two numbers are the faomus golden ratio and to make things simple, we use the greek symbols for golden ratio from now on.
Note:\frac{\sqrt{5}-1}{2} is denoted φ and \frac{\sqrt{5}+1}{2} is denoted Φ
G(z) = \frac{-1}{(z-\phi)(z+\Phi)}
By the method of partial fraction:
G(z) = \frac{1}{\sqrt{5}(z+\Phi)} - \frac{1}{\sqrt{5}(z-\phi)}
G(z) = \frac{1}{\Phi\sqrt{5}(\frac{z}{\Phi}+1)} - \frac{1}{\phi\sqrt{5}(\frac{z}{\phi}-1)}
G(z) = \frac{1}{\Phi\sqrt{5}(1- -\phi z)} + \frac{1}{\phi\sqrt{5}(1-\Phi z)}
x_n = \frac{\phi}{\sqrt{5}} \times (-\phi)^n + \frac{\Phi}{\sqrt{5}} \times \Phi^n
x_n = \frac{\Phi^{n+1} - (-\phi)^{n+1}}{\sqrt{5}}

[edit] Further Counting exercises

1. We know that

T(z) = \frac{1}{(1 - z)^2} = \sum_{i=0}^\infty {i+1 \choose i}z^i = \sum_{i=0}^\infty (i+1)z^i

therefore

T(z) = \frac{1}{(1 + z)^2} = \sum_{i=0}^\infty (i+1)(-1)^iz^i
Thus
Tk = ( - 1)k(k + 1)

2. a + b + c = m

T(z) = \frac{1}{(1 - z)^3} = \sum_{i=0}^\infty {i+2 \choose i}z^i
Thus
T_k = {i+2 \choose i}

[edit] *Differentiate from first principle* exercises

1.

f'(z) = \lim_{h \to 0}\frac{1} {(1 - (z + h))^2}-\frac{1} {(1 - z)^2} =
\lim_{h \to 0}\frac{1}{h}\frac{(1 - z)^2-(1 - (z + h))^2} {(1 - z - h)^2(1 - z)^2} =
\lim_{h \to 0}\frac{1}{h}\frac{z^2-2z+1-(z + h)^2+2(z+h)-1} {(1 - z - h)^2(1 - z)^2} =
\lim_{h \to 0}\frac{1}{h}\frac{z^2-2z+1-z^2-h^2-2zh+2z+2h-1} {(1 - z - h)^2(1 - z)^2} =
\lim_{h \to 0}\frac{1}{h}\frac{-h^2-2zh+2h} {(1 - z - h)^2(1 - z)^2} =
\lim_{h \to 0}\frac{-h-2z+2} {(1 - z - h)^2(1 - z)^2} =
\frac{-2z+2} {(1 - z)^4} =
\frac{-2} {(1 - z)^3}