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

Exercise 1.2.3-17

proved in Lean solution written

RatingM00
MarkersM (mathematical), recommended
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

Say what ∑j∈S1\sum_{j \in S} 1 is for a set SS of integers.

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

Each term is 11. Count the terms.

Solution

Show the solution

If SS is finite with kk elements, the sum has kk terms, each equal to 11, so it is 1+1+⋯+1=k1 + 1 + \cdots + 1 = k. This is the number of elements of SS, written ∣S∣|S|. For the empty set the sum is 00.

If SS is infinite, the partial sums over the windows 0≤j≤q0 \le j \le q or −p≤j<0-p \le j < 0 are the numbers of elements of SS in the window, and at least one of these numbers grows without bound. The sum is then divergent in the sense of Eq. (3), and it has no value.

Check

For S={2,3,5,7}S = \{2, 3, 5, 7\} the sum is 44. For S={j:1≤j≤n}S = \{j : 1 \le j \le n\} the sum is nn, as in the remark after Eq. (1). For S={j:0≤j2≤10}S = \{j : 0 \le j^2 \le 10\} (the integers −3,…,3-3, \ldots, 3) the sum is 77.

Remarks

This is the reason why ∑1≤j≤n1=n\sum_{1 \le j \le n} 1 = n for n≥0n \ge 0, and why the sum ∑0≤j≤n(2a+bn)\sum_{0 \le j \le n} (2a + bn) in Example 4 of the text is (n+1)(2a+bn)(n+1)(2a + bn).

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.