Download AN ALGORITHM TO PARTITION THE CANTOR RATIONALS The

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Infinity wikipedia , lookup

Addition wikipedia , lookup

Positional notation wikipedia , lookup

Elementary arithmetic wikipedia , lookup

Elementary mathematics wikipedia , lookup

Approximations of π wikipedia , lookup

Factorization of polynomials over finite fields wikipedia , lookup

Georg Cantor's first set theory article wikipedia , lookup

Transcript
AN ALGORITHM TO PARTITION THE
CANTOR RATIONALS
ALEXANDER D. RAHM AND NOAM SOLOMON
Abstract. We give an algorithm to partition the set of rational numbers in
the Cantor set — the Cantor rationals — into sets each attached to a natural
number q, containing all the Cantor rationals of reduced form pq . It has been
implemented [2] in Pari/GP [1].
The above mentioned task is carried out by algorithm 1 below. Before running
algorithm 1, we use algorithm ThreeOrder (implemented in [2]) to compute a
database for the order O(3, q) of the element 3 in the group of multiplicative units
in the ring Z/qZ with q elements.
Proposition 1. The set computed by algorithm 1 contains all the Cantor rationals
of denominator q for its reduced form. This algorithm terminates within finite time.
Proof.
• The period length of pq in the ternary system is given by O(3, q ′ ). Hence,
the finite sequence a of ternary digits is precisely the periodical sequence
in pq . Furthermore,
s(3n − 1) + a
p
= .
n
ℓ
(3 − 1)3
q
So, the sequence s is precisely the sequence of ternary digits preceding the
periodical part in the ternary expansion of pq . By the elementary ternary
digits property of the Cantor set, algorithm 1 decides if pq is a Cantor
rational. The mask M allows it to check all suitable fractions pq . Here, and
for establishing the passlist, we make use of the well-known symmetry of
the Cantor set: If x is an element of the Cantor set, then the same holds
for 1 − x, x3 , and — provided that it is in the unit interval — 3x.
• The loop in algorithm 1 consists of q − 1 repetitions, which contain a finite
number of finite-time steps.
1
2
ALEXANDER D. RAHM AND NOAM SOLOMON
Algorithm 1 Computation of the Cantor rationals of denominator q
Input: A natural number q.
Output: The set of Cantor rationals of reduced form pq .
Carry out the prime decomposition of q.
Create a mask M as the set of multiples of the primes in q satisfying that the
multiples are strictly smaller than q.
Denote by ℓ the multiplicity of 3 in the prime decomposition of q.
Let q ′ := 3qℓ .
Obtain n := O(3, q ′ ) from the output of algorithm ThreeOrder.
Initialize the passlist as an empty list.
for p running from 1 through q − 1, do
if p is not an element of the mask M or the passlist, then
Let T := pq (3n − 1)3ℓ .
Let A := T mod (3n − 1).
if A 6= 0 mod (3n − 1), then
Let a be the lift of A to {1, . . . , 3n − 2}ternary .
if the digits of a are in {0, 2}, then
Let s := 3Tn−a
.
−1 ternary
if the digits of s are in {0, 2}, then
The fraction pq is a Cantor rational.
Record it into the set of Cantor rationals of denominator q.
Add 3-power multiples of p and their reflections to the passlist.
else
No 3-power multiples of pq are Cantor rationals.
Add 3-power multiples of p and their reflections to the mask M.
end if
end if
else
if the digits of 3nT−1 ternary or 3nT−1 − 1 ternary are in {0, 2}, then
The fraction pq is a Cantor rational.
Record it into the set of Cantor rationals of denominator q.
Add 3-power multiples of p and their reflections to the passlist.
else
No 3-power multiples of pq are Cantor rationals.
Add 3-power multiples of p and their reflections to the mask M.
end if
end if
end if
end for
Output the rationals pq for p in the passlist.
AN ALGORITHM TO PARTITION THE
CANTOR RATIONALS
3
Remark 1.
• The mask M can be omitted and a coprimality check for (p, q)
inserted, to obtain a simpler algorithm which is mathematically equivalent
to algorithm 1. The difference lies in the efficiency: In fact, the mask M
is a powerful tool to reduce the time needed to carry out the algorithm,
minimizing the number of iterations of most expensive steps, which grows
fast with q.
• Even more important for the efficiency is the sub-algorithm testing the belonging of the ternary digits to the set {0, 2}, because the numbers to be
tested are incredibly great integers.
References
[1] Bill Allombert, Christian Batut, Karim Belabas, Dominique Bernardi, Henri Cohen,
Francisco Diaz y Diaz, Yves Eichenlaub, Xavier Gourdon, Louis Granboulan, Bruno
Haible, Guillaume Hanrot, Pascal Letard, Gerhard Niklasch, Michel Olivier, Thomas
Papanikolaou, Xavier Roblot, Denis Simon, Emmanuel Tollis, Ilya Zakharevitch, and
the PARI group, PARI/GP, version 2.4.3, specialized computer algebra system, Bordeaux, 2010, http://pari.math.u-bordeaux.fr/,
[2] Alexander D. Rahm, CantorPartition, version 1.0, Computer program using PARI/GP
covered by the GNU General Public License,
Department of Mathematics, Weizmann Institute of Science, Rehovot, Israel