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.3-16

Exercise 1.2.3-16

proved in Lean solution written

RatingM22
MarkersM (mathematical)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.3 of Volume 1. Companion chapter: Sums and products

The task

Prove the closed form of ∑j=0njxj\sum_{j=0}^n jx^j for x≠1x \ne 1 by manipulation of the sum, with no induction.

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 at the derivation of Eq. (14). It compares a sum with the same sum multiplied by xx, after a shift of the index.

Hint 2

Call the sum SS. Write xSxS with the index shifted by one so that the powers of xx in xSxS and in SS have the same exponent jj.

Hint 3

In S−xSS - xS the coefficient of xjx^j is j−(j−1)=1j - (j - 1) = 1. A geometric sum is left, plus one border term.

Solution

Show the solution

Let n≥0n \ge 0, x≠1x \ne 1 and S=∑0≤j≤njxjS = \sum_{0 \le j \le n} jx^j. The term j=0j = 0 is zero, and the term j=n+1j = n + 1 can be added and taken away, so S=∑1≤j≤n+1jxj−(n+1)xn+1.S = \sum_{1 \le j \le n+1} jx^j - (n+1)x^{n+1}. By rule (a) and rule (b) with j→j−1j \to j - 1, xS=∑0≤j≤njxj+1=∑1≤j≤n+1(j−1)xj.xS = \sum_{0 \le j \le n} jx^{j+1} = \sum_{1 \le j \le n+1} (j-1)x^j. Subtract, using Eq. (8) to combine the sums over the same range: S−xS=∑1≤j≤n+1(j−(j−1))xj−(n+1)xn+1=∑1≤j≤n+1xj−(n+1)xn+1.S - xS = \sum_{1 \le j \le n+1} \bigl(j - (j-1)\bigr)x^j - (n+1)x^{n+1} = \sum_{1 \le j \le n+1} x^j - (n+1)x^{n+1}. By Eq. (14) with the first term xx and the ratio xx, ∑1≤j≤n+1xj=x1−xn+11−x\sum_{1 \le j \le n+1} x^j = x \dfrac{1 - x^{n+1}}{1 - x}. Therefore (1−x)S=x(1−xn+1)1−x−(n+1)xn+1.(1 - x)S = \frac{x(1 - x^{n+1})}{1 - x} - (n+1)x^{n+1}. Divide by 1−x1 - x and bring to the common denominator (1−x)2=(x−1)2(1-x)^2 = (x-1)^2: S=x−xn+2−(n+1)xn+1(1−x)(x−1)2=x−xn+2−(n+1)xn+1+(n+1)xn+2(x−1)2=nxn+2−(n+1)xn+1+x(x−1)2.□S = \frac{x - x^{n+2} - (n+1)x^{n+1}(1 - x)}{(x-1)^2} = \frac{x - x^{n+2} - (n+1)x^{n+1} + (n+1)x^{n+2}}{(x-1)^2} = \frac{n x^{n+2} - (n+1)x^{n+1} + x}{(x-1)^2}. \qquad \square

Check

For x=3x = 3 and n=4n = 4: the sum is 0+3+18+81+324=4260 + 3 + 18 + 81 + 324 = 426. The formula gives (4⋅729−5⋅243+3)/4=(2916−1215+3)/4=1704/4=426(4 \cdot 729 - 5 \cdot 243 + 3)/4 = (2916 - 1215 + 3)/4 = 1704/4 = 426. For n=0n = 0 the formula gives (0−x+x)/(x−1)2=0(0 - x + x)/(x-1)^2 = 0, the value of the one term 0⋅x00 \cdot x^0.

Remarks

Exercise 1.2.3-15 is the case x=2x = 2, and Exercise 1.2.3-20 uses this formula. The same shift-and-subtract method sums j2xjj^2x^j, by applying it twice.

This solution is checked, 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.