properties of a generalized $uqrog¶vglvfuhwhfdwpds725545/... · 2014. 6. 17. · modulo n...

36
Master’s thesis Properties of a generalized Arnold’s discrete cat map Author: Fredrik Svanström Supervisor: Per-Anders Svensson Examiner: Andrei Khrennikov Date: 2014-06-06 Subject: Mathematics Level: Second level Course code: 4MA11E Department of Mathematics

Upload: others

Post on 12-Sep-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Master’s thesis

Properties of a generalized

Arnold’s discrete cat map

Author: Fredrik Svanström

Supervisor: Per-Anders Svensson

Examiner: Andrei Khrennikov

Date: 2014-06-06

Subject: Mathematics

Level: Second level

Course code: 4MA11E

Department of Mathematics

Page 2: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Abstract

After reviewing some properties of the two dimensional hyperbolic

toral automorphism called Arnold’s discrete cat map, including its gen-

eralizations with matrices having positive unit determinant, this thesis

contains a definition of a novel cat map where the elements of the matrix

are found in the sequence of Pell numbers. This mapping is therefore

denoted as Pell’s cat map. The main result of this thesis is a theorem

determining the upper bound for the minimal period of Pell’s cat map.

From numerical results four conjectures regarding properties of Pell’s cat

map are also stated. A brief exposition of some applications of Arnold’s

discrete cat map is found in the last part of the thesis.

Keywords: Arnold’s discrete cat map, Hyperbolic toral automorphism,

Discrete-time dynamical systems, Poincaré recurrence theorem, Number

theory, Linear algebra, Fibonacci numbers, Pell numbers, Cryptography.

Page 3: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Contents

1 Introduction 1

2 Arnold’s cat map 2

3 The connection between Arnold’s cat and Fibonacci’s rabbits 5

4 Properties of Arnold’s cat map 6

4.1 Period lengths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64.2 Disjoint orbits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84.3 Higher dimensions of the cat map . . . . . . . . . . . . . . . . . . 104.4 The generalized cat maps with positive unit determinant . . . . . 114.5 Miniatures and ghosts . . . . . . . . . . . . . . . . . . . . . . . . 12

5 Pell’s cat map 14

5.1 Defining Pell’s cat map . . . . . . . . . . . . . . . . . . . . . . . . 155.2 Some results from elementary number theory . . . . . . . . . . . 185.3 A partition of the prime numbers . . . . . . . . . . . . . . . . . . 215.4 The upper bound for the minimal period of Pell’s cat map . . . . 225.5 An alternative mapping with the same period as Pell’s cat map . 275.6 Conjectures regarding Pell’s cat map . . . . . . . . . . . . . . . . 28

6 Applications 29

6.1 Encryption of images and text . . . . . . . . . . . . . . . . . . . 296.2 Steganography, watermarks and image tampering detection . . . 29

7 Conclusions 30

References 31

Page 4: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

1 Introduction

Consider mixing two different colors of paint. It appears to be against all com-mon sense that the colors would separate and appear in their original statesafter a certain amount of mixing. It would also be a bit perplexing if we atsome intermediate point in time suddenly had a checkerboard color mix. Thisis however exactly the consequence of the Poincaré Recurrence Theorem1 formathematical objects known as dynamical systems.

The two colors in Figure 1.1 are mixed in discrete-time steps, iterations, ofArnold’s cat map2. An iteration of Arnold’s cat map is the effect of a matrixmultiplication and then the modulo operation on the pixel coordinate values.The image of the two colors are so to speak stretched and then folded back tofit within the original square shaped boundaries.

Figure 1.1: Two colors and how they are mixed after 1, 25 and 306 iterations ofArnold’s cat map

Even stranger behavior can be observed if we mix the pixels of an actualimage rather than just two colors. The original image will sometimes appearupside down and occasionally we will experience how miniatures of the motiveare lined up before our eyes.

The certain matrix used in Arnold’s cat map, closely related to the wellknown Fibonacci sequence, is chosen from the set of invertible 2x2 matriceswith integer elements. This guarantees that it preserves the area of the image.By a generalization of Arnold’s cat map we mean choosing another such areapreserving matrix. The novel generalized cat map presented in this thesis hasa connection to the Pell sequence, so it is therefore called Pell’s cat map.

Since we wish to shed some light on the connection between the number ofpixels in the image and the number of iterations needed to recover the originalimage we initially summarize, without proofs, the relevant material on Arnold’scat map. It is natural to try to relate the two different mappings, so in thelatter part of the thesis we will extend the known results to Pell’s cat map.It is also here we find the main result of the thesis in the form of a theoremfor the upper bound of the number of iterations needed to recover the originalimage. Our observations also motivate some conjectures regarding the behaviorof Pell’s cat map. Hereinafter we will primarily be using results and methodsfrom linear algebra and elementary number theory. A brief exposition of somecryptographic applications of Arnold’s cat map is thereto found in the last partof the thesis.

1After J.H. Poincaré 1854-19122After V. I. Arnold 1937-2010. Following the convention, we will preferably be using an

image of a cat to illustrate the effects of Arnold’s cat map and its generalizations

1

Page 5: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

2 Arnold’s cat map

Take a square image, consisting of N by N pixels, where the coordinates of eachpixel is represented by the ordered pair (X,Y ) of real numbers in the interval[0, 1). Let an iteration of Arnold’s cat map firstly be the multiplication of allpixel coordinates by the matrix3 A = [ 1 1

1 2 ]. Then all values are taken modulo1, so that the resulting coordinates are still in [0, 1).

The effect of Arnold’s cat map on an image is shown in Figure 2.1. Eventhough the image looks chaotic already after a few iterations, the underlyingorder among the pixels lets us recover the original image after a certain numberof additional iterations. We can also observe that, at one time, the image looksto be turned upside down before the original image appears once again.

Original image n = 1 n = 2

n = 6 n = 153 n = 306

Figure 2.1: The effect of Arnold’s cat map on a 289x289 pixels image after niterations

Arnold’s cat map induces a discrete-time dynamical system in which theevolution is given by iterations of the mapping Γcat : T

2 → T2 where

Γcat

([

Xn+1

Yn+1

])

=

[

1 11 2

] [

Xn

Yn

]

(mod 1).

This mapping is also known as a toral automorphism4 since T2 is the 2-

dimensional torus defined to be T2 = R

2/Z2 = R/Z× R/Z.

Following from the modulo 1 operation we must consider the image to bewithout edges, as shown in Figure 2.2, hence the torus T

2.

3Some literature, such as [3] and [15], use A =[

2 1

1 1

]

, but this is just a mere technicalitythat does not affect the material presented in this thesis

4From [18] we have that an isomorphism from a group onto itself is an automorphism

2

Page 6: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Figure 2.2: The square image of the cat shaped as a 2-dimensional torus

In Figure 2.3 we can see the effect of Arnold’s cat map on the unit square,first stretching and then folding it. Since the matrix determinant det(A) = 1,the mapping is area preserving and the point marked in (0,1) helps illustratingthe orientation preserving characteristics of Arnold’s cat map.

Remark 2.1. Compare the result of the modulo 1 operation in Figure 2.3 to theimage of the cat shown in Figure 2.1 after one iteration.

0 1 2 3

0

1

2

3

0 1 2 3

0

1

2

3

[ 1 11 2 ]

0 1 2 3

0

1

2

3

Modulo 1

Figure 2.3: The effect of Arnold’s cat map on the unit square

For an image with rational coordinates 0 ≤ xN , y

N < 1, a scaling of the imagemakes it possible to work with integer coordinates 0 ≤ x, y ≤ N − 1. Thisclearly forces us to use modulo N instead of modulo 1, hence Arnold’s discrete

cat map ΓA : ZN × ZN → ZN × ZN is

ΓA

([

xn+1

yn+1

])

=

[

1 11 2

] [

xn

yn

]

(mod N).

With π being the transition from rational coordinates in the interval [0, 1)to integer coordinates (0, 1, 2, . . . , N − 1), we have the following commutativediagram

T2

T2

ZN × ZN ZN × ZN

Γcat

π π .

ΓA

3

Page 7: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

The characteristic polynomial of the matrix A is

λ2 − trace(A)λ+ det(A) = λ2 − 3λ+ 1

and the two eigenvalues of the matrix A, i.e. the roots of the characteristicpolynomial, are λ1 = (3 +

√5)/2 ≈ 2.618034 and λ2 = (3−

√5)/2 ≈ 0.381866.

The discriminant of the characteristic polynomial is

D =(

trace(A))2 − 4 · det(A) = 5.

Since neither of the two eigenvalues of A is of unit length the mappingΓcat : T

2 → T2 is said to be a hyperbolic toral automorphism and since A is a

symmetric matrix the two eigenvectors are orthogonal.

The fact that the discrete-time dynamical system i.e. the set of rules imposedby Arnold’s cat map, will follow the Poincaré Recurrence Theorem and hencebe periodic leads us to make the following definition.

Definition 2.2. The minimal period of Arnold’s discrete cat map is the smallestpositive integer n such that An ≡ [ 1 0

0 1 ] (mod N). We denote by ΠA(N) theminimal period of Arnold’s discrete cat map modulo N .

Example 2.3. From Figure 2.1 we can conclude that ΠA(289) = 306, sincethere is no positive integer smaller than n = 306 such that the original imagereappears.

In this thesis we will be working preferably with integer coordinates and themodulo N operation, so for simplicity of notation we will write Arnold’s cat

map instead of Arnold’s discrete cat map when no confusion can arise.

Henceforth p, q, r and s will denote prime numbers while a, b, i, j, k, m, nand N are all integers. Two disjoint sets of prime numbers called R and S willbe defined in Subsection 5.3.

Figures and numerical computations used in this thesis are made usingMATLAB R©.

4

Page 8: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

3 The connection between Arnold’s cat and Fi-

bonacci’s rabbits

Definition 3.1. Let the nth number of the Fibonacci sequence be defined bythe recurrence relation Fn = Fn−1 + Fn−2 with F0 = 0 and F1 = 1.

Hence the first Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, . . .

The Fibonacci sequence can be found in many varying contexts stretchingfrom Pascal’s triangle5 to real life objects, such as the shell of a pineapple.

Powers of the matrix F = [ 0 11 1 ] =

[

F0 F1

F1 F2

]

will generate numbers the Fi-bonacci sequence

Fn =

[

Fn−1 Fn

Fn Fn+1

]

.

In [1] the matrix F is called the golden cat map due to the well known connec-tion between two consecutive Fibonacci numbers and the golden ratio6. Notethat the golden ratio is also equal to the largest eigenvalue of F .

Since F and A have the relationship

F 2 =

[

0 11 1

] [

0 11 1

]

=

[

1 11 2

]

= A,

the Fibonacci numbers will also appear when we take powers of the matrix Ain the following manner

An =

[

1 11 2

]n

=

[

F2n−1 F2n

F2n F2n+1

]

,

with the first powers of A being

A2 =

[

2 33 5

]

, A3 =

[

5 88 13

]

, A4 =

[

13 2121 34

]

, A5 =

[

34 5555 89

]

, . . .

From the definition of the minimal period of Arnold’s cat map we know thatwe are looking for the smallest integer n such that An = [ 1 0

0 1 ] (mod N) i.e. wemust find the smallest n such that F2n−1 ≡ 1 (mod N) and F2n ≡ 0 (mod N).Hence the period of Arnold’s cat map will have a direct connection to the Pisano

period7 of the Fibonacci sequence. From the above-mentioned relation betweenthe matrices F and A follows that the period of Arnold’s cat map will be exactlyhalf the Pisano period for all N ≥ 3.

5After B. Pascal 1623-16626(1 +

√5)/2 ≈ 1.618

7The period length of the Fibonacci sequence modulo N , named after Leonardo of Pisa

5

Page 9: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

4 Properties of Arnold’s cat map

As depicted in Figure 4.1 there is no obvious connection between the minimalperiod of Arnold’s cat map, and hence the Pisano period, and the number N .This fact has been the object of many studies and articles where [19] by Wallcan be considered as the most prominent.

0 10 20 30 40 50 60 70 80 90 1000

50

100

150

200

N

Π(N)

0 10 20 30 40 50 60 70 80 90 1000

0.5

1

1.5

2

2.5

3

N

Π(N)

N

Figure 4.1: Minimal periods ΠA(N) of Arnold’s cat map and the ratio ΠA(N)/Nfor the interval 2 ≤ N ≤ 100

4.1 Period lengths

It is worth pointing out that there exists no known closed form expression forΠA(N) valid for all N , so to find the minimal period we are referred to numericalcalculations. To formulate a theorem regarding the upper bound for the minimalperiod length, we must also define the period of Arnold’s cat map. This is notnecessarily the minimal period, but we can nevertheless use elementary resultsstemming from elementary number theory to actually calculate it for all N .

Definition 4.1. A period ΨA(N) of Arnold’s cat map is an integer k such thatAk ≡ [ 1 0

0 1 ] (mod N).

Therefore ΠA(N) ≤ ΨA(N) and, more precisely, ΠA(N) will always be a di-visor of ΨA(N). All multiples of ΨA(N) will also be congruent to [ 1 0

0 1 ] (mod N).

The reason behind the inequality ΠA(N) ≤ ΨA(N) comes from the phenom-ena that, for some prime numbers and hence also for composite numbers withsuch prime factors, the minimal period is a divisor of the period that we getusing the expression for ΨA(N) found in [15] by Neumärker and [9] by Dysonand Falk.

Definition 4.2. Prime numbers with the property that ΠA(p) < ΨA(p) will bereferred to as short prime numbers for Arnold’s cat map.

6

Page 10: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Example 4.3. We have that ΠA(29) = 7 6= ΨA(29) = 14, hence 29 is a shortprime number for Arnold’s cat map.

Dyson and Falk propose in [9] an expression for the asymptotic behavior ofthe fraction of integers up to and including N that will have ΠA(N) = ΨA(N)calling these integers “primitive”. In [2] Bao and Yang present an algorithmto find ΠA(N) for a given ΨA(N) using stepwise elimination of the factors ofΨA(N).

Wall [19] provides a table for the 99 short prime numbers 5 < p < 2000(there are 300 prime numbers 5 < p < 2000 in total). Brother continues thiswork in [4] with the 38 (out of totally 127) prime numbers 2000 < p < 3000 forwhich the minimal period is a divisor of the period ΨA(p). Even though thesetwo articles actually precede the introduction of the cat map, made by Arnoldin 1967, these results are directly transferable to Arnold’s cat map due to theconnection between the matrices F and A. A computation for 5 < p < 50000yields that about 33% (1716/5130) are short prime number for Arnold’s cat map.

Figure 4.2 shows the minimal periods of Arnold’s cat map for prime numbers2 ≤ p ≤ 5000. Note the scattered presence of short prime numbers below thetwo prominent lines p+ 1 and (p− 1)/2.

0 500 1000 1500 2000 2500 3000 3500 4000 4500 50000

1000

2000

3000

4000

5000

p

Π(p)

Figure 4.2: Minimal periods of Arnold’s cat map for the prime numbers 2 ≤p ≤ 5000

The discriminant of the characteristic polynomial plays an important rolefor the periods of Arnold’s cat map modulo N . If the discriminant is a squarein the finite field Fp = Z/pZ i.e. if 5 is a quadratic residue modulo p, then thecharacteristic polynomial has roots in Fp and from Fermat’s Little Theorem8

ΨA(p) = (p − 1)/2. By the notation that an integer n is a quadratic residuemodulo p we mean that there exist an integer k such that k2 ≡ n (mod p).

If 5 is a quadratic nonresidue modulo p and hence x2 − 3x+ 1 has no rootsin Fp, we follow [18] using Kronecker’s Theorem9 to extend the field so that itbecomes Fp [x] /(x

2 − 3x+1), which is the splitting field of x2 − 3x+1. In thiscase ΨA(p) = p+ 1.

8After P. de Fermat 1601-16659After L. Kronecker 1823-1891

7

Page 11: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Considering the two special cases ΠA(2) = 3 and ΠA(5) = 10, a periodΨA(N) can be calculated for any composite number N using the following the-orem proved in [12] by Gaspari.

Theorem 4.4. If N has the prime factorization N = pap1

1 ·pap2

2 ·pap3

3 · . . . ·papk

k .

Then ΨA(N) = lcm(

ΨA(pap1

1 ),ΨA(pap2

2 ),ΨA(pap3

3 ), . . . ,ΨA(papk

k ))

, where lcm

is the least common multiple.

Example 4.5. We can conclude that ΨA(21) = lcm(

ΨA(3),ΨA(7))

=lcm (4, 8) = 8.

Note that p = 2 is the only known prime number where ΠA(p) = ΠA(p2).

For all other powers of prime numbers it is believed that ΠA(pn) = pn−1ΠA(p).

However finding a prime number p ≥ 3 such that ΠA(p) = ΠA(p2) would prove

the existence of a Wall-Sun-Sun prime number10 as conjectured by Wall in [19].No one has yet been able to prove that such a prime number does not exist, buton the other hand no such number has yet been found11 for p < 3.9 ·1016 (April2014).

Remark 4.6. For composite N we have cases when ΠA(N) = ΠA(N2), for ex-

ample ΠA(6) = ΠA(36) = 12 and ΠA(12) = ΠA(144) = 12.

Theorem 4.7. The upper bound for the minimal period of Arnold’s cat map is

3N .

The proof of this is omitted here but can be found in [9] by Dyson and Falk,where it in turn is based on theorems from [13] by Hardy and Wright.

Dyson and Falk also prove that for k = 1, 2, 3, . . .

ΨA(N) = 3N when N = 2 · 5k,ΨA(N) = 2N when N = 5k or N = 6 · 5k,

ΨA(N) ≤ 12

7N for all other N.

Besides giving an expression for the upper bound, Dyson and Falk also ex-amines the lower bound for the minimal period of Arnold’s cat map.

4.2 Disjoint orbits

Besides the periodicity we can also define some other distinct properties validfor discrete-time dynamical systems.

Definition 4.8. Let the orbit of a point denote the set of coordinates that anindividual point will assume under iterations of a dynamical system, for exampleArnold’s cat map, until it returns to its initial value. The number of uniquecoordinates in the orbit is called the orbit length. Of course all points belongingto one and the same orbit have the same orbit length.

10These are also known as Fibonacci-Wieferich prime numbers and in [15] by NeumärkerΠA(p) = ΠA(p2) is referred to as the plateau phenomenon

11It is possible to follow or participate in the search for the first Wall-Sun-Sun prime numberon the web page http://prpnet.primegrid.com:13001/pending_work.html

8

Page 12: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Definition 4.9. For a dynamical system any point where the rate of change iszero is called a fixed point or trivial point. For a discrete-time system this willbe all points with orbit length 1. Points with an orbit length greater than 1 arecalled non-trivial.

Example 4.10. So for the discrete mapping ΓA : ZN × ZN → ZN × ZN , thepoint with coordinates (0,0) is a trivial point. All other points with integercoordinates are non-trivial since they are periodic and have an orbit lengthgreater than 1.

The orbit, with length 12, of the point (1,1) for Arnold’s cat map with N = 6,consisting of the coordinates

{

(1, 1), (2, 3), (5, 2), (1, 3), (4, 1), (5, 0), (5, 5), (4, 3),

(1, 4), (5, 3), (2, 5), (1, 0)}

, is depicted in Figure 4.3.

Figure 4.3: The orbit of the point (1,1) for Arnold’s cat map with N = 6

Since we know that (0,0) is a trivial point with orbit length 1 and that theupper bound for the period of Arnold’s cat map is 3N , for all N > 3, no pointcan have an orbit that includes all the N2 − 1 non-trivial points. From this wecan conclude that there will be a number of disjoint orbits. The length of theseorbits will either be equal to the minimal period or be a divisor of it. The orbitlength of the point (1,1) will always be equal to the minimal period ΠA(N) forall N ≥ 2 since the x-coordinates of the orbit are equal to odd numbered Fi-bonacci numbers modulo N and the y-coordinate corresponds to even numberedditto.

When N is a prime number p, except for p = 5, all of the non-trivial pointshave one and the same orbit length, as shown by Gaspari in [12]. When p = 5the orbit length of the non-trivial points are either ΠA(5) = 10 or ΠA(5)/5 = 2.Figure 4.4 shows the orbit lengths for the prime numbers p = 5 and p = 7.

Figure 4.4: Orbit lengths for Arnold’s cat map for p = 5 and p = 7

9

Page 13: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Composite numbers will have more than one period length for the non-trivialpoints and investigating N up to 500 reveals that the highest number of differentorbit lengths occurs for N = 390. The 17 different orbit lengths are then 2, 3,4, 6, 10, 12, 14, 20, 28, 30, 42, 60, 70, 84, 140, 210 and 420. Figure 4.5 showsthe orbit lengths of the points for Arnold’s cat map for the composite numbersN = 9 and N = 10.

Figure 4.5: Orbit lengths for Arnold’s cat map for N = 9 and N = 10

4.3 Higher dimensions of the cat map

The cat map can also be extended into higher dimensions as described by Nancein [14] where he, in three steps, fixes each one of the x-, y- and z-coordinate andthen multiplies the results to get the matrix of the 3-dimensional cat map A3D.

1 0 00 1 10 1 2

1 0 10 1 01 0 2

1 1 01 2 00 0 1

=

1 1 12 3 23 4 4

= A3D.

The matrix A3D is not unique due to the non-commutative properties of matrixmultiplication, so in [7] we have

A3D =

2 1 33 2 52 1 4

,

however all A3D will have the same eigenvalues λ1 ≈ 7.18, λ2 ≈ 0.57 andλ3 ≈ 0.24. Interestingly the minimal periods of the 3-dimensional cat map,shown in Figure 4.6, display a totally different pattern than ΠA(N).

The 4-dimensional cat map is calculated using A3D with yet an additionalcoordinate, so A4D is

1 0 0 00 1 1 10 2 3 20 3 4 4

1 0 1 10 1 0 02 0 3 23 0 4 4

1 1 0 12 3 0 20 0 1 03 4 0 4

1 1 1 02 3 2 03 4 4 00 0 0 1

=

17 23 18 5110 149 117 31257 348 272 72432 585 460 122

= A4D.

10

Page 14: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

0 10 20 30 40 50 60 70 80 90 1000

50

100

150

200

250

300

350

N

Π(N)

0 10 20 30 40 50 60 70 80 90 1000

0.5

1

1.5

2

2.5

3

3.5

N

Π(N)

N

Figure 4.6: Minimal periods ΠA3D(N) of the 3-dimensional Arnold’s cat and

the ratio ΠA3D(N)/N for the interval 2 ≤ N ≤ 100

An extension into even more dimensions is found in [11], where Gansean andMurali propose an encryption system based on the seemingly chaotic sequenceobtained from iterations of the 8-dimensional cat map12

A8D =

1 7 33 125 403 1119 2591 42791 8 39 150 487 1356 3141 51821 7 34 130 421 1171 2712 44761 6 26 96 305 842 1948 32241 5 19 63 192 520 1200 20001 4 13 38 104 272 644 10561 3 8 20 48 112 256 4481 2 4 8 16 32 64 128

,

hence using the cat map as a pseudo random number generator with a point inthe 8-dimensional space as a part of the initiation key for the encryption system.

The reason to choose a cat map of a higher dimension is the behavior of thelargest eigenvalue. A cat map of a higher dimension is considered being more

chaotic by the topological entropy measure lg |λmax| as defined in [3]. This aproperty that is preferred in a cryptographic context. The largest eigenvalue ofA8D is about 1090.

4.4 The generalized cat maps with positive unit determi-

nant

The generalized cat maps, with determinant 1, of type 1 and 2, are defined tobe

ΓG1

([

xn+1

yn+1

])

=

[

1 aa a2 + 1

] [

xn

yn

]

(mod N)

12The matrix A8D is a product of matrices with determinant 1, but when the determinantof A8D is calculated the result becomes −299, indicating that there is a typographical errorin [11]

11

Page 15: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

and

ΓG2

([

xn+1

yn+1

])

=

[

1 ab ab+ 1

] [

xn

yn

]

(mod N).

Periods of the two generalized cat maps are studied in [2]. In [5] and [6]Chen et al. use the Hensel lift method13 to study the period distribution. Inthe latter article Chen et al. states that “Our next step aims to work on thecorresponding period distribution for general composite N ’s”, but so far (April2014) no further work has yet been published.

4.5 Miniatures and ghosts

Before reaching the minimal period we can sometimes observe that the imageappears to be less chaotic than expected. Behrends [3] gives an explanation tohow and when these phenomena that we will call miniatures and ghosts occur,claiming the following

• Miniatures may occur when the absolute values of all of the elements ofAn (mod N), i.e. min |ai,j , N − ai,j | for i, j = 1, 2, are small compared toN .

• If miniatures occur, the number of miniatures14 is always ±1 (mod N).

• The orientation of the miniatures will depend on the column vectors ofAn (mod N).

• Ghosts are more likely to occur when N is a composite number than whenit is a prime number.

• The number of ghosts and their slopes depend on vectors, with smallabsolute values, that are mapped onto themselves by An (mod N).

Figure 4.7 shows miniatures in a 289x289 pixels image using a type 1 gen-eralized cat map and Figure 4.8 shows ghosts occurring after 70 iterations ofArnold’s cat map on a 286x286 pixels image.

Figure 4.7: Miniatures occurring after 34 iterations of a type 1 generalized catmap G1 = [ 1 2

2 5 ] on a 289x289 pixels image

So since[

1 22 5

]34

≡[

277 1212 12

]

≡[

−12 1212 12

]

(mod 289)

13After K. Hensel 1861-194114Remember to consider the image as being without edges

12

Page 16: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

there must be |12 · (−12)− 12 · 12| = 288 miniatures. The slopes of the minia-tures are −1 and 1 following from the column vectors

[

−1212

]

and [ 1212 ].

Figure 4.8: Ghosts occurring after 70 iterations of Arnold’s cat map on a 286x286pixels image

Here we have that

[

1 11 2

]70

≡[

1 143143 144

]

(mod 286)

and since[

1 143143 144

] [

20

]

=

[

2286

]

≡[

20

]

(mod 286)

the vector [ 20 ] is mapped onto itself. This is also true for the vector [ 02 ], so therewill be |2 · 2− 0 · 0| = 4 miniatures orientated horizontally and vertically.

As we saw in Figure 2.1 the 289x289 pixels image appears to be upsidedown after 153 iterations. This can be considered as a special case of miniaturebut with only one miniature occurring whose orientation is determined by thecolumn vectors of

[

−1 00 −1

]

. Actually, the full image is not rotated, since thepixels with y-coordinate 0 will not be mapped to y = N−1. This can be seen inFigure 4.9. The fact that the full image is not rotated is also elementary whenconsidering that (0,0) is a trivial point.

Figure 4.9: A rotated image occurring after 7 iterations of Arnold’s cat map ona 13x13 pixels image

13

Page 17: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

5 Pell’s cat map

As we have seen, Arnold’s cat map with A = [ 1 11 2 ] and the two types of gener-

alized cat maps with G1 =[

1 aa a2+1

]

and G2 =[

1 ab ab+1

]

, all have determinant1. Taking the generalization of the cat map even further we can also allow formatrices with negative unit determinant.

A discrete mapping using the matrix P = [ 1 12 1 ] with determinant −1 is still

area preserving but also orientation reversing. As it turns out the matrix Pwill generate numbers in the Pell15 and half-companion Pell sequences, so Ptogether with the modulo N operation will henceforth be denoted Pell’s cat

map, ΓP : ZN × ZN → ZN × ZN where

ΓP

([

xn+1

yn+1

])

=

[

1 12 1

] [

xn

yn

]

(mod N).

The effect of Pell’s cat map on an image is shown in Figure 5.1. With thecorresponding notations so far used for the period and the minimal period ofArnold’s cat map we can conclude that ΠP (289) = 272, which is notably notthe same as ΠA(289) = 306 from Figure 2.1.

Original image n = 1 n = 2

n = 6 n = 136 n = 272

Figure 5.1: Effect of Pell’s cat map on a 289x289 pixels image after n iterations

As we can see from the numerical results depicted in Figure 5.2, and compar-ing this with Figure 4.1, the minimal periods of Pell’s cat map and of Arnold’scat map are generally not the same.

15After J. Pell 1611-1685

14

Page 18: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

0 10 20 30 40 50 60 70 80 90 1000

50

100

150

200

250

N

Π(N)

0 10 20 30 40 50 60 70 80 90 1000

0.5

1

1.5

2

2.5

3

N

Π(N)

N

Figure 5.2: Minimal periods ΠP (N) of Pell’s cat map and the ratio ΠP (N)/Nfor the interval 2 ≤ N ≤ 100

From Theorem 4.7 we know that the upper bound for the period of Arnold’scat map is ΠA(N) = 3N , for Pell’s cat map our numerical results suggestthat the upper bound is ΠP (N) = 8N/3. The remainder of this section willbe devoted to proving that this is true for all N ≥ 2. We will also state fourconjectures regarding properties of Pell’s cat map at the very end of this section.

5.1 Defining Pell’s cat map

Definition 5.1. Let the nth number of the Pell sequence be defined to bePn = 2Pn−1 + Pn−2 with P0 = 0 and P1 = 1.

Just like the Fibonacci sequence, the Pell sequence is a linear recurrence rela-tion of order 2. The first numbers of the Pell sequence are 0, 1, 2, 5, 12, 29, 70, 169,408, 985, . . .

If we also allow negative indices for the Pell numbers we have that P−1 = 1.This condition is essential in the forthcoming proofs.

Remark 5.2. The connection between the Pell sequence and Pell’s equations isthat xn = P2n+P2n−1 and yn = P2n are solutions to the equation x2

n−2y2n = 1.

We also have a sequence of numbers denoted Hn being the half-companionPell sequence16 defined to be Hn = 2Hn−1 +Hn−2 where H0 = 1 and H1 = 1,so the first numbers in this sequence are 1, 1, 3, 7, 17, 41, 99, 239, 577, 1393, . . .

Powers of the matrix P can be expressed using numbers from the Pell and

16This is half the value of the companion Pell or Pell-Lucas sequence defined to be Qn =2Qn−1 +Qn−2 where Q0 = 2 and Q1 = 2

15

Page 19: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

half-companion Pell sequences in the following way

Pn =

[

1 12 1

]n

=

[

Hn Pn

2Pn Hn

]

,

hence the first powers of the matrix P are

P 2 =

[

3 24 3

]

, P 3 =

[

7 510 7

]

, P 4 =

[

17 1224 17

]

, P 5 =

[

41 2958 41

]

, . . .

Moreover, it is also possible to use exclusively Pell numbers, so

Pn =

[

1 12 1

]n

=

[

Hn Pn

2Pn Hn

]

=

[

Pn + Pn−1 Pn

2Pn Pn + Pn−1

]

,

this is the form used hereinafter.

The characteristic polynomial of P is λ2−2λ−1, so the discriminant D = 8and the two eigenvalues17 are λ1 = 1 +

√2 ≈ 2.414214 and λ2 = 1 −

√2 ≈

−0.414214. Since both of the eigenvalues are different from one, Pell’s cat mapis a hyperbolic toral automorphism, just like Arnold’s cat map. Since P is nota symmetric matrix the eigenvectors are not orthogonal.

The effect of Pell’s cat map on the unit square is shown in Figure 5.3. Com-pare this to Figure 2.3 and note especially the orientation reversing character-istics of Pell’s cat map.

0 1 2 3

0

1

2

3

0 1 2 3

0

1

2

3

[ 1 12 1 ]

0 1 2 3

0

1

2

3

Modulo 1

Figure 5.3: The effect of Pell’s cat map on the unit square

Besides the fact that the minimal periods of Arnold’s cat map and Pell’scat map are not generally the same, it is of interest to point out a few otherdifferences between the two.

Unlike Arnold’s cat map, Pell’s cat map has two trivial points whenever Nis even. Besides (0, 0), the point (N2 , 0) is then also trivial since

[

1 12 1

] [

N/20

]

=

[

N/2N

]

≡[

N/20

]

(mod N).

Studying Arnold’s cat map we saw that, for all prime numbers except p = 5,all non-trivial points have the same orbit length. This is not the case for Pell’s

171 +√2 is also known as the silver ratio

16

Page 20: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

cat map, where numerical results suggests that, for about half of the prime num-bers of the form 8k ± 1, the non-trivial points has more than one orbit length.Figure 5.4 shows the orbit lengths for the prime numbers p = 5 and p = 7.

Figure 5.4: Orbit lengths of the points for Pell’s cat map for the prime numbersp = 5 and p = 7

Figure 5.5 shows the orbit lengths of the points for Pell’s cat map for thecomposite numbers N = 8 and N = 9. Note the two trivial points occurring forN = 8.

Figure 5.5: Orbit lengths of the points for Pell’s cat map for the compositenumbers N = 8 and N = 9

In Figure 5.6 we can see that the orbit of the point (1, 1) under Pell’s catmap is not the same as for Arnold’s cat map depicted earlier in Figure 4.3. Theorbit length for (1, 1) is 8, the same value as ΠP (6).

Figure 5.6: The orbit of the point (1,1) for Pell’s cat map with N = 6

17

Page 21: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

5.2 Some results from elementary number theory

For the proof of the theorem for the upper bound of the minimal period of Pell’scat map, and the lemmas leading up to it, we firstly need some results fromelementary number theory found in [17] by Rosen and in [16] by Ribenboim.

Definition 5.3. Let a be an integer and p an odd prime number. The Legendresymbol18 is defined to be

(

a

p

)

=

{

1 if a is a quadratic residue modulo p and a 6≡ 0 (mod p)

−1 if a is a quadratic nonresidue modulo p.

We may also adopt the convention that

(

a

p

)

= 0 when p divides a.

Example 5.4. So

(

2

7

)

= 1 since 3 · 3 = 9 ≡ 2 (mod 7).

Note that the congruence k2 ≡ 2 (mod 7) has not only the solution givenabove since we also have that 4 · 4 = 16 ≡ 2 (mod 7). The second solution k2can always be found by subtracting the first solution k21 ≡ a (mod p) from psince then

k22 ≡ −k21 ≡ (−1)2k21 ≡ k21 ≡ a (mod p).

Theorem 5.5. Wilson’s theorem19 If p is a prime number, then (p− 1)! ≡

−1 (mod p).

Proof. An easy computation shows that if p = 2, then (p−1)! = 1 ≡ −1 (mod 2)and if p = 3, then (p − 1)! = 2 ≡ −1 (mod 2). Now let p be a prime numbergreater than 3. For each integer a in 1 ≤ a ≤ p − 1 there exist an inverse a−1

such that aa−1 ≡ 1 (mod p).

Since 1 and p − 1 are their own inverses modulo p we can form pairs of allintegers from 2 to p − 2 such that the product of each pair is congruent to 1modulo p. If we multiply the result of all these pairs with 1 and p − 1 we willget 1 · 1 · 1 · · · · · 1 · (p− 1) ≡ −1 (mod p).

Example 5.6. Take p = 5, then (p− 1)! = 1 · 2 · 3 · 4 = 24 ≡ −1 (mod 5). Thiscan also serve as an example of the forming of pairs congruent to 1 modulo pmade in the proof. Consider the pair 2 · 3 = 6 ≡ 1 (mod 5), it easy to see that1 · (2 · 3) · 4 ≡ 1 · 1 · (5− 1) ≡ −1 (mod 5).

The converse of Wilson’s theorem is also true, so it can actually be used todemonstrate that a number is composite.

Example 5.7. Take p = 4, then (p− 1)! = 1 · 2 · 3 = 6 ≡ 2 (mod 4).

The proof of this is omitted here.

18After A-M. Legendre 1752-1833. The Legendre symbol is also sometimes called thequadratic residue symbol

19After J. Wilson 1741-1793

18

Page 22: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Theorem 5.8. Euler’s criterion20 Let a be an integer and p an odd prime

number, then(

a

p

)

≡ a(p−1)/2 (mod p).

Proof. First assume that there exist an integer such that k2 ≡ a (mod p), hence

a is a quadratic residue modulo p and

(

a

p

)

= 1. Using Fermat’s little theorem

we see thata(p−1)/2 = (k2)(p−1)/2 = kp−1 ≡ 1 (mod p),

so(

a

p

)

= 1 ⇒(

a

p

)

≡ a(p−1)/2 (mod p).

If

(

a

p

)

= −1 then a is a quadratic nonresidue modulo p and the congruence

k2 ≡ a (mod p) has no solutions.

For each integer i co-prime to p, there exists an integer j such that ij ≡a (mod p). Since a is a quadratic nonresidue there exist no i such that i2 ≡a (mod p). We can now group the residue classes modulo p, i.e. the integers1, 2, 3, · · · , p − 1 into (p − 1)/2 pairs where each pair (i, j) has the product a.Multiplying all these pairs together gives

(p− 1)! ≡ a(p−1)/2 (mod p).

Here we can use Wilson’s theorem

(p− 1)! ≡ −1 (mod p)

to conclude that−1 ≡ a(p−1)/2 (mod p).

This completes the proof of Euler’s criterion.

Example 5.9. Let p = 7 and a = 3 then 3(7−1)/2 = 33 = 27 ≡ −1 (mod 7), so(

3

7

)

= −1 which gives that 3 is a quadratic nonresidue modulo 7.

The multiplicative properties of the Legendre symbol

(

a

p

)(

b

p

)

=

(

ab

p

)

,

follows from Euler’s criterion, since if

(

a

p

)

≡ a(p−1)/2 (mod p),

(

b

p

)

≡ b(p−1)/2 (mod p)

and(

ab

p

)

≡ ab(p−1)/2 (mod p),

20After L. Euler 1707-1783

19

Page 23: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

we can conclude that(

a

p

)(

b

p

)

≡ a(p−1)/2b(p−1)/2 ≡ ab(p−1)/2 ≡(

ab

p

)

(mod p).

We will also need an expression for the nth Pell number, hence we show byinduction that the Binet formula21 is valid for the Pell sequence Pn = 2Pn−1 +Pn−2 with P1 = 1 and P2 = 2.

Theorem 5.10. The nth Pell number is

Pn =λn1 − λn

2

λ1 − λ2=

λn1 − λn

2

2√2

where λ1 = 1+√2 and λ2 = 1−

√2 are the eigenvalues of the matrix P=[ 1 1

2 1 ].

Proof. For n = 1

P1 =λ1 − λ2

λ1 − λ2=

1 +√2− 1 +

√2

1 +√2− 1 +

√2=

2√2

2√2= 1.

For n = 2

P2 =λ21 − λ2

2

λ1 − λ2=

(1 +√2)2 − (1−

√2)2

1 +√2− 1 +

√2

=

3 + 2√2− 3 + 2

√2

2√2

=4√2

2√2= 2.

For the induction assume that

Pn−1 =λn−11 − λn−1

2

2√2

and

Pn =λn1 − λn

2

2√2

.

Then

Pn+1 = 2Pn + Pn−1 =2(λn

1 − λn2 )

2√2

+λn−11 − λn−1

2

2√2

=

2λn1 − 2λn

2 + λn−11 − λn−1

2

2√2

=2λn

1 + λn−11 − 2λn

2 − λn−12

2√2

=

λn−11 (1 + 2λ1)− λn−1

2 (1 + 2λ2)

2√2

=λn−11 (3 + 2

√2)− λn−1

2 (3− 2√2)

2√2

=

λn−11 λ2

1 − λn−12 λ2

2

2√2

=λn+11 − λn+1

2

2√2

.

21After J. Binet 1786-1856

20

Page 24: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

5.3 A partition of the prime numbers

Using the Legendre symbol we divide the prime numbers into three disjoint sets

i p = 2

ii The set R consisting of all prime numbers of the form 8k ± 1From [16] we have that 2 is a quadratic residue modulo p for prime

numbers of this form, hence

R =

{

p

(

2

p

)

= 1

}

using that

(

2

p

)

= (−1)(p2−1)/8.

In the proof of Lemmas 5.16, 5.17 and Theorem 5.19, any prime number inthis set will be denoted by r, so we have that r ∈ R.

iii The set S will be all prime numbers of the form 8k ± 3For prime numbers of this form, 2 is a quadratic nonresidue modulo p, so

S =

{

p

(

2

p

)

= −1

}

,

and s ∈ S. Note that this set will also include p = 5, that for Arnold’s catmap had to be treated separately.

This division of the prime numbers agrees exactly with the second supple-

mentary law of quadratic reciprocity first proved by Euler.

The law of quadratic reciprocity tells us the connection between the existenceof a solution to the congruence k2 ≡ q (mod p) and the possibility to solvek2 ≡ p (mod q) where p and q are odd prime numbers and p 6= q. It wasformulated and proved by Euler, Legendre and Gauss22 in the study of quadraticDiophantine equations. The second supplementary law of quadratic reciprocitytells us that the congruence k2 ≡ 2 (mod p) is solvable if and only if p±1 (mod 8).

Remark 5.11. Pell’s equation x2−ny2 = 1 is a quadratic Diophantine equation,mistakenly named after Pell by Euler.

We say earlier that for Arnold’s cat map we related the prime numbers tothe discriminant of the characteristic polynomial of the matrix A. One mightask why we are not doing so here too where the discriminant is 8. However if 8is a quadratic residue modulo p then so is 2. This follows from the multiplicativeproperties of the Legendre symbol

(

ab

p

)

=

(

a

p

)(

b

p

)

,

so(

8

p

)

= 1 ⇒(

2

p

)(

2

p

)(

2

p

)

= 1 ⇒(

2

p

)

= 1.

22C. F. Gauss 1777-1855

21

Page 25: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

5.4 The upper bound for the minimal period of Pell’s cat

map

Here we will extend results regarding Arnold’s cat map to derive an explicitexpression for the upper bound for the minimal period of Pell’s cat map. Thefirst thing that we can conclude about the minimal period of Pell’s cat map isthat, due to the orientation reversing properties of the P matrix, it must alwaysbe even. This is not the case for Arnold’s cat map where both even and oddminimal periods occur, for example, ΠA(18) = 12 and ΠA(19) = 9.

To find the minimal period of Pell’s cat map we are looking for the numberof iterations necessary such that the nth Pell number is congruent to 0 (mod N)and the (n− 1)th Pell number is congruent to 1 (mod N).

Besides the results from Subsections 5.2 and 5.3 we will also need the twofollowing lemmas from Ribenboim [16].

Lemma 5.12. For numbers in the Pell sequence P 2n − Pn−1Pn+1 = (−1)n−1.

This is also known as Cassini’s identity23.

Lemma 5.13. The relationship Pi+j = PiPj+1+Pi−1Pj is true for numbers in

the Pell sequence.

The two lemmas can be proved by induction.

Lemma 5.14. For p = 2 the minimal period of Pell’s cat map ΠP (2) = 2.

Proof. By direct computation we have that

[

1 12 1

]2

=

[

3 24 3

]

≡[

1 00 1

]

(mod 2).

Remark 5.15. For Arnold’s cat map we have that ΠA(2) = ΠA(22) = ΠA(4) = 3.

This is not the case for Pell’s cat map since ΠP (2) = 2 6= ΠP (4) = 4. This factwill be used later on in the proof of Theorem 5.19.

In the following we will use ΨP (N) instead of ΠP (N) with the same meaningand background as for Arnold’s cat map. If we can prove that ΨP (N) ≤ 8N/3we will also have proven that ΠP (N) ≤ 8N/3 since ΠP (N) ≤ ΨP (N).

Furthermore we must utilize the division of the prime numbers made inSubsection 5.3. To shorten the notation we will write r and s without indices.Recall that λ1 = 1 +

√2 and λ2 = 1 −

√2 are the eigenvalues of the matrix

P = [ 1 12 1 ].

Lemma 5.16. For prime numbers r such that 2 is a quadratic residue modulo

r a period of Pell’s cat map ΨP (r) = r − 1.

Proof. We have λp1 = (1 +

√2)p and from the binomial theorem it follows that

λp1 =

(

p

0

)

1 +

(

p

1

)√2 + . . .+

(

p

p− 1

)

2(p−1)/2 +

(

p

p

)

2p/2 ≡ 1 + 2p/2 (mod p).

23After G. D. Cassini 1625-1712

22

Page 26: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Except for the first and the last one, p divides all the binomial coefficients, sothese are congruent to 0 (mod p) and can therefore be dropped.

Repeating this calculation for λ2 we have that λp2 ≡ 1− 2p/2 (mod p).

Using the Binet formula yields

Pp =λp1 − λp

2

2√2

≡ 2−1/2 · 2p/2 ≡ 2(p−1)/2 (mod p).

Since r is chosen from the set of prime numbers such that 2 is a quadraticresidue modulo p, it possible to use Euler’s criterion

(

a

p

)

≡ a(p−1)/2 (mod p)

to get(

2

r

)

≡ 2(r−1)/2 (mod r),

and we can conclude that(

2

r

)

= 1 ⇒ Pr ≡ 2(r−1)/2 ≡ 1 (mod r).

Using Cassini’s identity, P 2n − Pn−1Pn+1 = (−1)n−1, and in this case, since

r − 1 is always even and Pr ≡ 1 (mod r), it must follow that Pr−1Pr+1 ≡0 (mod r), so r must divide at least one of Pr−1 and Pr+1.

Since it is elementary that λp+11 = λp

1 · λ1 and λp+12 = λp

2 · λ2, we once againuse the Binet formula

Pp+1 =(λp

1 · λ1)− (λp2 · λ2)

2√2

.

Together with our former results λp1 ≡ 1 + 2p/2 (mod p) and λp

2 ≡ 1 −2p/2 (mod p), this becomes

Pp+1 ≡ (1 + 2p/2)(1 +√2)− (1− 2p/2)(1−

√2)

2√2

(mod p),

which after some calculation yields that Pp+1 ≡ 1 + 2(p−1)/2 (mod p). Since2(r−1)/2 ≡ 1 (mod r) we have Pr+1 ≡ 2 (mod r) and hence we can concludethat Pr−1 ≡ 0 (mod r).

We now have

Pr ≡ 1 (mod r) and Pr−1 ≡ 0 (mod r).

Inserting this into the relation Pi+j = PiPj+1 + Pi−1Pj with i = n, j = r − 1,we have

Pn+r−1 = PnPr + Pr−1Pn+1 ≡ Pn (mod r).

23

Page 27: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Since the definition of Pell sequence yields that P0 = 0 and P−1 = 1, we canconclude that

[

1 12 1

]0

=

[

P0 + P0−1 P0

2P0 P0 + P0−1

]

=

[

1 00 1

]

.

Therefore

[

1 12 1

]r−1

=

[

P0+r−1 + P−1+r−1 P0+r−1

2P0+r−1 P0+r−1 + P−1+r−1

]

≡[

P0 + P−1 P0

2P0 P0 + P−1

]

≡[

1 00 1

]

(mod r).

Hence ΨP (r) = r− 1 for all prime numbers r such that 2 is a quadratic residuemodulo r.

Lemma 5.17. For prime numbers s such that 2 is a quadratic nonresidue mod-

ulo s a period of Pell’s cat map ΨP (s) = 2(s+ 1).

Proof. Let us once again apply the expression Pp+1 ≡ 1+2(p−1)/2 (mod p) fromthe proof of Lemma 5.16. In this case, when 2(s−1)/2 ≡ −1 (mod s), we havethat Ps+1 ≡ 1− 1 ≡ 0 (mod s).

Recalling that Pi+j = PiPj+1 + Pi−1Pj , this time setting i = s + 1, j = n,we can conclude

Ps+1+n = Ps+1Pn+1 + PsPn ≡ −Ps (mod s),

and setting n = 0 leads to

[

1 12 1

]s+1

=

[

P0+s+1 + P−1+s+1 P0+s+1

2P0+s+1 P0+s+1 + P−1+s+1

]

≡[

−P0 − P−1 −P0

−2P0 −P0 − P−1

]

≡[

−1 00 −1

]

(mod s).

Obviously

[

1 12 1

]2(s+1)

≡[

−1 00 −1

]2

≡[

1 00 1

]

(mod s).

Hence ΨP (s) = 2(s + 1) for all prime numbers s such that 2 is a quadraticnonresidue modulo s.

To compute a period for any power of the prime factors of N , we will applythe following lemma from [13] by Hardy and Wright.

Lemma 5.18. If m ≡ 1 (mod pσ) and σ ≥ 1 then mp ≡ 1 (mod pσ+1).

The proof is omitted here.

Theorem 5.19. The upper bound for the minimal period of Pell’s cat map is

8N/3.

24

Page 28: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

Proof. This proof builds on the proof of Theorem 4.7 given in [9], but here wemust apply the aforegoing Lemmas 5.14, 5.16, 5.17, 5.18 and Remark 5.15.

From the Fundamental Theorem of Arithmetic we have that any integer Ncan be uniquely factorized as a product of powers of prime numbers, so

N = 2a2 · 3a3 · 5a5 · 7a7 · 11a11 · . . . =k∏

i=1

papi

i .

Using the partition of the prime numbers into the three types p = 2, R ={

p

(

2p

)

= 1

}

and S =

{

p

(

2p

)

= −1

}

from Subsection 5.3, any integer N

can be written as

N = 2γ ·(

r∈R

rαr

)(

s∈S

sβs

)

.

Using lemma 5.18, setting m = kr−1 and σ = 1, we have that if kr−1 ≡1 (mod r) then k(r−1)r ≡ 1 (mod r2), repeating this and inserting α ≥ 2 yieldsthat

kr−1 ≡ 1 (mod r) ⇒ k(r−1)rαr−1 ≡ 1 (mod rαr ).

Likewise,

k2(s+1) ≡ 1 (mod s) ⇒ k2(s+1)sβs−1 ≡ 1 (mod sβs).

Just as for Arnold’s cat map in [9] we can now make use of the propertiesof the least common multiple to get an explicit expression for a period of Pell’scat map for any composite number N ,

ΨP (N) = lcm

(

2γ ,∏

r∈R

(r − 1)rαr−1,∏

s∈S

2(s+ 1)sβs−1

)

.

Since

lcm (a, b) =k∏

i=1

pmax(ai,bi)i for any two integers a =

k∏

i=1

pai

i and b =k∏

i=1

pbii ,

we must have that

ΨP (N)

N=

(

r∈R

(1− r−1)

)(

s∈S

2(1 + s−1)

)(

p|ΨP (N)

p−kp

)

,

where kp is the total number of powers of any prime number p that appearredundantly in the terms of the expression for ΨP (N).

To find the largest possible ratio ΨP (N)/N it is evident that we must choose

prime factors s from the set S =

{

p

(

2p

)

= −1

}

. Note that all factors 2(s+1)

are divisible by 4, so if we choose just one prime factor from the set S thenk2 = 0. However choosing two prime factors from S will result in k2 = 2 and soon, which will reduce ΨP (N)/N .

25

Page 29: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

To maximize ΨP (N)/N we must choose only one prime number s such thatthe factor 2(1 + s−1) becomes as large as possible. It is now straightforwardthat we must choose the smallest possible prime number in S i.e. 3, resulting inΨP (N)/N = 2(1 + 1/3) = 8/3. The fact that ΠP (N) ≤ ΨP (N) completes theproof.

Example 5.20. To illustrate the computation of a period of Pell’s cat map wetake N = 49588 = 22 · r21 · s11 · r12 where r1 = 7, s1 = 11 and r2 = 23, so

ΨP (49588) = lcm(

22, (7− 1) · 7, 2(11 + 1), (23− 1))

=

lcm(

22, 2 · 3 · 7, 23 · 3, 2 · 11)

= (23 · 3 · 7 · 11) = 1848.

The prime numbers 2 and 3 appear redundantly in the expression ΨP (49588) =lcm

(

22, 2 · 3 · 7, 23 · 3, 2 · 11)

resulting in k2 = 4 and k3 = 1, so the calculationof ΨP (N)/N will be

ΨP (49588)

49588=

6

7· 2411

· 2223

· 2−4 · 3−1 =1848

49588≈ 0.037.

Calculating the minimal period numerically for N = 49588 we have thatΠP (49588) = 1848 = ΨP (49588). This agrees well with the fact that there areno short prime numbers in the factorization of 49588.

As indicated above we will, in a similar way as for Arnold’s cat map, fromtime to time encounter short prime numbers, and hence also composite numbers,such that in ΠP (N) < ΨP (N). For Pell’s cat map we have for example ΠP (29) =20 6= ΨP (29) = 60 and ΠP (41) = 10 6= ΨP (41) = 40. As we saw earlier forArnold’s cat map we had that ΠA(29) = 7 6= ΨA(29) = 14 but ΠA(41) =ΨA(41) = 20 so the set of short prime numbers are not the same for Pell’s andArnold’s cat maps. In Figure 5.7 the presence of short prime numbers can beseen below the two prominent lines 2(p+ 1) and (p− 1).

0 500 1000 1500 2000 2500 3000 3500 4000 4500 50000

2000

4000

6000

8000

10000

p

Π(p)

Figure 5.7: Minimal periods of Pell’s cat map for 2 ≤ p ≤ 5000

For 5 < p < 50000 we find that approximately 34% (1756/5130) are shortprime numbers for Pell’s cat map. With this sample size the short prime num-bers are unevenly distributed between the prime numbers, with a more commonoccurrence in the set R, i.e. prime numbers p for which 2 is a is a quadraticresidue modulo p. This uneven distribution can also be observed for Arnold’scat map, with a higher frequency of short prime numbers such that the discrim-inant D = 5 is a quadratic residue modulo p, in the interval 5 < p < 50000.

26

Page 30: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

For Pell’s cat map it is also possible to find Wall-Sun-Sun-type prime num-bers, e.g. ΠP (13) = ΠP (169) = 28. From [10] ΠP (p) = ΠP (p

2) is also true forp = 31 and p = 1546463. This is confirmed by a numerical verification. How-ever, the existence of such prime numbers, does not inflict with the theorem forthe upper bound for the minimal period of Pell’s cat map.

Just as for Arnold’s cat map in [9], we can sharpen the upper bound for theminimal period of Pell’s cat map further24.

Corollary 5.21. For k = 1, 2, 3, . . . the minimal period of Pell’s cat map is

ΠP (N) =8

3N when N = 3k,

ΠP (N) =12

5N when N = 5k,

ΠP (N) ≤ 24

11N for all other N.

Proof. This follows immediately from the proof of Theorem 5.19, taking theperiod lengths of the three lowest prime numbers s = 3, s = 5 and s = 11 fromthe set S of prime numbers such that 2 is a quadratic nonresidue modulo p.

5.5 An alternative mapping with the same period as Pell’s

cat map

Theorem 5.22. The mapping

ΓAltP

([

xn+1

yn+1

])

=

[

0 11 2

] [

xn

yn

]

(mod N)

will have the same minimal period as Pell’s cat map for all N.

Proof. Since we know that

[

1 12 1

]2

=

[

3 24 3

]

we can use the concept of topological conjugacy from [1] by Baake et al. to finda generalized cat map of type 1 or 2 with the same period as a mapping usingthe matrix [ 3 2

4 3 ].

To be topologically conjugate, and hence have the same minimal period forall N , the matrices must have the same determinant, trace and matrix greatest

common divisor (mgcd), where the latter is defined to be gcd(b, c, d− a) for a 2by 2 matrix

[

a bc d

]

. So the generalized cat map of type 1 with a = 2, i.e. usingthe matrix [ 1 2

2 5 ], with determinant 1, trace 6 and mgcd 2, will have the sameminimal period for all N as a mapping using [ 3 2

4 3 ].

What is left is to observe that[

0 11 2

]2

=

[

1 22 5

]

24Compare this result to Figure 5.2

27

Page 31: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

to conclude that the mappings ΓP with [ 1 12 1 ] and ΓAltP with [ 0 1

1 2 ] will have thesame minimal period for all N .

Note that although the minimal periods are the same, properties such as theorbits will differ since the eigenvectors of the two matrices are not the same.

Assuming that Chen et al. will publish a full theory for the generalized catmap of type 1 and 2, as they claim in [6], their work could be used to give analternative proof to Theorem 5.19 since Pell’s cat map will have exactly doublethe period as the type 1 generalized cat map with a = 2.

5.6 Conjectures regarding Pell’s cat map

Numerical results suggest that the following four conjectures hold.

Conjecture 5.23. The average value of the minimal period of Pell’s cat map

is higher than that of Arnold’s cat map when 2 ≤ N ≤ ∞.

So although the upper bound for the period of Pell’s cat map is lower thanthat of Arnold’s cat map we have the opposite when looking at the averageminimal period. For 2 ≤ N ≤ 50000 the average minimal period of Pell’s catmap is 0.371N while the corresponding value of Arnold’s cat map is 0.289N .

Conjecture 5.24. For Pell’s cat map only prime numbers of the form 8k ± 1can have more than one orbit length for the non-trivial points when N is a prime

number.

Studying Arnold’s cat map we saw that, except for p = 5, all non-trivialpoints have one and the same orbit length when N is a prime number. This isnot the case for the Pell’s cat map, where calculations suggests that, for about

half of the prime numbers in the set R =

{

p

(

2p

)

= 1

}

, the non-trivial points

have more than one orbit length.

Conjecture 5.25. Although the sets of short prime numbers are different for

Arnold’s and Pell’s cat maps, the fraction of such numbers are asymptotically

the same.

For prime numbers 5 < p < 50000 we have 33% short prime numbers forArnold’s cat map and 34% for Pell’s cat map.

Conjecture 5.26. There exists infinitely many Wall-Sun-Sun-type prime num-

bers for Pell’s cat map.

These are prime numbers such that ΠP (p) = ΠP (p2). Since we have nu-

merically verified that this is true for the prime numbers p = 13, p = 31 andp = 1546463, we conjecture that there are infinitely many such numbers.

28

Page 32: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

6 Applications

Abstract as the concept of the cat map may seem, several applications of it arenot far-fetched. In the following section we shall briefly review some possibleapplications of Arnold’s cat map and its generalizations.

6.1 Encryption of images and text

One of the simplest possible ways to use Arnold’s cat map in a cryptographiccontext is to replace the color information of the individual pixel with a let-ter of the plaintext. A suitable number of iterations act as a transpositioncipher producing a ciphertext where the seemingly unordered letters actuallyhave an underlying order, enabling the holder of the key to retrieve the plain-text. Using a generalized cat map where the elements of the matrix are partof the key will complicate a cryptanalysis further. Figure 6.1 illustrates howthe plaintext mathematics is not a spectator sport is encrypted as CTTT

RAMEHSAO SITOA SOIAPT MCE TRNPS after two iterations of Arnold’s cat map.

m a t h e m

a t i c s

i s n o t

a s p e

c t a t o r

s p o r t

C T T T R

A M E H S A

O S I T O

A S O I A

P T M C E

T R N P S

Figure 6.1: The plaintext and the resulting ciphertext after two iterations ofArnold’s cat map

As aforementioned in Subsection 4.3, an image encryption system is proposedin [11], using an 8-dimensional cat map as a pseudo random number generator,where an initial point is part of the key and the output sequence is the chaoticlooking orbit of that point.

6.2 Steganography, watermarks and image tampering de-

tection

Steganography is the art of concealing a message within another message. Thiscan also apply to images and be used to insert a watermarking into an imageor to detect if an image has been altered in an unauthorized way i.e. imagetampering detection.

This method utilize that a collection of neighboring pixels are spread acrossthe surface of the N by N pixels image after k iterations of Arnold’s cat map.The pixels of a relatively small watermark is spread across the larger imagesurface and, without being noticed, inserted into the image we want to mark.The image tampering detection algorithm iterates the image ΠA(N)− k times.The image appears chaotic but the watermark should appear intact if the imageis unaffected. In [8] this method is used to detect the unwanted addition ofthree bananas into a picture of a baboon.

29

Page 33: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

7 Conclusions

This thesis was intended to investigate some properties, and especially the pe-riod modulo N , of the two dimensional hyperbolic toral automorphism, stronglyconnected to the Fibonacci sequence, called Arnold’s cat map. This also in-cluded its generalizations with positive unit determinant. Doing so a novelmapping with negative unit determinant, called Pell’s cat map, was defined.The name was chosen due to the relationship with the sequence of Pell numbers.

The methods of the proof for the existence of an upper bound for the min-imal period of Arnold’s cat map was carried over to this map and the mainresult of the thesis is hence a theorem stating that the minimal period of Pell’scat map is always equal to or shorter than 8N/3. Here N is the number ofrows or columns of the object e.g. an image, used to visualize the effects of thediscrete-time dynamical system that the mapping induces.

However, the solution falls short of providing a closed form expression forthe exact minimal period for all choices of N , since we lack a complete theoryfor the occurrence of what we referred to as short prime numbers. This is alsotrue for Arnold’s cat map although the sets of such numbers are not one andthe same.

From numerical results four conjectures regarding properties of Pell’s catmap was also stated. Indeed these conjectures demonstrates some of the differ-ences found when trying to relate Pell’s cat map to Arnold’s cat map. Finding aproof for some or all of them could be the objective of further work concerningPell’s cat map.

Such work could also include a closer look at the distribution of short primenumbers or an extended search for Wall-Sun-Sun-type prime numbers for Pell’scat map, i.e. prime numbers for which ΠP (p) = ΠP (p

2). As it is conjecturedthat if such number is found for Arnold’s cat map, then there must be infinitelymany, so maybe it is likewise possible to find more than the three presented inthis thesis for Pell’s cat map.

Some interesting applications of Arnold’s cat map within the cryptographicarea were also briefly reviewed in this thesis, showing that the practical relevanceof this area of mathematics is not so far-fetched as it may first appear.

30

Page 34: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

References

[1] Baake M. et al. (2008), Periodic orbits of linear endomorphisms on the 2-torus and its lattices, Nonlinearity, Vol 21 pp 2427-2446, IOP publishingLtd and London Mathematical society.http://web.maths.unsw.edu.au/~jagr/BRW08.pdf

(downloaded 140220)

[2] Bao J. & Yang Q. (2012), Period of the discrete Arnold cat map and gen-eral cat map, Nonlinear Dynamics, Vol 70.2 pp 1365-1375, Springer Sci-ence+Business Media.http://link.springer.com/article/10.1007%2Fs11071-012-0539-3

(downloaded 140116)

[3] Behrends E. (1998), The ghosts of the cat, Ergodic Theory and Dynamical

Systems, Vol 18 pp 321 - 330, Cambridge University Press.http://journals.cambridge.org/action/displayAbstract?

fromPage=online&aid=32347

(downloaded 140118)

[4] Brother A. U. (1963), Additional factors of the Fibonacci and Lucas series,Fibonacci quarterly, Vol 1.1 pp 34-42, The Fibonacci Association.http://www.fq.math.ca/Scanned/1-1/alfred1.pdf

(downloaded 140501)

[5] Chen F. et al. (2012), Period distribution of generalized discrete Arnoldcat map for N = pe, IEEE Transactions on information theory, Vol 58.1pp 445-452, IEEE.http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&

arnumber=6121983

(downloaded 140116)

[6] Chen F. et al. (2013), Period distribution of the generalized discreteArnold cat map for N = 2e, IEEE Transactions on information theory,Vol 59.5 pp 3249-3255, IEEE.http://ieeexplore.ieee.org/xpl/articleDetails.jsp?tp=&

arnumber=6392276

(downloaded 140116)

[7] Chen G. et al. (2004), A symmetric image encryption scheme based on3D chaotic cat maps, Chaos, Solitons and Fractals, Vol 21 pp 749-761,Elsevier.http://www.sciencedirect.com/science/article/pii/

S0960077903006672

(downloaded 140127)

[8] Chen Y-L. et al. (2013), A maximum entropy-based chaotic time-variantfragile watermarking scheme for image tampering detection, Entropy, Vol15 pp 3170-3185, Multidisciplinary Digital Publishing Institute.www.mdpi.com/1099-4300/15/8/3170/pdf

(downloaded 140127)

31

Page 35: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

[9] Dyson F. J. & Falk H. (1992), Period of a discrete cat mapping, The Ameri-

can Mathematical Monthly, Vol 99.7 pp 605-614, Mathematical Associationof America.http://www.jstor.org/stable/2324989

(downloaded 140118)

[10] Elsenhans A-S. & Jahnel J. (2010), The Fibonacci sequence modulo p2 -an investigation by computer for p < 1014, Cornell University Library.http://arxiv.org/pdf/1006.0824v1

(downloaded 140427)

[11] Ganesan K. & Murali K. (2014), Image encryption using eight dimensionalchaotic cat map, The European Physical Journal: Special Topics, March2014, EDP Sciences, Springer-Verlag.http://link.springer.com/content/pdf/10.1140/epjst/

e2014-02123-1

(downloaded 140322)

[12] Gaspari G. (1994), The Arnold cat map on prime lattices, Physica D, Vol73.4 pp 352-372, Elsevier.http://www.sciencedirect.com/science/article/pii/

0167278994901058

(downloaded 140130)

[13] Hardy G. H. & Wright E. M. (1980), An introduction to the theory of

numbers, 5th edition, Oxford University Press. ISBN 9780198531715.

[14] Nance J. (2011), Periods of the discretized Arnold’s cat mapping and itsextension to n-dimensions, Cornell University Library.http://arxiv.org/abs/1111.2984v1

(downloaded 140116)

[15] Neumärker N. (2012), The arithmetic structure of discrete dynamical sys-

tems on the torus, Dissertation zur erlangung des Doktorgrades der Math-

ematik an der Fakultät für Mathematik der Universität Bielefeld.

https://pub.uni-bielefeld.de/download/2508475/2508565

(downloaded 140127)

[16] Ribenboim P. (2004), The little book of bigger primes, 2nd edition, Springer.ISBN 0387201696.

[17] Rosen K. H. (2005), Elementary number theory and its applications, 5thedition, Pearson. ISBN 0321263146.

[18] Svensson P-A. (2001), Abstrakt algebra, Studentlitteratur. ISBN9789144012629.

[19] Wall D. D. (1960), Fibonacci series modulo m, The American Mathematical

Monthly, Vol. 67.6 pp 525-532, Mathematical Association of America.http://www.jstor.org/stable/2309169

(downloaded 140420)

32

Page 36: Properties of a generalized $UQROG¶VGLVFUHWHFDWPDS725545/... · 2014. 6. 17. · modulo N operation, so for simplicity of notation we will write Arnold's cat map instead of Arnold's

SE-391 82 Kalmar / SE-351 95 Växjö

Tel +46 (0)772-28 80 00

[email protected]

Lnu.se/fakulteten-for-teknik

Department of Mathematics