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.8-35

Exercise 1.2.8-35

not stated yet in Lean solution written

RatingM24
MarkersM (mathematical)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.8 of Volume 1. Companion chapter: Fibonacci numbers

The task

Show that the number 11 has infinitely many representations with the digits 00 and 11 in base ϕ\phi, but that every nonnegative real number has exactly one representation without adjacent ones that does not end in 0101…0101\ldots. Find the representations of the 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

Use ϕk=ϕk−1+ϕk−2\phi^k = \phi^{k-1} + \phi^{k-2} to move a digit pattern 100100 to 011011.

Hint 2

Bound the value of a digit string without adjacent ones, by the geometric series 1+ϕ−2+ϕ−4+⋯1 + \phi^{-2} + \phi^{-4} + \cdots.

Hint 3

The bound shows that the leading digit of the unique representation is the greedy one. Use it again for the rest. For the integers use the existence part of Exercise 1.2.8-42.

Solution

Show the solution

Write a representation as a set KK of integers, with x=∑k∈Kϕkx = \sum_{k \in K}\phi^k, where KK has a largest element. A representation is sparse if no two elements of KK are adjacent, and admissible if it is sparse and KK does not end in the infinite tail …,j+4,j+2,j\ldots,j+4,j+2,j (the digits 0101…0101\ldots).

Many representations of 11. From ϕ−1+ϕ−2=(ϕ−1)+(2−ϕ)=1\phi^{-1} + \phi^{-2} = (\phi - 1) + (2 - \phi) = 1 it follows that 1=(.11)ϕ1 = (.11)_\phi. The rule ϕk=ϕk−1+ϕk−2\phi^k = \phi^{k-1} + \phi^{k-2} replaces a digit 11 at place kk by two digits at places k−1k - 1 and k−2k - 2. Apply it to the last digit again and again: (.11)=(.1011)=(.101011)=⋯(.11) = (.1011) = (.101011) = \cdots, an infinite list of different finite representations. Also ∑j≥2ϕ−j=ϕ−2/(1−ϕ−1)=1\sum_{j \ge 2}\phi^{-j} = \phi^{-2}/(1 - \phi^{-1}) = 1, because 1−ϕ−1=ϕ−21 - \phi^{-1} = \phi^{-2}. So (.0111…)ϕ=1(.0111\ldots)_\phi = 1 too.

Upper bound. If KK is sparse and all its elements are at most jj, then ∑k∈Kϕk≤ϕj+1\sum_{k \in K}\phi^k \le \phi^{j+1}, with equality only if K={j,j−2,j−4,…}K = \{j, j-2, j-4, \ldots\}. Proof: list KK as p1>p2>⋯p_1 > p_2 > \cdots. Then pi≤j−2(i−1)p_i \le j - 2(i-1), so the sum is at most ∑i≥1ϕj−2(i−1)=ϕj/(1−ϕ−2)=ϕj+1\sum_{i \ge 1}\phi^{j-2(i-1)} = \phi^j/(1 - \phi^{-2}) = \phi^{j+1}, because 1−ϕ−2=ϕ−11 - \phi^{-2} = \phi^{-1}. Equality needs pi=j−2(i−1)p_i = j - 2(i-1) for all ii. For an admissible KK the equality never holds for any jj, since the set {j,j−2,…}\{j, j-2, \ldots\} is an alternating tail. So for admissible KK and any jj, the part of KK below or at jj has value <ϕj+1< \phi^{j+1}.

Existence and uniqueness for x>0x > 0. Let kk be the integer with ϕk≤x<ϕk+1\phi^k \le x < \phi^{k+1}. If KK is an admissible representation of xx with largest element tt, then ϕt≤x\phi^t \le x and, by the upper bound, x<ϕt+1x < \phi^{t+1}. So t=kt = k is forced. The rest K∖{k}K\setminus\{k\} is admissible, has elements at most k−2k - 2, and represents x−ϕkx - \phi^k. This proves uniqueness by induction: the same argument fixes the next element, and so on. If x−ϕk=0x - \phi^k = 0 the list stops, and otherwise it goes on forever with elements that decrease by at least 22 each time.

For existence, define the list by the greedy rule: x0=xx_0 = x, kik_i is the integer with ϕki≤xi−1<ϕki+1\phi^{k_i} \le x_{i-1} < \phi^{k_i+1}, and xi=xi−1−ϕkix_i = x_{i-1} - \phi^{k_i}. Then 0≤xi<ϕki+1−ϕki=ϕki−10 \le x_i < \phi^{k_i+1} - \phi^{k_i} = \phi^{k_i-1}, so ki+1≤ki−2k_{i+1} \le k_i - 2 and the list is sparse. If it is infinite, then xi<ϕki−1→0x_i < \phi^{k_i-1} \to 0, so the sum is xx. The list is not ending in an alternating tail: such a tail starting at place j=ki+1j = k_{i+1} would give xi=ϕj+1x_i = \phi^{j+1} by the upper bound, but the greedy choice has xi<ϕki+1+1x_i < \phi^{k_{i+1}+1}. For x=0x = 0 the empty list is the only representation, since a nonempty one has a positive value.

Integers. For an integer N≥1N \ge 1 let KK be a finite sparse set with ∑k∈Kϕk=N\sum_{k \in K}\phi^k = N. Since ϕk=Fkϕ+Fk−1\phi^k = F_k\phi + F_{k-1} and ϕ\phi is irrational, this holds if and only if ∑Fk=0\sum F_{k} = 0 and ∑Fk−1=N\sum F_{k-1} = N over KK. With j=k−1j = k - 1 this says ∑Fj=N\sum F_j = N and ∑Fj+1=0\sum F_{j+1} = 0. By the existence part of Exercise 1.2.8-42 (its proof does not use this exercise) there is such a set KK for every NN. It is finite and sparse, so it is admissible, and by uniqueness it is the representation of NN. So the integers have finite representations. The greedy rule gives them, for example 2=ϕ+ϕ−22 = \phi + \phi^{-2} and 3=ϕ2+ϕ−23 = \phi^2 + \phi^{-2}. The table lists the places of the digits 11 and the digit string.

NN places of the digits 1 (…)ϕ(\ldots)_\phi
1 00 1.1.
2 1,−21, -2 10.0110.01
3 2,−22, -2 100.01100.01
4 2,0,−22, 0, -2 101.01101.01
5 3,−1,−43, -1, -4 1000.10011000.1001
6 3,1,−43, 1, -4 1010.00011010.0001
7 4,−44, -4 10000.000110000.0001
8 4,0,−44, 0, -4 10001.000110001.0001
9 4,1,−2,−44, 1, -2, -4 10010.010110010.0101
10 4,2,−2,−44, 2, -2, -4 10100.010110100.0101
11 4,2,0,−2,−44, 2, 0, -2, -4 10101.010110101.0101
12 5,−1,−3,−65, -1, -3, -6 100000.101001100000.101001

Check

Numeric check with python: ϕ−1+ϕ−3+ϕ−4=1.0000\phi^{-1} + \phi^{-3} + \phi^{-4} = 1.0000 for (.1011)ϕ(.1011)_\phi, and ∑j=279ϕ−j=1.0000\sum_{j=2}^{79}\phi^{-j} = 1.0000. For the table: ϕ+ϕ−2=2\phi + \phi^{-2} = 2, ϕ2+ϕ−2=3\phi^2 + \phi^{-2} = 3, and the greedy runs in exact arithmetic over ℤ[ϕ]\mathbb Z[\phi] give the rows of the table, each sum equal to NN. The pairs (∑Fj,∑Fj+1)(\sum F_j, \sum F_{j+1}) for N=2N = 2 with j=k−1∈{0,−3}j = k - 1 \in \{0, -3\} are F0+F−3=2F_0 + F_{-3} = 2 and F1+F−2=0F_1 + F_{-2} = 0.

Remarks

The fact that the integers have finite representations is the special case m=Nm = N, n=0n = 0 of Exercise 1.2.8-42.

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.