The average behavior of nine algorithms derived from the Euclidean Algorithm is analysed. Some of them are useful in computing the Jacobi symbol. It is shown that these algorithms form two classes: the fast and the slow algorithms (Q(ln N)) versus Q(ln2 N)). The author suggests a general method, in which the algorithm and the set of its data are viewed as a dynamical system. The Ruelle operator and functional analysis are key tools. This unified approach gives not only the previously known results for classical Euclidean algorithms but also new results about the binary GCD and Jacobi symbol algorithms. In particular, conjectures due to Brent, Bach and Shallit are solved. The average behavior is linked to the entropy of the dynamical system, thus new universal constants (explicit for classical cases, computed numerically in the other cases) are exhibited.
( |
|
)= |
|
J(u,v):= |
|
( |
|
) |
|
for | v= |
|
v |
|
with odd primes vi. |
Quadratic reciprocity law: | J(u,v) | =(-1)(u-1)(v-1)/4J(v,u) for u,v odd positive integers, | ||||||
Modulo law: | J(v,u) | =J(v-bu,u), | ||||||
Multiplicativity law: | J(vw,u) | =J(v,u)J(w,u), | ||||||
Special values: | J(2,v) |
|
Classical with positive remainders | |
v=cu+r, 0£ r<u | 13/75=1/5+1/1+1/3+1/3+0 |
Subtractive classical | |
v=u+(v-u) | 13/75=1/1+1+1+1+1+1/1+1/1+1+1+1/1+1+1 |
Classical with negative remainders | |
v=cu-r | |
0£ r <u | 13/75=1/6-1/5-1/2-1/2+0 |
Classical with centred remainders | |
v=cu+e r | |
c³ 2, e=±1, (c,e)¹ (2,-1) | |
0£ r £ u/2 | 13/75=1/6-1/4+1/3 |
Even CF | |
v=cu+e s, | |
c even, e=± 1 s odd, 0<s<u | 13/75=1/6-1/4+1/4-1 |
Odd CF | |
v=cu+e 2k s, | |
c odd, e=± 1, | |
s odd, k³ 1, 0£ 2ks <u | 13/75=1/5+2/3-2/5+0 |
Ordinary CF | |
v=cu+2ks, s=0 or s odd, | |
k³ 0, | |
0£ 2ks<u | 13/75=1/5+2/2+1/1+2/3+0 |
Centred CF | |
v=cu+e2ks, | |
s=0 or s odd, k³ 0, | |
0£ 2k s<u/2 | 13/75=1/6-1/4+1/3+0 |
Binary GCD | |
v=au+2kr, | |
a odd, | |
a<2k, r£ u | 13/75=1/1+2+22/1+22/1+23 |
S(s,w):= |
|
|
|
wl |
S(s,1)=: |
|
|
and |
|
S(s,w)|w=1=: |
|
|
SN= |
|
= |
|
. |
|
an= |
|
N |
|
ln |
|
N (1+o(N)). |
As(f)= |
|
|
. |
positive remainders | 12ln 2/p2ln N | .842 ln N | Heilbron & Dixon 70 | |
subtractive | 6/p2(ln N)2 | .607(ln N)2 | Knuth & Yao 75 | |
negative remainders | 3/p2 (ln N)2 | .303(ln N)2 | Vardi 92 | |
centred remainders | 12ln f/p2ln N | .585ln N | Rieger 80 | |
even | 2/p2(ln N)2 | .202(ln N)2 | Vallée & Lemée 98 | |
odd | AOln N | .435 ln N | Vallée & Lemée 98 | |
ordinary | AUln N | .535 ln N | Vallée & Lemée 98 | |
centred | ACln N | .430 ln N | Vallée & Lemée 98 | |
binary GCD | ABln N | .555 ln N | Vallée 98 | |
This document was translated from LATEX by HEVEA.