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.4-46

Exercise 1.2.4-46

not stated yet in Lean solution written

RatingM29
MarkersM (mathematical)
KindK3, find a value: compute a number, a set or a closed form from the written solution
SectionSection 1.2.4 of Volume 1. Companion chapter: Integer functions and elementary number theory

The task

Find a formula for ∑0≤j<αnf(⌊mj/n⌋)\sum_{0 \le j < \alpha n} f(\lfloor mj/n \rfloor) with an arbitrary real α>0\alpha > 0, extending Exercise 1.2.4-45.

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 range of jj is 0,…,N−10, \ldots, N - 1 with N=⌈αn⌉N = \lceil \alpha n \rceil. Repeat the counting of Exercise 1.2.4-45 for this range.

Hint 2

Let R=⌊mN/n⌋R = \lfloor mN/n \rfloor. Show that cr≤Nc_r \le N exactly for r≤Rr \le R, and count the jj that give the top value RR.

Solution

Show the solution

Let N=⌈αn⌉N = \lceil \alpha n \rceil, so that the integers jj with 0≤j<αn0 \le j < \alpha n are 0,…,N−10, \ldots, N-1. Let cr=⌈rn/m⌉c_r = \lceil rn/m \rceil as before, and R=⌊mN/n⌋R = \lfloor mN/n \rfloor.

Counting. For integers r≥0r \ge 0 and jj, ⌊mj/n⌋≥r  ⟺  j≥cr\lfloor mj/n \rfloor \ge r \iff j \ge c_r. The numbers crc_r increase with rr, and cr≤N  ⟺  rn/m≤N  ⟺  r≤mN/n  ⟺  r≤Rc_r \le N \iff rn/m \le N \iff r \le mN/n \iff r \le R.

The value rr with 0≤r<R0 \le r < R is taken for cr≤j<cr+1c_r \le j < c_{r+1}. Since cr+1≤cR≤Nc_{r+1} \le c_R \le N, all these jj are in range, and their number is cr+1−crc_{r+1} - c_r.

The value RR is taken for cR≤j<cR+1c_R \le j < c_{R+1}. Since R+1>mN/nR + 1 > mN/n, the next value satisfies cR+1>Nc_{R+1} > N, so the range is cut at NN. The number of jj with value RR is N−cR≥0N - c_R \ge 0.

Summation by parts. With c0=0c_0 = 0, ∑0≤j<αnf(⌊mj/n⌋)=∑r=0R−1f(r)(cr+1−cr)+f(R)(N−cR).\sum_{0 \le j < \alpha n} f(\lfloor mj/n \rfloor) = \sum_{r=0}^{R-1} f(r)(c_{r+1} - c_r) + f(R)(N - c_R). Shift the index in the part with cr+1c_{r+1}, as in Exercise 1.2.4-45: ∑r=0R−1f(r)cr+1=∑r=1Rf(r−1)cr.\sum_{r=0}^{R-1} f(r)c_{r+1} = \sum_{r=1}^{R} f(r-1)c_r. Collecting terms, with c0=0c_0 = 0 so that the term r=0r = 0 costs nothing, ∑0≤j<αnf(⌊mjn⌋)=∑0≤r≤R⌈rnm⌉(f(r−1)−f(r))+⌈αn⌉ f(R),R=⌊m⌈αn⌉n⌋.\sum_{0 \le j < \alpha n} f\Bigl(\Bigl\lfloor \frac{mj}{n} \Bigr\rfloor\Bigr) = \sum_{0 \le r \le R}\Bigl\lceil \frac{rn}{m} \Bigr\rceil\bigl(f(r-1) - f(r)\bigr) + \lceil \alpha n \rceil\, f(R), \qquad R = \Bigl\lfloor \frac{m\lceil \alpha n \rceil}{n} \Bigr\rfloor. Here f(−1)f(-1) may be any value, since it multiplies c0=0c_0 = 0.

Test of the case α=1\alpha = 1. Then N=nN = n and R=mR = m. The term r=mr = m is n(f(m−1)−f(m))n(f(m-1) - f(m)), and with +nf(m)+nf(m) it gives nf(m−1)nf(m-1). The formula becomes that of Exercise 1.2.4-45. □\square

Check

Take m=3m = 3, n=5n = 5, α=0.7\alpha = 0.7, f(r)=r2f(r) = r^2. Then αn=3.5\alpha n = 3.5, N=4N = 4, R=⌊12/5⌋=2R = \lfloor 12/5 \rfloor = 2. The values ⌊3j/5⌋\lfloor 3j/5 \rfloor for j=0,…,3j = 0, \ldots, 3 are 0,0,1,10, 0, 1, 1, with sum of squares 22. The formula gives c1(f(0)−f(1))+c2(f(1)−f(2))+4f(2)=2(−1)+4(−3)+16=2c_1(f(0) - f(1)) + c_2(f(1) - f(2)) + 4f(2) = 2(-1) + 4(-3) + 16 = 2. A run over 1≤m,n≤71 \le m, n \le 7 with α=i/4\alpha = i/4, 1≤i≤291 \le i \le 29 and random ff confirms the formula exactly.

Remarks

The formula is valid for every ff, so it contains one reciprocity law for each choice of ff. With f(r)=(r+1k)f(r) = \binom{r+1}{k} it gives a version of the binomial identity of Exercise 1.2.4-45 for a range of jj shorter or longer than nn. An equivalent form, the one the book gives, is ∑0≤r<αm⌈rn/m⌉(f(r−1)−f(r))+⌈αn⌉f(⌈αm⌉−1)\sum_{0 \le r < \alpha m}\lceil rn/m \rceil(f(r-1) - f(r)) + \lceil \alpha n \rceil f(\lceil \alpha m \rceil - 1). Here ⌈αm⌉−1≤R\lceil \alpha m \rceil - 1 \le R, and the two can differ (take m=n=1m = n = 1, α=1\alpha = 1). Every rr with αm≤r≤R\alpha m \le r \le R has αn≤rn/m≤N\alpha n \le rn/m \le N, so cr=Nc_r = N, and the extra terms of the first form telescope to Nf(⌈αm⌉−1)N f(\lceil \alpha m \rceil - 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.