taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.9-1

Exercise 1.2.9-1

proved in Lean solution written

RatingM12
MarkersM (mathematical)
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.9 of Volume 1. Companion chapter: Generating functions

The task

Find a closed rational form for the series ∑n≥0(2n+3n)zn\sum_{n\ge0}(2^n+3^n)z^n.

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Split the sequence into two geometric sequences and use the series for 1/(1−cz)1/(1-cz).

Hint 2

Add the two fractions over a common denominator.

Solution

Show the solution

The series of 2n2^n is ∑n2nzn=1/(1−2z)\sum_n 2^nz^n = 1/(1-2z), and the series of 3n3^n is 1/(1−3z)1/(1-3z). The generating function of a sum of two sequences is the sum of the two generating functions, so

G(z)=11−2z+11−3z=(1−3z)+(1−2z)(1−2z)(1−3z)=2−5z(1−2z)(1−3z).G(z)=\frac1{1-2z}+\frac1{1-3z}=\frac{(1-3z)+(1-2z)}{(1-2z)(1-3z)}=\frac{2-5z}{(1-2z)(1-3z)}.

The denominator expands as 1−5z+6z21-5z+6z^2.

Check

Multiply 2+5z+13z2+35z3+⋯2+5z+13z^2+35z^3+\cdots by 1−5z+6z21-5z+6z^2. The coefficient of z0z^0 is 22. The coefficient of z1z^1 is 5−10=−55-10=-5. For n≥2n\ge2 the coefficient of znz^n is an−5an−1+6an−2a_n-5a_{n-1}+6a_{n-2} with an=2n+3na_n=2^n+3^n. For n=2n=2 this is 13−25+12=013-25+12=0, and for n=3n=3 it is 35−65+30=035-65+30=0. So the product is 2−5z2-5z.

Remarks

Any sequence that satisfies a linear recurrence with constant coefficients has a rational generating function. Here the recurrence is an=5an−1−6an−2a_n=5a_{n-1}-6a_{n-2}, read off from the denominator. The same idea gives the Fibonacci series in Section 1.2.8.

This solution is drafted, and a person has not reviewed it yet. The source.

In Lean

proved The statement and its proof are in Lean. The kernel accepts the proof, and it uses the standard axioms only.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.