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-14

Exercise 1.2.8-14

not stated yet in Lean solution written

RatingM28
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

Solve a0=0a_0 = 0, a1=1a_1 = 1, an+2=an+1+an+(nm)a_{n+2} = a_{n+1} + a_n + \binom nm for a fixed integer m≥1m \ge 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

Look for one particular solution as a combination of (nm),(nm−1),…,(n0)\binom n{m}, \binom n{m-1}, \ldots, \binom n0 with Fibonacci numbers as coefficients.

Hint 2

Use (n+1i)=(ni)+(ni−1)\binom{n+1}{i} = \binom ni + \binom n{i-1} to expand pn+2−pn+1−pnp_{n+2} - p_{n+1} - p_n, and match coefficients. The coefficients are −Fj+1-F_{j+1}.

Hint 3

Add a solution of the homogeneous rule to match the start values, and simplify with eq. (6).

Solution

Show the solution

Write ci(n)=(ni)c_i(n) = \binom ni for n≥0n \ge 0, with ci(n)=0c_i(n) = 0 for i<0i < 0. By Pascal's rule ci(n+1)=ci(n)+ci−1(n)c_i(n+1) = c_i(n) + c_{i-1}(n), so ci(n+2)=ci(n)+2ci−1(n)+ci−2(n)c_i(n+2) = c_i(n) + 2c_{i-1}(n) + c_{i-2}(n). Then

ci(n+2)−ci(n+1)−ci(n)=−ci(n)+ci−1(n)+ci−2(n).c_i(n+2) - c_i(n+1) - c_i(n) = -c_i(n) + c_{i-1}(n) + c_{i-2}(n).

A particular solution. Let pn=−∑j=0mFj+1 cm−j(n)p_n = -\sum_{j=0}^{m} F_{j+1}\, c_{m-j}(n). Apply the operator Lpn=pn+2−pn+1−pnL p_n = p_{n+2} - p_{n+1} - p_n term by term. The coefficient of cm−j(n)c_{m-j}(n) in LpnLp_n is the sum of three contributions: from the term jj itself, Fj+1F_{j+1} (the two minus signs cancel); from the term j−1j - 1, whose index m−(j−1)−1=m−jm - (j-1) - 1 = m - j gives −Fj-F_j; and from the term j−2j - 2, which gives −Fj−1-F_{j-1}. So the coefficient is

Fj+1−Fj−Fj−1=0(j≥2),F2−F1=0(j=1),F1=1(j=0).F_{j+1} - F_j - F_{j-1} = 0 \quad (j \ge 2), \qquad F_2 - F_1 = 0 \quad (j = 1), \qquad F_1 = 1 \quad (j = 0).

Hence Lpn=cm(n)=(nm)Lp_n = c_m(n) = \binom nm, and pnp_n solves the full rule.

The start values. Since m≥1m \ge 1: p0=−Fm+1p_0 = -F_{m+1} (only j=mj = m has (00)=1\binom 0 0 = 1), and p1=−(Fm+1+Fm)=−Fm+2p_1 = -(F_{m+1} + F_m) = -F_{m+2} (the terms j=mj = m and j=m−1j = m-1). The difference hn=an−pnh_n = a_n - p_n solves the Fibonacci rule with h0=Fm+1h_0 = F_{m+1} and h1=1+Fm+2h_1 = 1 + F_{m+2}. By Exercise 1.2.8-13(a),

hn=Fm+1Fn−1+(1+Fm+2)Fn=Fn+m+1+Fn.h_n = F_{m+1}F_{n-1} + (1 + F_{m+2})F_n = F_{n+m+1} + F_n.

The last step is eq. (6): F(n−1)+(m+2)=Fm+2Fn+Fm+1Fn−1F_{(n-1)+(m+2)} = F_{m+2}F_n + F_{m+1}F_{n-1}. The formula also holds at n=0n = 0.

Answer:

an=Fn+m+1+Fn−∑j=0mFj+1(nm−j).a_n = F_{n+m+1} + F_n - \sum_{j=0}^{m} F_{j+1}\binom n{m-j}.

Check

For m=1m = 1 the rule gives an=0,1,1,3,6,12,22,39a_n = 0, 1, 1, 3, 6, 12, 22, 39. The formula at n=5n = 5 gives F7+F5−(F1(51)+F2(50))=13+5−(5+1)=12F_7 + F_5 - (F_1\binom51 + F_2\binom50) = 13 + 5 - (5 + 1) = 12. For m=2m = 2 the rule gives 0,1,1,2,4,9,19,380, 1, 1, 2, 4, 9, 19, 38, and at n=6n = 6 the formula gives F9+F6−((62)+(61)+2(60))=34+8−(15+6+2)=19F_9 + F_6 - (\binom62 + \binom61 + 2\binom60) = 34 + 8 - (15 + 6 + 2) = 19.

Remarks

The case m=0m = 0 gives an=Fn+2−1a_n = F_{n+2} - 1 (here (n0)=1\binom n0 = 1), in agreement with Exercise 1.2.8-13(b) for c=1c = 1. The method is the operator method for linear recurrences: the shift E=1+ΔE = 1 + \Delta turns the Fibonacci rule into Δ2+Δ−1\Delta^2 + \Delta - 1, and 1/(1−Δ−Δ2)=∑Fj+1Δj1/(1 - \Delta - \Delta^2) = \sum F_{j+1}\Delta^j is the generating function of the numbers Fj+1F_{j+1}.

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.