Page 1
Continued Logarithm Algorithm.A probabilistic study
Pablo RotondoIRIF, Paris 7 Diderot,
Universidad de la Republica, Uruguay
GREYC, associate
Work with
Brigitte Vallee and Alfredo Viola
1331 =
2−1
1 +2−2
1 +2−1
1 +20
1 +2−1
1
Seminaire ALGO, Caen, 20 Februrary, 2018.
Page 2
Table of Contents
Introduction
The CL Dynamical system
Extended system and results
Conclusions and extensions
Page 3
The origins
In Hakmem Gosper writes
“There is a mutation of continued fractions, which I call continuedlogarithms, which have several advantages over regular continuedfractions, especially for computational hardware.
(. . .) The primary advantage is the conveniently small information parcel.
(. . .) the continued logarithm of Avogadro’s number begins with itsbinary order of magnitude, and only then begins the descriptionequivalent to the leading digits – a sort of recursive version of scientificnotation.”
The continued logarithm algorithm computes the odd gcd and
I involves quotients that are powers of 2.
I seems simple and efficient.
I let us see an example!
Page 4
The origins
In Hakmem Gosper writes
“There is a mutation of continued fractions, which I call continuedlogarithms, which have several advantages over regular continuedfractions, especially for computational hardware.
(. . .) The primary advantage is the conveniently small information parcel.
(. . .) the continued logarithm of Avogadro’s number begins with itsbinary order of magnitude, and only then begins the descriptionequivalent to the leading digits – a sort of recursive version of scientificnotation.”
The continued logarithm algorithm computes the odd gcd and
I involves quotients that are powers of 2.
I seems simple and efficient.
I let us see an example!
Page 5
The origins
In Hakmem Gosper writes
“There is a mutation of continued fractions, which I call continuedlogarithms, which have several advantages over regular continuedfractions, especially for computational hardware.
(. . .) The primary advantage is the conveniently small information parcel.
(. . .) the continued logarithm of Avogadro’s number begins with itsbinary order of magnitude, and only then begins the descriptionequivalent to the leading digits – a sort of recursive version of scientificnotation.”
The continued logarithm algorithm computes the odd gcd and
I involves quotients that are powers of 2.
I seems simple and efficient.
I let us see an example!
Page 6
The origins
In Hakmem Gosper writes
“There is a mutation of continued fractions, which I call continuedlogarithms, which have several advantages over regular continuedfractions, especially for computational hardware.
(. . .) The primary advantage is the conveniently small information parcel.
(. . .) the continued logarithm of Avogadro’s number begins with itsbinary order of magnitude, and only then begins the descriptionequivalent to the leading digits – a sort of recursive version of scientificnotation.”
The continued logarithm algorithm computes the odd gcd and
I involves quotients that are powers of 2.
I seems simple and efficient.
I let us see an example!
Page 7
Continued Logarithm Algorithm?
A binary “division”:q = 2ap+ r ,
how to choose a = a(p, q)? ⇒ greedily!
Example. Let us find gcd(31, 13). Whiteboard!
a q p 2ap r
1 31 13 26 52 26 5 20 61 20 6 12 80 12 8 8 41 8 4 8 0
Remarks.
I Powers of two pop up everywhere!
I We ended up with (8, 0), what is the gcd? ⇒ odd gcd = 1.
Page 8
Continued Logarithm Algorithm?
A binary “division”:q = 2ap+ r ,
how to choose a = a(p, q)?
⇒ greedily!
Example. Let us find gcd(31, 13). Whiteboard!
a q p 2ap r
1 31 13 26 52 26 5 20 61 20 6 12 80 12 8 8 41 8 4 8 0
Remarks.
I Powers of two pop up everywhere!
I We ended up with (8, 0), what is the gcd? ⇒ odd gcd = 1.
Page 9
Continued Logarithm Algorithm?
A binary “division”:q = 2ap+ r ,
how to choose a = a(p, q)? ⇒ greedily!
Example. Let us find gcd(31, 13). Whiteboard!
a q p 2ap r
1 31 13 26 52 26 5 20 61 20 6 12 80 12 8 8 41 8 4 8 0
Remarks.
I Powers of two pop up everywhere!
I We ended up with (8, 0), what is the gcd? ⇒ odd gcd = 1.
Page 10
Continued Logarithm Algorithm?
A binary “division”:q = 2ap+ r ,
how to choose a = a(p, q)? ⇒ greedily!
Example. Let us find gcd(31, 13).
Whiteboard!
a q p 2ap r
1 31 13 26 52 26 5 20 61 20 6 12 80 12 8 8 41 8 4 8 0
Remarks.
I Powers of two pop up everywhere!
I We ended up with (8, 0), what is the gcd? ⇒ odd gcd = 1.
Page 11
Continued Logarithm Algorithm?
A binary “division”:q = 2ap+ r ,
how to choose a = a(p, q)? ⇒ greedily!
Example. Let us find gcd(31, 13). Whiteboard!
a q p 2ap r
1 31 13 26 52 26 5 20 61 20 6 12 80 12 8 8 41 8 4 8 0
Remarks.
I Powers of two pop up everywhere!
I We ended up with (8, 0), what is the gcd? ⇒ odd gcd = 1.
Page 12
Continued Logarithm Algorithm?
A binary “division”:q = 2ap+ r ,
how to choose a = a(p, q)? ⇒ greedily!
Example. Let us find gcd(31, 13). Whiteboard!
a q p 2ap r
1 31 13 26 52 26 5 20 61 20 6 12 80 12 8 8 41 8 4 8 0
Remarks.
I Powers of two pop up everywhere!
I We ended up with (8, 0), what is the gcd? ⇒ odd gcd = 1.
Page 13
Continued Logarithm Algorithm?
A binary “division”:q = 2ap+ r ,
how to choose a = a(p, q)? ⇒ greedily!
Example. Let us find gcd(31, 13). Whiteboard!
a q p 2ap r
1 31 13 26 52 26 5 20 61 20 6 12 80 12 8 8 41 8 4 8 0
Remarks.
I Powers of two pop up everywhere!
I We ended up with (8, 0), what is the gcd? ⇒ odd gcd = 1.
Page 14
Worst-case studied by Shallit (2016): consider (1, 2n − 1).
Response. We have at most O(log q) steps, like Euclid.No apparent gains in length ⇒ maybe on average?
Shallit then proposed the average case as an open problem.We considered his question...
the problem turned out to be interesting.
We provide an answer to his question,
Average number of steps K and shifts S satisfy
EN [K] ∼ k logN , EN [S] ∼ log 3−log 22 log 2−log 3 EN [K]
for an explicit constant k.= 1.49283 . . . given by
k =2
H, H = 1
log(4/3)
(π2
6 + 2Li2(−1/2)− (log 2) log 27log 16
)=⇒ proof turns out to be a bit unexpected.
Page 15
Worst-case studied by Shallit (2016): consider (1, 2n − 1).
Response. We have at most O(log q) steps, like Euclid.
No apparent gains in length ⇒ maybe on average?
Shallit then proposed the average case as an open problem.We considered his question...
the problem turned out to be interesting.
We provide an answer to his question,
Average number of steps K and shifts S satisfy
EN [K] ∼ k logN , EN [S] ∼ log 3−log 22 log 2−log 3 EN [K]
for an explicit constant k.= 1.49283 . . . given by
k =2
H, H = 1
log(4/3)
(π2
6 + 2Li2(−1/2)− (log 2) log 27log 16
)=⇒ proof turns out to be a bit unexpected.
Page 16
Worst-case studied by Shallit (2016): consider (1, 2n − 1).
Response. We have at most O(log q) steps, like Euclid.No apparent gains in length
⇒ maybe on average?
Shallit then proposed the average case as an open problem.We considered his question...
the problem turned out to be interesting.
We provide an answer to his question,
Average number of steps K and shifts S satisfy
EN [K] ∼ k logN , EN [S] ∼ log 3−log 22 log 2−log 3 EN [K]
for an explicit constant k.= 1.49283 . . . given by
k =2
H, H = 1
log(4/3)
(π2
6 + 2Li2(−1/2)− (log 2) log 27log 16
)=⇒ proof turns out to be a bit unexpected.
Page 17
Worst-case studied by Shallit (2016): consider (1, 2n − 1).
Response. We have at most O(log q) steps, like Euclid.No apparent gains in length ⇒ maybe on average?
Shallit then proposed the average case as an open problem.We considered his question...
the problem turned out to be interesting.
We provide an answer to his question,
Average number of steps K and shifts S satisfy
EN [K] ∼ k logN , EN [S] ∼ log 3−log 22 log 2−log 3 EN [K]
for an explicit constant k.= 1.49283 . . . given by
k =2
H, H = 1
log(4/3)
(π2
6 + 2Li2(−1/2)− (log 2) log 27log 16
)=⇒ proof turns out to be a bit unexpected.
Page 18
Worst-case studied by Shallit (2016): consider (1, 2n − 1).
Response. We have at most O(log q) steps, like Euclid.No apparent gains in length ⇒ maybe on average?
Shallit then proposed the average case as an open problem.We considered his question...
the problem turned out to be interesting.
We provide an answer to his question,
Average number of steps K and shifts S satisfy
EN [K] ∼ k logN , EN [S] ∼ log 3−log 22 log 2−log 3 EN [K]
for an explicit constant k.= 1.49283 . . . given by
k =2
H, H = 1
log(4/3)
(π2
6 + 2Li2(−1/2)− (log 2) log 27log 16
)=⇒ proof turns out to be a bit unexpected.
Page 19
Worst-case studied by Shallit (2016): consider (1, 2n − 1).
Response. We have at most O(log q) steps, like Euclid.No apparent gains in length ⇒ maybe on average?
Shallit then proposed the average case as an open problem.We considered his question...
the problem turned out to be interesting.
We provide an answer to his question,
Average number of steps K and shifts S satisfy
EN [K] ∼ k logN , EN [S] ∼ log 3−log 22 log 2−log 3 EN [K]
for an explicit constant k.= 1.49283 . . . given by
k =2
H, H = 1
log(4/3)
(π2
6 + 2Li2(−1/2)− (log 2) log 27log 16
)
=⇒ proof turns out to be a bit unexpected.
Page 20
Worst-case studied by Shallit (2016): consider (1, 2n − 1).
Response. We have at most O(log q) steps, like Euclid.No apparent gains in length ⇒ maybe on average?
Shallit then proposed the average case as an open problem.We considered his question...
the problem turned out to be interesting.
We provide an answer to his question,
Average number of steps K and shifts S satisfy
EN [K] ∼ k logN , EN [S] ∼ log 3−log 22 log 2−log 3 EN [K]
for an explicit constant k.= 1.49283 . . . given by
k =2
H, H = 1
log(4/3)
(π2
6 + 2Li2(−1/2)− (log 2) log 27log 16
)=⇒ proof turns out to be a bit unexpected.
Page 21
Procedure summarized in
(p, q) 7→ (p′, q′) = (q − 2ap, 2ap) ,
where a is chosen greedily.
Note.
I The map p/q 7→ p′/q′ can be extended to I = (0, 1)
T : I → I , T (x) =2−a
x− 1 ,
where a is chosen greedily! a = blog2(1/x)c.I Algorithm gives rise to a continued fraction
p
q=
2−a
1 + p′
q′
.
Page 22
Procedure summarized in
(p, q) 7→ (p′, q′) = (q − 2ap, 2ap) ,
where a is chosen greedily.
Note.
I The map p/q 7→ p′/q′ can be extended to I = (0, 1)
T : I → I , T (x) =2−a
x− 1 ,
where a is chosen greedily!
a = blog2(1/x)c.I Algorithm gives rise to a continued fraction
p
q=
2−a
1 + p′
q′
.
Page 23
Procedure summarized in
(p, q) 7→ (p′, q′) = (q − 2ap, 2ap) ,
where a is chosen greedily.
Note.
I The map p/q 7→ p′/q′ can be extended to I = (0, 1)
T : I → I , T (x) =2−a
x− 1 ,
where a is chosen greedily! a = blog2(1/x)c.I Algorithm gives rise to a continued fraction
p
q=
2−a
1 + p′
q′
.
Page 24
Procedure summarized in
(p, q) 7→ (p′, q′) = (q − 2ap, 2ap) ,
where a is chosen greedily.
Note.
I The map p/q 7→ p′/q′ can be extended to I = (0, 1)
T : I → I , T (x) =2−a
x− 1 ,
where a is chosen greedily! a = blog2(1/x)c.I Algorithm gives rise to a continued fraction
p
q=
2−a
1 + p′
q′
.
Page 25
Dynamical system (I, T )
1x
1
T(x)
The map T : I → I
Branches
For x ∈ Ia := [2−a−1, 2−a]
x 7→ T (x) :=2−a
x− 1 .
where a(x) := blog2(1/x)c .
Inverse branches
ha(x) :=2−a
1 + x, H := ha : a ∈ N ,
and at depth k
Hk := ha1 · · · hak : a1, . . . , ak ∈ N .
Page 26
Density transformerQuestion: If g ∈ C0(I) were the density of x =⇒ density of T (x)?
1x
1
T(x)
|dh0(y)||dh1(y)||dh2(y)||dh3(y)|
dy
Answer: The density is
H[g](x) =∑h∈H
∣∣h′(x)∣∣ g (h(x))=
1
(1 + x)2
∑a≥0
2−a g
(2−a
1 + x
).
In general T k(x) has density
Hk[g](x) =∑h∈Hk
∣∣h′(x)∣∣ g (h(x)) .=⇒ Transfer operator Hs extends H, introducing a variable s
Hs[g](x) =∑h∈H
∣∣h′(x)∣∣s g (h(x)) .
Page 27
Density transformerQuestion: If g ∈ C0(I) were the density of x =⇒ density of T (x)?
1x
1
T(x)
|dh0(y)||dh1(y)||dh2(y)||dh3(y)|
dy
Answer: The density is
H[g](x) =∑h∈H
∣∣h′(x)∣∣ g (h(x))=
1
(1 + x)2
∑a≥0
2−a g
(2−a
1 + x
).
In general T k(x) has density
Hk[g](x) =∑h∈Hk
∣∣h′(x)∣∣ g (h(x)) .=⇒ Transfer operator Hs extends H, introducing a variable s
Hs[g](x) =∑h∈H
∣∣h′(x)∣∣s g (h(x)) .
Page 28
Density transformerQuestion: If g ∈ C0(I) were the density of x =⇒ density of T (x)?
1x
1
T(x)
|dh0(y)||dh1(y)||dh2(y)||dh3(y)|
dy
Answer: The density is
H[g](x) =∑h∈H
∣∣h′(x)∣∣ g (h(x))=
1
(1 + x)2
∑a≥0
2−a g
(2−a
1 + x
).
In general T k(x) has density
Hk[g](x) =∑h∈Hk
∣∣h′(x)∣∣ g (h(x)) .
=⇒ Transfer operator Hs extends H, introducing a variable s
Hs[g](x) =∑h∈H
∣∣h′(x)∣∣s g (h(x)) .
Page 29
Density transformerQuestion: If g ∈ C0(I) were the density of x =⇒ density of T (x)?
1x
1
T(x)
|dh0(y)||dh1(y)||dh2(y)||dh3(y)|
dy
Answer: The density is
H[g](x) =∑h∈H
∣∣h′(x)∣∣ g (h(x))=
1
(1 + x)2
∑a≥0
2−a g
(2−a
1 + x
).
In general T k(x) has density
Hk[g](x) =∑h∈Hk
∣∣h′(x)∣∣ g (h(x)) .=⇒ Transfer operator Hs extends H, introducing a variable s
Hs[g](x) =∑h∈H
∣∣h′(x)∣∣s g (h(x)) .
Page 30
Great!=⇒ Apply dynamical analysis?
Principles of dynamical analysis:
In our case: Transfer operator does not give enough information!=⇒ Lack information to retrieve the denominator! ⇒ why?
Page 31
Great!=⇒ Apply dynamical analysis?
Principles of dynamical analysis:
In our case: Transfer operator does not give enough information!=⇒ Lack information to retrieve the denominator! ⇒ why?
Page 32
Great!=⇒ Apply dynamical analysis?
Principles of dynamical analysis:
In our case: Transfer operator does not give enough information!
=⇒ Lack information to retrieve the denominator! ⇒ why?
Page 33
Great!=⇒ Apply dynamical analysis?
Principles of dynamical analysis:
In our case: Transfer operator does not give enough information!=⇒ Lack information to retrieve the denominator!
⇒ why?
Page 34
Great!=⇒ Apply dynamical analysis?
Principles of dynamical analysis:
In our case: Transfer operator does not give enough information!=⇒ Lack information to retrieve the denominator! ⇒ why?
Page 35
But our algorithm was “simple”, right?Back to the example (13, 31)
a q p 2ap r gcd(p, q)
1 31 13 26 5 12 26 5 20 6 11 20 6 12 8 20 12 8 8 4 41 8 4 8 0 4
Remarks.
I Seemingly helpful large exponents a slow down the algorithm!
I Growing gcd(p, q) prevents inverse branchesfrom distinguishing original denominator q.
I Conjecture: For long developments, gcd(p, q) is a power oftwo with exponent
∼ #steps/2 .
=⇒ Essential to keep track of this “dyadic behaviour”.
Page 36
But our algorithm was “simple”, right?Back to the example (13, 31)
a q p 2ap r gcd(p, q)
1 31 13 26 5 12 26 5 20 6 11 20 6 12 8 20 12 8 8 4 41 8 4 8 0 4
Remarks.
I Seemingly helpful large exponents a slow down the algorithm!
I Growing gcd(p, q) prevents inverse branchesfrom distinguishing original denominator q.
I Conjecture: For long developments, gcd(p, q) is a power oftwo with exponent
∼ #steps/2 .
=⇒ Essential to keep track of this “dyadic behaviour”.
Page 37
But our algorithm was “simple”, right?Back to the example (13, 31)
a q p 2ap r gcd(p, q)
1 31 13 26 5 12 26 5 20 6 11 20 6 12 8 20 12 8 8 4 41 8 4 8 0 4
Remarks.
I Seemingly helpful large exponents a slow down the algorithm!
I Growing gcd(p, q) prevents inverse branchesfrom distinguishing original denominator q.
I Conjecture: For long developments, gcd(p, q) is a power oftwo with exponent
∼ #steps/2 .
=⇒ Essential to keep track of this “dyadic behaviour”.
Page 38
But our algorithm was “simple”, right?Back to the example (13, 31)
a q p 2ap r gcd(p, q)
1 31 13 26 5 12 26 5 20 6 11 20 6 12 8 20 12 8 8 4 41 8 4 8 0 4
Remarks.
I Seemingly helpful large exponents a slow down the algorithm!
I Growing gcd(p, q) prevents inverse branchesfrom distinguishing original denominator q.
I Conjecture: For long developments, gcd(p, q) is a power oftwo with exponent
∼ #steps/2 .
=⇒ Essential to keep track of this “dyadic behaviour”.
Page 39
Recording the dyadic behaviour
Dyadic behaviour is related to divisibility
=⇒ ... but we employ analysis!
Response: Dyadic numbers Q2 !
Dyadic topology = Divisibility by 2 constraints ,
using the dyadic norm | · |2.
I Incorporate Q2 into the Transfer Operator?
I Careful! Add dyadic component y to “real” dynamical system!
I Variations in y add powers of two to Transfer operator⇒ yet the real component that “leads”.
Idea works!
Page 40
Recording the dyadic behaviour
Dyadic behaviour is related to divisibility=⇒ ... but we employ analysis!
Response: Dyadic numbers Q2 !
Dyadic topology = Divisibility by 2 constraints ,
using the dyadic norm | · |2.
I Incorporate Q2 into the Transfer Operator?
I Careful! Add dyadic component y to “real” dynamical system!
I Variations in y add powers of two to Transfer operator⇒ yet the real component that “leads”.
Idea works!
Page 41
Recording the dyadic behaviour
Dyadic behaviour is related to divisibility=⇒ ... but we employ analysis!
Response: Dyadic numbers Q2 !
Dyadic topology = Divisibility by 2 constraints ,
using the dyadic norm | · |2.
I Incorporate Q2 into the Transfer Operator?
I Careful! Add dyadic component y to “real” dynamical system!
I Variations in y add powers of two to Transfer operator⇒ yet the real component that “leads”.
Idea works!
Page 42
Recording the dyadic behaviour
Dyadic behaviour is related to divisibility=⇒ ... but we employ analysis!
Response: Dyadic numbers Q2 !
Dyadic topology = Divisibility by 2 constraints ,
using the dyadic norm | · |2.
I Incorporate Q2 into the Transfer Operator?
I Careful! Add dyadic component y to “real” dynamical system!
I Variations in y add powers of two to Transfer operator⇒ yet the real component that “leads”.
Idea works!
Page 43
Recording the dyadic behaviour
Dyadic behaviour is related to divisibility=⇒ ... but we employ analysis!
Response: Dyadic numbers Q2 !
Dyadic topology = Divisibility by 2 constraints ,
using the dyadic norm | · |2.
I Incorporate Q2 into the Transfer Operator?
I Careful! Add dyadic component y to “real” dynamical system!
I Variations in y add powers of two to Transfer operator⇒ yet the real component that “leads”.
Idea works!
Page 44
Recording the dyadic behaviour
Dyadic behaviour is related to divisibility=⇒ ... but we employ analysis!
Response: Dyadic numbers Q2 !
Dyadic topology = Divisibility by 2 constraints ,
using the dyadic norm | · |2.
I Incorporate Q2 into the Transfer Operator?
I Careful! Add dyadic component y to “real” dynamical system!
I Variations in y add powers of two to Transfer operator
⇒ yet the real component that “leads”.
Idea works!
Page 45
Recording the dyadic behaviour
Dyadic behaviour is related to divisibility=⇒ ... but we employ analysis!
Response: Dyadic numbers Q2 !
Dyadic topology = Divisibility by 2 constraints ,
using the dyadic norm | · |2.
I Incorporate Q2 into the Transfer Operator?
I Careful! Add dyadic component y to “real” dynamical system!
I Variations in y add powers of two to Transfer operator⇒ yet the real component that “leads”.
Idea works!
Page 46
Average behaviour of the CL algorithmInput model:
Ω := (p, q) : 0 < p < q, gcd(p, q) = 1 , ΩN := Ω ∩ [N ]× [N ] ,
take uniform probability on ΩN
⇒ expected value EN .
Result.
The mean value of steps EN [K] and shifts EN [S] performedduring the execution of the CL algorithm are Θ(logN).
We have explicit constants
EN [K] ∼ 2
HlogN , EN [S] ∼
log 3− log 2
2 log 2− log 3EN [K] ,
here H is known as the entropy of the system,
H = 1log(4/3)
(π2
6 + 2Li2(−1
2
)− (log 2) log 27log 16
),
numerically H.= 1.33973 . . .
Page 47
Average behaviour of the CL algorithmInput model:
Ω := (p, q) : 0 < p < q, gcd(p, q) = 1 , ΩN := Ω ∩ [N ]× [N ] ,
take uniform probability on ΩN ⇒ expected value EN .
Result.
The mean value of steps EN [K] and shifts EN [S] performedduring the execution of the CL algorithm are Θ(logN).
We have explicit constants
EN [K] ∼ 2
HlogN , EN [S] ∼
log 3− log 2
2 log 2− log 3EN [K] ,
here H is known as the entropy of the system,
H = 1log(4/3)
(π2
6 + 2Li2(−1
2
)− (log 2) log 27log 16
),
numerically H.= 1.33973 . . .
Page 48
Average behaviour of the CL algorithmInput model:
Ω := (p, q) : 0 < p < q, gcd(p, q) = 1 , ΩN := Ω ∩ [N ]× [N ] ,
take uniform probability on ΩN ⇒ expected value EN .
Result.
The mean value of steps EN [K] and shifts EN [S] performedduring the execution of the CL algorithm are Θ(logN).
We have explicit constants
EN [K] ∼ 2
HlogN , EN [S] ∼
log 3− log 2
2 log 2− log 3EN [K] ,
here H is known as the entropy of the system,
H = 1log(4/3)
(π2
6 + 2Li2(−1
2
)− (log 2) log 27log 16
),
numerically H.= 1.33973 . . .
Page 49
Average behaviour of the CL algorithmInput model:
Ω := (p, q) : 0 < p < q, gcd(p, q) = 1 , ΩN := Ω ∩ [N ]× [N ] ,
take uniform probability on ΩN ⇒ expected value EN .
Result.
The mean value of steps EN [K] and shifts EN [S] performedduring the execution of the CL algorithm are Θ(logN).
We have explicit constants
EN [K] ∼ 2
HlogN , EN [S] ∼
log 3− log 2
2 log 2− log 3EN [K] ,
here H is known as the entropy of the system,
H = 1log(4/3)
(π2
6 + 2Li2(−1
2
)− (log 2) log 27log 16
),
numerically H.= 1.33973 . . .
Page 50
The extended dynamical system
~ Introduce I := I ×Q2 and T : I → I as follows
T (x, y) = (Ta(x), Ta(y)) ,
for x ∈ Ia = [2−a−1, 2−a]. This gives inverse branches
ha(x, y) = (ha(x), ha(y)) , (x, y) ∈ I .
Evolution is lead by the real component, which determines a.
~ For Transfer operator ⇒ need change of variables formula!
Haar (translation invariant) measure ν on Q2 does satisfy∫Q2
F (y)dν(y) =
∫Q2
F (h(y))|h′(y)|2dν(y) .
=⇒ Consider related measure ν on Q2 !⇒ extended transfer operator Hs.
Page 51
The extended dynamical system
~ Introduce I := I ×Q2 and T : I → I as follows
T (x, y) = (Ta(x), Ta(y)) ,
for x ∈ Ia = [2−a−1, 2−a]. This gives inverse branches
ha(x, y) = (ha(x), ha(y)) , (x, y) ∈ I .
Evolution is lead by the real component, which determines a.
~ For Transfer operator ⇒ need change of variables formula!
Haar (translation invariant) measure ν on Q2 does satisfy∫Q2
F (y)dν(y) =
∫Q2
F (h(y))|h′(y)|2dν(y) .
=⇒ Consider related measure ν on Q2 !⇒ extended transfer operator Hs.
Page 52
The extended dynamical system
~ Introduce I := I ×Q2 and T : I → I as follows
T (x, y) = (Ta(x), Ta(y)) ,
for x ∈ Ia = [2−a−1, 2−a]. This gives inverse branches
ha(x, y) = (ha(x), ha(y)) , (x, y) ∈ I .
Evolution is lead by the real component, which determines a.
~ For Transfer operator ⇒ need change of variables formula!
Haar (translation invariant) measure ν on Q2 does satisfy∫Q2
F (y)dν(y) =
∫Q2
F (h(y))|h′(y)|2dν(y) .
=⇒ Consider related measure ν on Q2 !⇒ extended transfer operator Hs.
Page 53
The extended dynamical system
~ Introduce I := I ×Q2 and T : I → I as follows
T (x, y) = (Ta(x), Ta(y)) ,
for x ∈ Ia = [2−a−1, 2−a]. This gives inverse branches
ha(x, y) = (ha(x), ha(y)) , (x, y) ∈ I .
Evolution is lead by the real component, which determines a.
~ For Transfer operator ⇒ need change of variables formula!
Haar (translation invariant) measure ν on Q2 does satisfy∫Q2
F (y)dν(y) =
∫Q2
F (h(y))|h′(y)|2dν(y) .
=⇒ Consider related measure ν on Q2 !⇒ extended transfer operator Hs.
Page 54
The extended dynamical system
~ Introduce I := I ×Q2 and T : I → I as follows
T (x, y) = (Ta(x), Ta(y)) ,
for x ∈ Ia = [2−a−1, 2−a]. This gives inverse branches
ha(x, y) = (ha(x), ha(y)) , (x, y) ∈ I .
Evolution is lead by the real component, which determines a.
~ For Transfer operator ⇒ need change of variables formula!
Haar (translation invariant) measure ν on Q2 does satisfy∫Q2
F (y)dν(y) =
∫Q2
F (h(y))|h′(y)|2dν(y) .
=⇒ Consider related measure ν on Q2 !⇒ extended transfer operator Hs.
Page 55
Regarding the extended dynamical system
Several remarks
I Real component behaves extremely well...... yet the dyadic one does not.
I This fact complicates the Functional AnalysisI ... choice of functional space F .I ... scope at which Hs will act nicely on F .
I Real component so “nice” that we still succeed!
Real dynamical system studied by Chan (2005), Borwein at al. (2016)
I Ergodic.
I Invariant density ψ(x) = 1log(4/3)
1(x+1)(x+2) .
I Geometrical properties that make it act nicely on C1(I)=⇒ Dominant eigenvalue and spectral gap!
Page 56
Regarding the extended dynamical system
Several remarks
I Real component behaves extremely well...... yet the dyadic one does not.
I This fact complicates the Functional AnalysisI ... choice of functional space F .I ... scope at which Hs will act nicely on F .
I Real component so “nice” that we still succeed!
Real dynamical system studied by Chan (2005), Borwein at al. (2016)
I Ergodic.
I Invariant density ψ(x) = 1log(4/3)
1(x+1)(x+2) .
I Geometrical properties that make it act nicely on C1(I)=⇒ Dominant eigenvalue and spectral gap!
Page 57
Regarding the extended dynamical system
Several remarks
I Real component behaves extremely well...... yet the dyadic one does not.
I This fact complicates the Functional AnalysisI ... choice of functional space F .I ... scope at which Hs will act nicely on F .
I Real component so “nice” that we still succeed!
Real dynamical system studied by Chan (2005), Borwein at al. (2016)
I Ergodic.
I Invariant density ψ(x) = 1log(4/3)
1(x+1)(x+2) .
I Geometrical properties that make it act nicely on C1(I)=⇒ Dominant eigenvalue and spectral gap!
Page 58
Regarding the extended dynamical system
Several remarks
I Real component behaves extremely well...... yet the dyadic one does not.
I This fact complicates the Functional AnalysisI ... choice of functional space F .I ... scope at which Hs will act nicely on F .
I Real component so “nice” that we still succeed!
Real dynamical system studied by Chan (2005), Borwein at al. (2016)
I Ergodic.
I Invariant density ψ(x) = 1log(4/3)
1(x+1)(x+2) .
I Geometrical properties that make it act nicely on C1(I)=⇒ Dominant eigenvalue and spectral gap!
Page 59
Regarding the extended dynamical system
Several remarks
I Real component behaves extremely well...... yet the dyadic one does not.
I This fact complicates the Functional AnalysisI ... choice of functional space F .I ... scope at which Hs will act nicely on F .
I Real component so “nice” that we still succeed!
Real dynamical system studied by Chan (2005), Borwein at al. (2016)
I Ergodic.
I Invariant density ψ(x) = 1log(4/3)
1(x+1)(x+2) .
I Geometrical properties that make it act nicely on C1(I)=⇒ Dominant eigenvalue and spectral gap!
Page 60
Functional space F for the extended operator Hs
Real component directs the dynamical system:
I sections Fy fixing y ∈ Q2 asked to be C1(I).I the dyadic component follows, demanding only integrability of
y 7→ supxFy , and y 7→ sup
x∂xFy .
Ensuing space F makes Hs
I act on F for <s > 1/2 ⇒ big enough set of s.
I have a dominant eigenvalue and spectral gaprelying strongly on the real component.
We can finish the dynamical analysis!
Page 61
Functional space F for the extended operator Hs
Real component directs the dynamical system:
I sections Fy fixing y ∈ Q2 asked to be C1(I).I the dyadic component follows, demanding only integrability of
y 7→ supxFy , and y 7→ sup
x∂xFy .
Ensuing space F makes Hs
I act on F for <s > 1/2 ⇒ big enough set of s.
I have a dominant eigenvalue and spectral gaprelying strongly on the real component.
We can finish the dynamical analysis!
Page 62
Functional space F for the extended operator Hs
Real component directs the dynamical system:
I sections Fy fixing y ∈ Q2 asked to be C1(I).I the dyadic component follows, demanding only integrability of
y 7→ supxFy , and y 7→ sup
x∂xFy .
Ensuing space F makes Hs
I act on F for <s > 1/2 ⇒ big enough set of s.
I have a dominant eigenvalue and spectral gaprelying strongly on the real component.
We can finish the dynamical analysis!
Page 63
Conclusion and further questions
We have analysed
1. the number of steps
2. the number of binary shifts
performed by the Continued Logarithm Algorithm.
We would like to consider... the bit complexity.
In particular when dividing (p, q) 7→ (p/2, q/2) as soon as possible!⇒ may have competitive bit complexity.
Page 64
Conclusion and further questions
We have analysed
1. the number of steps
2. the number of binary shifts
performed by the Continued Logarithm Algorithm.
We would like to consider... the bit complexity.
In particular when dividing (p, q) 7→ (p/2, q/2) as soon as possible!⇒ may have competitive bit complexity.
Page 65
Conclusion and further questions
We have analysed
1. the number of steps
2. the number of binary shifts
performed by the Continued Logarithm Algorithm.
We would like to consider... the bit complexity.
In particular when dividing (p, q) 7→ (p/2, q/2) as soon as possible!⇒ may have competitive bit complexity.
Page 66
The Continued Logarithm vs. other binary algorithms
Other well-known binary algorithms include
I The binary GCD
I The LSB (least significant bits) algorithm– Informally “the Tortoise and the Hare”.
The dyadics play different roles in the dynamical analysis
I For the binary GCD: they do not intervene.
I For the LSB: they play the main role!
Unify the analysis to better understand the role of the dyadics?
Page 67
The Continued Logarithm vs. other binary algorithms
Other well-known binary algorithms include
I The binary GCD
I The LSB (least significant bits) algorithm– Informally “the Tortoise and the Hare”.
The dyadics play different roles in the dynamical analysis
I For the binary GCD: they do not intervene.
I For the LSB: they play the main role!
Unify the analysis to better understand the role of the dyadics?
Page 68
The Continued Logarithm vs. other binary algorithms
Other well-known binary algorithms include
I The binary GCD
I The LSB (least significant bits) algorithm– Informally “the Tortoise and the Hare”.
The dyadics play different roles in the dynamical analysis
I For the binary GCD: they do not intervene.
I For the LSB: they play the main role!
Unify the analysis to better understand the role of the dyadics?
Page 69
Continued Logarithm expansion over the reals
Chan studied from an Ergodic perspective
I the averages of the exponents (a1(x) + . . .+ aM (x))/M .
I the exponential growth of the “natural continuants” Qk(x).
Results concerning almost every x ∈ I=⇒ truncate the expansion a1(x), a2(x), . . . at depth k.
Adapting our methods to this context is work in progress:
I behaviour of continuants Qk differs from rational case.
I we conjecture − 1kE[log2 |Qk|2] ∼ 1/2
→ we have proved the limit exists... explicit invariant density Ψ(x, y) ?
→ related to growth of gcd(p, q) in the algorithm!
Page 70
Continued Logarithm expansion over the reals
Chan studied from an Ergodic perspective
I the averages of the exponents (a1(x) + . . .+ aM (x))/M .
I the exponential growth of the “natural continuants” Qk(x).
Results concerning almost every x ∈ I=⇒ truncate the expansion a1(x), a2(x), . . . at depth k.
Adapting our methods to this context is work in progress:
I behaviour of continuants Qk differs from rational case.
I we conjecture − 1kE[log2 |Qk|2] ∼ 1/2
→ we have proved the limit exists... explicit invariant density Ψ(x, y) ?
→ related to growth of gcd(p, q) in the algorithm!
Page 71
Continued Logarithm expansion over the reals
Chan studied from an Ergodic perspective
I the averages of the exponents (a1(x) + . . .+ aM (x))/M .
I the exponential growth of the “natural continuants” Qk(x).
Results concerning almost every x ∈ I=⇒ truncate the expansion a1(x), a2(x), . . . at depth k.
Adapting our methods to this context is work in progress:
I behaviour of continuants Qk differs from rational case.
I we conjecture − 1kE[log2 |Qk|2] ∼ 1/2
→ we have proved the limit exists... explicit invariant density Ψ(x, y) ?
→ related to growth of gcd(p, q) in the algorithm!
Page 72
Continued Logarithm expansion over the reals
Chan studied from an Ergodic perspective
I the averages of the exponents (a1(x) + . . .+ aM (x))/M .
I the exponential growth of the “natural continuants” Qk(x).
Results concerning almost every x ∈ I=⇒ truncate the expansion a1(x), a2(x), . . . at depth k.
Adapting our methods to this context is work in progress:
I behaviour of continuants Qk differs from rational case.
I we conjecture − 1kE[log2 |Qk|2] ∼ 1/2
→ we have proved the limit exists... explicit invariant density Ψ(x, y) ?
→ related to growth of gcd(p, q) in the algorithm!
Page 73
Continued Logarithm expansion over the reals
Chan studied from an Ergodic perspective
I the averages of the exponents (a1(x) + . . .+ aM (x))/M .
I the exponential growth of the “natural continuants” Qk(x).
Results concerning almost every x ∈ I=⇒ truncate the expansion a1(x), a2(x), . . . at depth k.
Adapting our methods to this context is work in progress:
I behaviour of continuants Qk differs from rational case.
I we conjecture − 1kE[log2 |Qk|2] ∼ 1/2
→ we have proved the limit exists
... explicit invariant density Ψ(x, y) ?→ related to growth of gcd(p, q) in the algorithm!
Page 74
Continued Logarithm expansion over the reals
Chan studied from an Ergodic perspective
I the averages of the exponents (a1(x) + . . .+ aM (x))/M .
I the exponential growth of the “natural continuants” Qk(x).
Results concerning almost every x ∈ I=⇒ truncate the expansion a1(x), a2(x), . . . at depth k.
Adapting our methods to this context is work in progress:
I behaviour of continuants Qk differs from rational case.
I we conjecture − 1kE[log2 |Qk|2] ∼ 1/2
→ we have proved the limit exists... explicit invariant density Ψ(x, y) ?
→ related to growth of gcd(p, q) in the algorithm!
Page 75
Continued Logarithm expansion over the reals
Chan studied from an Ergodic perspective
I the averages of the exponents (a1(x) + . . .+ aM (x))/M .
I the exponential growth of the “natural continuants” Qk(x).
Results concerning almost every x ∈ I=⇒ truncate the expansion a1(x), a2(x), . . . at depth k.
Adapting our methods to this context is work in progress:
I behaviour of continuants Qk differs from rational case.
I we conjecture − 1kE[log2 |Qk|2] ∼ 1/2
→ we have proved the limit exists... explicit invariant density Ψ(x, y) ?
→ related to growth of gcd(p, q) in the algorithm!
Page 76
References I
H.C. Chan.The Asymptotic Growth Rate of Random Fibonacci TypeSequences.Fibonacci Quarterly, vol. 43, no. 3, pp. 243–255, 2005.
Bill Gosper.Continued fraction arithmetic.Unpublished manuscript, c. 1978. Available athttp://perl.plover.com/classes/cftalk/INFO/gosper.txt.
P. Rotondo, B. Vallee, and A. Viola.Analysis of the Continued Logarithm Algorithm.Accepted in LATIN 2018. Prepub: arXiv:1801.10139
J. Shallit.Length of the continued logarithm algorithm on rationalinputs.Prepublication submitted to arXiv: arXiv:1606.03881v2, 2016.