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

Exercise 1.2.3-14

proved in Lean solution written

Rating11
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

Evaluate ∑j=mn∑k=rsjk\sum_{j=m}^n \sum_{k=r}^s jk for integers m≤nm \le n and r≤sr \le s.

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

The factor jj does not depend on kk. Pull it out of the inner sum, then use the result of Exercise 1.2.3-13 twice.

Solution

Show the solution

For fixed jj, the inner sum is ∑k=rsjk=j∑k=rsk\sum_{k=r}^s jk = j \sum_{k=r}^s k by the distributive law. The sum ∑k=rsk\sum_{k=r}^s k does not depend on jj, so it comes out of the outer sum too: ∑j=mn∑k=rsjk=(∑j=mnj)(∑k=rsk).\sum_{j=m}^n \sum_{k=r}^s jk = \Bigl(\sum_{j=m}^n j\Bigr)\Bigl(\sum_{k=r}^s k\Bigr). By Exercise 1.2.3-13 the two factors are 12(n(n+1)−m(m−1))\frac12(n(n+1) - m(m-1)) and 12(s(s+1)−r(r−1))\frac12(s(s+1) - r(r-1)), so ∑j=mn∑k=rsjk=14(n(n+1)−m(m−1))(s(s+1)−r(r−1)).\sum_{j=m}^n \sum_{k=r}^s jk = \tfrac14\bigl(n(n+1) - m(m-1)\bigr)\bigl(s(s+1) - r(r-1)\bigr).

Check

For m=2m = 2, n=4n = 4, r=1r = 1, s=3s = 3: the sum of jj is 99 and the sum of kk is 66, and the double sum is 5454. The formula gives 14(20−2)(12−0)=14⋅18⋅12=54\frac14 (20 - 2)(12 - 0) = \frac14 \cdot 18 \cdot 12 = 54.

Remarks

This is rule (a) in its simplest use. The same method gives ∑j,kf(j)g(k)=(∑f)(∑g)\sum_{j,k} f(j) g(k) = (\sum f)(\sum g) for any two finite ranges.

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.