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.8-12

Exercise 1.2.8-12

not stated yet in Lean solution written

RatingM26
MarkersM (mathematical)
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.8 of Volume 1. Companion chapter: Fibonacci numbers

The task

Find a closed form of the second-order Fibonacci numbers ℱn\mathcal F_n, which satisfy ℱn+2=ℱn+1+ℱn+Fn\mathcal F_{n+2} = \mathcal F_{n+1} + \mathcal F_n + F_n, in terms of FnF_n and Fn+1F_{n+1}.

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

Put 𝒢(z)=∑nℱnzn\mathcal G(z) = \sum_n \mathcal F_n z^n and multiply the rule by zn+2z^{n+2}. Compare with G(z)=z/(1−z−z2)G(z) = z/(1 - z - z^2).

Hint 2

You will find (1−z−z2)𝒢(z)=z+z2G(z)(1 - z - z^2)\mathcal G(z) = z + z^2 G(z). Since z2/(1−z−z2)=zG(z)z^2/(1-z-z^2) = zG(z), this gives 𝒢(z)=G(z)+zG(z)2\mathcal G(z) = G(z) + zG(z)^2. Use eq. (17) for the coefficients of G(z)2G(z)^2.

Hint 3

The result has the form (an+b)Fn+(cn+d)Fn+1(an + b)F_n + (cn + d)F_{n+1} with rational a,b,c,da, b, c, d. After you have it, check by induction that it satisfies the recurrence.

Solution

Show the solution

Let 𝒢(z)=∑n≥0ℱnzn\mathcal G(z) = \sum_{n \ge 0} \mathcal F_n z^n. Multiply the rule by zn+2z^{n+2} and sum over n≥0n \ge 0:

∑n≥0ℱn+2zn+2=∑n≥0ℱn+1zn+2+∑n≥0ℱnzn+2+z2∑n≥0Fnzn.\sum_{n \ge 0}\mathcal F_{n+2}z^{n+2} = \sum_{n\ge0}\mathcal F_{n+1}z^{n+2} + \sum_{n\ge0}\mathcal F_n z^{n+2} + z^2\sum_{n\ge0}F_nz^n.

The left side is 𝒢(z)−z\mathcal G(z) - z, because ℱ0=0\mathcal F_0 = 0 and ℱ1=1\mathcal F_1 = 1. The first sum on the right is z𝒢(z)z\mathcal G(z), and the second is z2𝒢(z)z^2\mathcal G(z). So

(1−z−z2)𝒢(z)=z+z2G(z),𝒢(z)=G(z)+z21−z−z2G(z)=G(z)+zG(z)2,(1 - z - z^2)\mathcal G(z) = z + z^2G(z), \qquad \mathcal G(z) = G(z) + \frac{z^2}{1 - z - z^2}G(z) = G(z) + zG(z)^2,

because G(z)=z/(1−z−z2)G(z) = z/(1 - z - z^2) gives z2/(1−z−z2)=zG(z)z^2/(1-z-z^2) = zG(z).

The coefficient of znz^n in zG(z)2zG(z)^2 is the coefficient of zn−1z^{n-1} in G(z)2G(z)^2. Eq. 1.2.8(17) gives it as ∑k=0n−1FkFn−1−k=15((n−2)Fn−1+2(n−1)Fn−2)\sum_{k=0}^{n-1}F_kF_{n-1-k} = \frac15\bigl((n-2)F_{n-1} + 2(n-1)F_{n-2}\bigr) for n≥1n \ge 1. So

ℱn=Fn+15(n−2)Fn−1+25(n−1)Fn−2.\mathcal F_n = F_n + \tfrac15(n-2)F_{n-1} + \tfrac25(n-1)F_{n-2}.

Now write Fn−1=Fn+1−FnF_{n-1} = F_{n+1} - F_n and Fn−2=Fn−Fn−1=2Fn−Fn+1F_{n-2} = F_n - F_{n-1} = 2F_n - F_{n+1}. Then

5ℱn=5Fn+(n−2)(Fn+1−Fn)+2(n−1)(2Fn−Fn+1)=(3n+3)Fn−nFn+1.5\mathcal F_n = 5F_n + (n-2)(F_{n+1} - F_n) + 2(n-1)(2F_n - F_{n+1}) = (3n+3)F_n - nF_{n+1}.

Hence

ℱn=(3n+3)Fn−nFn+15.\mathcal F_n = \frac{(3n+3)F_n - nF_{n+1}}{5}.

Direct check by induction. Let unu_n be the right side. Then u0=0u_0 = 0 and u1=(6−1)/5=1u_1 = (6 - 1)/5 = 1. Put Fn+2=Fn+Fn+1F_{n+2} = F_n + F_{n+1} and Fn+3=Fn+2Fn+1F_{n+3} = F_n + 2F_{n+1} in 5(un+2−un+1−un)5(u_{n+2} - u_{n+1} - u_n), which equals

(3n+9)Fn+2−(n+2)Fn+3−(3n+6)Fn+1+(n+1)Fn+2−(3n+3)Fn+nFn+1.(3n+9)F_{n+2} - (n+2)F_{n+3} - (3n+6)F_{n+1} + (n+1)F_{n+2} - (3n+3)F_n + nF_{n+1}.

The coefficient of FnF_n is (3n+9)−(n+2)+(n+1)−(3n+3)=5(3n+9) - (n+2) + (n+1) - (3n+3) = 5. The coefficient of Fn+1F_{n+1} is (3n+9)−2(n+2)−(3n+6)+(n+1)+n=0(3n+9) - 2(n+2) - (3n+6) + (n+1) + n = 0. So un+2−un+1−un=Fnu_{n+2} - u_{n+1} - u_n = F_n, which is the rule of ℱn\mathcal F_n. With the start values this gives un=ℱnu_n = \mathcal F_n for all n≥0n \ge 0.

Check

The rule gives ℱ0,…,ℱ7=0,1,1,3,5,10,18,33\mathcal F_0, \ldots, \mathcal F_7 = 0, 1, 1, 3, 5, 10, 18, 33. The formula gives 5ℱn=(3n+3)Fn−nFn+1=0,5,5,15,25,50,90,1655\mathcal F_n = (3n+3)F_n - nF_{n+1} = 0, 5, 5, 15, 25, 50, 90, 165 for n=0,…,7n = 0, \ldots, 7, which are five times the list. For example, n=7n = 7: 24⋅13−7⋅21=312−147=165=5⋅3324 \cdot 13 - 7 \cdot 21 = 312 - 147 = 165 = 5 \cdot 33.

Remarks

The forcing term FnF_n is itself a solution of the homogeneous rule, so the particular solution has the factor nn (a resonance). Exercise 1.2.8-13 treats a constant term, and Exercise 1.2.8-14 a binomial term. See the C1 chapter on Section 1.2.8 for the generating function G(z)G(z).

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

In Lean

not stated yet The exercise is not stated in Lean yet.

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

Something is wrong? Report it.