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

Exercise 1.2.3-19

proved in Lean solution written

Rating20
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.3 of Volume 1. Companion chapter: Sums and products

The task

Find ∑j=mn(aj−aj−1)\sum_{j=m}^n (a_j - a_{j-1}) in closed form, for any integers mm and nn.

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 sum with Eq. (8) and shift the index in the second part.

Hint 2

Treat m≤nm \le n first. Then look at m>nm > n, where the sum is empty. A bracket [m≤n][m \le n] can join the two cases.

Solution

Show the solution

The case m≤nm \le n. By Eq. (8), ∑m≤j≤n(aj−aj−1)=∑m≤j≤naj−∑m≤j≤naj−1.\sum_{m \le j \le n} (a_j - a_{j-1}) = \sum_{m \le j \le n} a_j - \sum_{m \le j \le n} a_{j-1}. In the second sum put j→j+1j \to j + 1 (rule (b)): ∑m≤j≤naj−1=∑m−1≤j≤n−1aj\sum_{m \le j \le n} a_{j-1} = \sum_{m-1 \le j \le n-1} a_j. Split off the last term of the first sum and the first term of the second sum (rule (d)): ∑m≤j≤naj=an+∑m≤j≤n−1aj,∑m−1≤j≤n−1aj=am−1+∑m≤j≤n−1aj.\sum_{m \le j \le n} a_j = a_n + \sum_{m \le j \le n-1} a_j, \qquad \sum_{m-1 \le j \le n-1} a_j = a_{m-1} + \sum_{m \le j \le n-1} a_j. Both splits need m≤nm \le n, so that the term is distinct from the common part. The common sum cancels, and the result is an−am−1a_n - a_{m-1}.

The case m>nm > n. The set of jj with m≤j≤nm \le j \le n is empty, so the sum is 00.

One formula. With the bracket of Eq. (16), ∑j=mn(aj−aj−1)=(an−am−1) [m≤n].\sum_{j=m}^n (a_j - a_{j-1}) = (a_n - a_{m-1})\,[m \le n]. For m=n+1m = n + 1 the factor an−am−1a_n - a_{m-1} is already 00, and for m≥n+2m \ge n + 2 the bracket is needed.

Check

For aj=j2a_j = j^2, m=3m = 3, n=6n = 6: the terms aj−aj−1=2j−1a_j - a_{j-1} = 2j - 1 are 5,7,9,115, 7, 9, 11, with the sum 3232, and a6−a2=36−4=32a_6 - a_2 = 36 - 4 = 32. For m=5m = 5, n=3n = 3 the sum is empty, and the bracket [5≤3][5 \le 3] is 00.

Remarks

This is the telescoping sum. Its product analog gives Exercise 1.2.3-28.

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.