CS 405 Algorithms: Farey Sequences the Farey Sequence Fn Is the (Finite) Sequence of Rational Numbers from the Closed Unit Inter

Total Page:16

File Type:pdf, Size:1020Kb

CS 405 Algorithms: Farey Sequences the Farey Sequence Fn Is the (Finite) Sequence of Rational Numbers from the Closed Unit Inter CS 405 Algorithms: Farey Sequences The Farey sequence Fn is the (finite) sequence of rational numbers from the closed unit interval [0, 1] that have representations with denominator less than or equal to n, in ascending order. Fn is sometimes called the Farey Series even though it is not a series. Thus, for example, F3 is 0 1 1 2 1 , , , , . 1 3 2 3 1 FareySequence is pseudo-code for a Brute Force algorithm to generate Fn. The first part of the code creates all possible fractions, using the auxillary Euclidean algorithm program GCD to reject anything not in lowest terms. The construction is completed by calling a sorting algorithm FracSort to put the fractions in proper order. FracSort knows that [a, b] represents a larger fraction than [c, d] when ad − bc is positive, and sorts the array according to this ordering of the pairs. A critical fact needed to use an array is that Fn contains fewer than n2 fractions. Algorithm FareySequence(n) Integer k, a, b; Array A[0..n2] // declare variables A[0] ← [0, 1]; A[1] ← [1, 1]; // initialize variables k ← 2 // Current number of fractions for b ← 1 to n do for a ← 1 to b − 1 do if GCD(a, b) = 1 //check for lowest terms then A[k] ← [a, b]; // add to array A k ← k + 1; fi endfor endfor FracSort(A[0..k − 1]) // Sorting routine puts things in order return A[0..k − 1] end In order to develop more efficient algorithms for generating Farey sequences we need more insight into the nature of these objects. Toward that end we make some observations. Fractions which are neighboring terms of a Farey sequence are known as a Farey pair. a c a c If b and d are a Farey pair, both in lowest terms with b > d , then their difference is a c ad−bc 1 b − d = bd = bd . Moreover, any two fractions with such a difference are both reduced a to lowest terms and neighbors in all Fn with n < b + d. For n = b + d the mediant of b c a+c and d , namely the fraction b+d , is reduced and falls between the two fractions, so it slips into Fn. These facts can be exploited to generate Farey sequences, either recursively or 1 iteratively. For example, using F3 above we can easily compute F4 by adding those mediants with denominator 4, obtaining 0 1 1 1 2 3 1 , , , , , , ; 1 4 3 2 3 4 1 Doing this again yields F5, which is 0 1 1 1 2 1 3 2 3 4 1 , , , , , , , , , , . 1 5 4 3 5 2 5 3 4 5 1 In fact the middle of any three consecutive terms is the mediant of its neighbors even though 1 1 2 1 it might need to be reduced (between 5 and 3 we find 8 = 4 ). This offers one hope that it may be possible to generate the terms of Fn in order since we konow the first two terms are 0 1 1 and n . For n ≥ 2 the sequence of denominators is symmetrical, has odd length, and has a 2 in 1 the middle position (since 2 is the middle term). Can you give a recurrence relation for the length (number of terms) of Fn? At the most Fn has n − 1 more fractions than Fn−1 (and this happens only when n is prime). How about a (big Oh) bound on the growth of the length of Fn?(Hint: The recurrence involves the Euler phi function φ(n).) 2.
Recommended publications
  • Farey Error Correcting Coding Text, Data and Images
    International Journal of Applied Engineering Research ISSN 0973-4562 Volume 14, Number 9 (2019) pp. 2207-2211 © Research India Publications. http://www.ripublication.com Farey Error Correcting Coding Text, Data and Images Poornima M1 , S. Jagannathan2, R Chandrasekhar3, S.T. Kumara4 1 Mathematics Department , SJB Institute of Technology, Bangalore, Karnataka, India. 2 Computer Science & Engineering Department, Nagarjuna College of Engineering & Technology, Bangalore, Karnataka, India. 3 MCA Department, PESIT Research, Bangalore, Karnataka, India. 4 A P S College of Engineering, Bangalore, 560082, Karnataka, India. Abstract: 2. PRINCIPLES AND AXIOMS OF THE FAREY SEQUENCE A new scheme for encryption and decryption of plain text, data and the coding of medical images through Farey Farey Sequences for Farey1...Farey8 which are irreducible or Sequence is brought in the paper. It proposes the reduced simple decimal division quantities in [0, 1] for a given n is arithmetic point representations and more of integer and given below. whole number point implementations. The test case and Farey1 = [ 0/1, 1/1 ] outcomes are explained in the section 4 and 5. Farey2 = [ 0/1, ½, 1/1 ] Keywords: Error correcting codes, image coding, reduced arithmetic floating point, fixed point, digital signal Farey3 = [ 0/1, 1/3, ½, 2/3, 1/1 ] processing and farey sequences Farey4 = [0/1, ¼, 1/3, ½, 2/3, ¾, 1/1] Farey5 = [ 0/1,1/5 ,1/4, 1/3, 2/5, 1/2 ,3/5, 2/3, 4/5, 1/1] 1. INTRODUCTION The efficacy of Farey sequence applications for error correcting codes and image processing are brings out in the Farey6 = [ 0/1, 1/6,/5, ¼, 1/3, 2/5, ½, 3/5, 2/3, ¾, 4/5, paper.
    [Show full text]
  • Multidimensional Farey Partitions by Arnaldo Nogueira a and Bruno
    Indag. Mathem., N.S., 17 (3), 437-456 September 25, 2006 Multidimensional Farey partitions by Arnaldo Nogueira a and Bruno Sevennec b a Institut de Math~matiques de Luminy, 163, avenue de Luminy, 13288 Marseille, Cedex 9, France b Unit~ de MathOmatiques Pures etAppliquOes, Ecole Normale Sup&ieure de Lyon, 46, allOe d'Italie, 69364 Lyon, Cedex 7, France Communicated by Prof. R. Tijdeman at the meeting of October 31, 2005 ABSTRACT The linear action of SLfn, Z+) induces lattice partitions on the (n - 1)-dimensional simplex An-b The notion of Farev partition raises naturally from a matricial interpretation of the arithmetical Farey sequence of order r. Such sequence is unique and, consequently, the Fareypartition of order r on Al is unique. In higher dimension no generalized Farey partition is unique. Nevertheless in dimension 3 the number of triangles in the various generalized Farey partitions is always the same which fails to be true in dimension n > 3. Concerning Diophantine approximations, it turns out that the vertices of an n-dimensional Farey partition of order r are the radial projections of the lattice points in Zn~ N [0, r] n whose coordinates are relatively prime. Moreover, we obtain sequences of multidimensional Farey partitions which converge pointwisely. 1. INTRODUCTION The Farey or intermediate fractions are our motivation. We introduce the notion of matricial Farey tree, where matrices of the unimodular group replace the fractions. The matricial approach generalizes to higher dimension the so-called Farey sequence of order r (Hardy and Wright [6, p. 23]). For r 6 N = {1, 2 ...
    [Show full text]
  • Farey Fractions
    U.U.D.M. Project Report 2017:24 Farey Fractions Rickard Fernström Examensarbete i matematik, 15 hp Handledare: Andreas Strömbergsson Examinator: Jörgen Östensson Juni 2017 Department of Mathematics Uppsala University Farey Fractions Uppsala University Rickard Fernstr¨om June 22, 2017 1 1 Introduction The Farey sequence of order n is the sequence of all reduced fractions be- tween 0 and 1 with denominator less than or equal to n, arranged in order of increasing size. The properties of this sequence have been thoroughly in- vestigated over the years, out of intrinsic interest. The Farey sequences also play an important role in various more advanced parts of number theory. In the present treatise we give a detailed development of the theory of Farey fractions, following the presentation in Chapter 6.1-2 of the book MNZ = I. Niven, H. S. Zuckerman, H. L. Montgomery, "An Introduction to the Theory of Numbers", fifth edition, John Wiley & Sons, Inc., 1991, but filling in many more details of the proofs. Note that the definition of "Farey sequence" and "Farey fraction" which we give below is apriori different from the one given above; however in Corollary 7 we will see that the two definitions are in fact equivalent. 2 Farey Fractions and Farey Sequences We will assume that a fraction is the quotient of two integers, where the denominator is positive (every rational number can be written in this way). A reduced fraction is a fraction where the greatest common divisor of the 3:5 7 numerator and denominator is 1. E.g. is not a fraction, but is both 4 8 a fraction and a reduced fraction (even though we would normally say that 3:5 7 −1 0 = ).
    [Show full text]
  • A Scaling Property of Farey Fractions
    European Journal of Mathematics (2016) 2:383–417 DOI 10.1007/s40879-016-0098-0 RESEARCH ARTICLE A scaling property of Farey fractions Matthias Kunik1 Received: 18 September 2015 / Revised: 26 January 2016 / Accepted: 28 January 2016 / Published online: 25 February 2016 © Springer International Publishing AG 2016 Abstract The Farey sequence of order n consists of all reduced fractions a/b between 0 and 1 with positive denominator b less than or equal to n. The sums of the inverse denominators 1/b of the Farey fractions in prescribed intervals with rational bounds have a simple main term, but the deviations are determined by an interesting sequence of polygonal functions fn.Forn →∞we also obtain a certain limit function, which describes an asymptotic scaling property of functions fn in the vicinity of any fixed fraction a/b and which is independent of a/b. The result can be obtained by using only elementary methods. We also study this limit function and especially its decay behaviour by using the Mellin transform and analytical properties of the Riemann zeta function. Keywords Farey sequences · Riemann zeta function · Mellin transform · Hardy spaces Mathematics Subject Classification 11B57 · 11M06 · 44A20 · 42B30 1 Introduction The Farey sequence Fn of order n consists of all reduced fractions a/b with natural denominator b n in the unit interval [0, 1], arranged in order of increasing size. Dropping just the restriction 0 a/b 1 gives the infinite extended Farey sequence Fext n of order n. We use these notations from Definitions 2.1 and 2.3 and present an overview of new results in each section.
    [Show full text]
  • Some Applications of the Spectral Theory of Automorphic Forms
    Academic year 2009-2010 Department of Mathematics Some applications of the spectral theory of automorphic forms Research in Mathematics M.Phil Thesis Francois Crucifix Supervisor : Doctor Yiannis Petridis 2 I, Francois Nicolas Bernard Crucifix, confirm that the work presented in this thesis is my own. Where information has been derived from other sources, I confirm that this has been indicated in the thesis. SIGNED CONTENTS 3 Contents Introduction 4 1 Brief overview of general theory 5 1.1 Hyperbolic geometry and M¨obius transformations . ............. 5 1.2 Laplaceoperatorandautomorphicforms. ......... 7 1.3 Thespectraltheorem.............................. .... 8 2 Farey sequence 14 2.1 Fareysetsandgrowthofsize . ..... 14 2.2 Distribution.................................... 16 2.3 CorrelationsofFareyfractions . ........ 18 2.4 Good’sresult .................................... 22 3 Multiplier systems 26 3.1 Definitionsandproperties . ...... 26 3.2 Automorphicformsofnonintegralweights . ......... 27 3.3 Constructionofanewseries. ...... 30 4 Modular knots and linking numbers 37 4.1 Modularknots .................................... 37 4.2 Linkingnumbers .................................. 39 4.3 TheRademacherfunction . 40 4.4 Ghys’result..................................... 41 4.5 SarnakandMozzochi’swork. ..... 43 Conclusion 46 References 47 4 Introduction The aim of this M.Phil thesis is to present my research throughout the past academic year. My topics of interest ranged over a fairly wide variety of subjects. I started with the study of automorphic forms from an analytic point of view by applying spectral methods to the Laplace operator on Riemann hyperbolic surfaces. I finished with a focus on modular knots and their linking numbers and how the latter are related to the theory of well-known analytic functions. My research took many more directions, and I would rather avoid stretching the extensive list of applications, papers and books that attracted my attention.
    [Show full text]
  • Sequences, Their Application and Use in the Field of Mathematics
    SEQUENCES, THEIR APPLICATION AND USE IN THE FIELD OF MATHEMATICS Gabe Stevens 5c1 STEVENS GABE – 5CL1 – 2019/2020 Stevens Gabe 5CL1 2019/2020 Table of Contents Table of Contents ............................................................................................................. 1 Introduction ..................................................................................................................... 3 What is a sequence ........................................................................................................... 4 The difference between a set and a sequence ................................................................... 4 Notation ........................................................................................................................... 5 Indexing (Rule) ......................................................................................................................... 6 Recursion ................................................................................................................................. 7 Geometric and arithmetic sequences ................................................................................ 8 Geometric sequences ............................................................................................................... 8 Properties....................................................................................................................................................... 8 Arithmetic sequence ...............................................................................................................
    [Show full text]
  • Arxiv:1710.02996V5 [Math.CO] 21 May 2018 Solutions of Problem II Such That A1 + A2 + ··· + an = 3N − 6, and Triangulations of N-Gons
    PARTITIONS OF UNITY IN SL(2; Z), NEGATIVE CONTINUED FRACTIONS, AND DISSECTIONS OF POLYGONS VALENTIN OVSIENKO Abstract. We characterize sequences of positive integers (a1; a2; : : : ; an) for which the 2 × 2 matrix ! ! ! an −1 an−1 −1 a1 −1 ··· is either the identity matrix Id, its negative −Id, or 1 0 1 0 1 0 square root of −Id. This extends a theorem of Conway and Coxeter that classifies such solutions subject to a total positivity restriction. 1. Introduction and main results Let Mn(a1; : : : ; an) 2 SL(2; Z) be the matrix defined by the product ! ! ! an −1 an−1 −1 a1 −1 (1.1) Mn(a1; : : : ; an) := ··· ; 1 0 1 0 1 0 where (a1; a2; : : : ; an) are positive integers. In terms of the generators of SL(2; Z) 0 −1 ! 1 1 ! S = ;T = ; 1 0 0 1 an an−1 a1 the matrix (1.1) reads: Mn(a1; : : : ; an) = T ST S ··· T S. Every matrix A 2 SL(2; Z) can be written in the form (1.1) in many different ways. The goal of this paper is to describe all solutions of the following three equations Mn(a1; : : : ; an) = Id; (Problem I) Mn(a1; : : : ; an) = −Id; (Problem II) 2 Mn(a1; : : : ; an) = −Id: (Problem III) Problem II, with a certain total positivity restriction, was studied in [8, 7] under the name of \frieze patterns". The theorem of Conway and Coxeter [7] establishes a one-to-one correspondence between the arXiv:1710.02996v5 [math.CO] 21 May 2018 solutions of Problem II such that a1 + a2 + ··· + an = 3n − 6, and triangulations of n-gons.
    [Show full text]
  • Numerical Calculation of Automorphic Functions for Finite Index Subgroups
    Numerical calculation of automorphic functions for finite index subgroups of triangle groups Dissertation zur Erlangung des Doktorgrades (Dr. rer. nat.) der Mathematisch-Naturwissenschaftlichen Fakult¨at der Rheinischen Friedrich-Wilhelms-Universit¨at Bonn von Stefan Kr¨amer aus Lahnstein Bonn, 2015 Dieser Forschungsbericht wurde als Dissertation von der Mathematisch-Naturwissenschaftlichen Fakult¨at der Universit¨at Bonn angenommen und ist auf dem Hochschulschriftenserver der ULB Bonn http://hss.ulb.uni-bonn.de/diss_online elektronisch publiziert. 1. Gutachter: Prof. Dr. Hartmut Monien 2. Gutachter: Prof. Dr. Bas Edixhoven Tag der Promotion: 03. Juli 2015 Erscheinungsjahr: 2015 Contents 1. Introduction 1 Outline of this work . 1 Notations and terminology . 3 2. Hyperbolic geometry and Fuchsian groups 5 Introduction to hyperbolic geometry . 5 Fuchsian groups . 11 Fundamental domains and Riemann surfaces . 13 Coverings . 17 3. Automorphic forms and functions 21 Automorphic forms . 22 The rational covering RΓ .............................. 27 4. Triangle groups 29 Introduction to triangle groups . 29 Geometric realizations of the triangle groups ∆(a, b, ∞) . 31 Subgroups and permutations . 38 5. Dessins d’enfants 43 Bely˘ıfunctions . 43 Dessins d’enfants . 44 Subgroups of triangle groups . 46 Computation of Bely˘ıfunctions . 47 6. Generalized Farey symbols 51 Special polygons . 52 Generalized Farey symbols . 56 Algorithms for generalized Farey symbols . 61 An example of a (2, 4)-Farey symbol – discussed in detail . 68 7. The Schwarzian derivative 73 Introduction to the Schwarzian derivative . 73 Conformal mappings . 75 The calculation of the hauptmodul for triangle groups . 79 The Picard-Fuchs equation . 81 iii Contents 8. Numerics 85 Series expansions . 85 The FEM-method for the calculation of a hauptmodul .
    [Show full text]
  • Arxiv:1403.2928V2 [Math.NT] 21 Mar 2014 B
    An arborist's guide to the rationals KATHERINE E. STANGE Abstract. There are two well-known ways to enumerate the positive rational numbers in an infinite binary tree: the Farey/Stern-Brocot tree and the Calkin-Wilf tree. In this brief note, we describe these two trees as `transpose shadows' of a tree of matrices (a result due to Backhouse and Ferreira) via a new proof using yet another famous tree of rationals: the topograph of Conway and Fung. 1. Four Trees In 2000, Calkin and Wilf studied an explicit enumeration of the positive rationals which naturally arranges itself into an infinite tree [5], the first few levels of which are shown here: 1 1 1 2 2 1 1 3 2 3 3 2 3 1 1 4 3 5 2 5 3 4 4 3 5 2 5 3 4 1 1 5 4 7 3 8 5 7 2 7 5 8 3 7 4 5 5 4 7 3 8 5 7 2 7 5 8 3 7 4 5 1 a The generation rule is that a parent b has the following left and right children: a arXiv:1403.2928v2 [math.NT] 21 Mar 2014 b a a+b a+b b Date: October 18, 2018, Draft #1. 2010 Mathematics Subject Classification. Primary: 11B57, Secondary: 11E99. Key words and phrases. special linear group, topograph, M¨obiustransformation, tree, enumeration. The author's research has been supported by NSA Grant Number H98230-14-1-0106 . 1 2 KATHERINE E. STANGE Every positive rational number appears in this tree exactly once.
    [Show full text]
  • Farey Sequences and Ford Circles
    Marin Math Circle [email protected] Farey Sequences and Ford Circles Definition 1 Farey Sequence. The Farey sequence of order n, denoted Fn is the sequence of completely reduced fractions between 0 and 1 which, in lowest terms, have denominators less than or equal to n, arranged in order of increasing size. F = 0/1, 1/1 1 { } F = 0/1, 1/2, 1/1 2 { } F = 0/1, 1/3, 1/2, 2/3, 1/1 3 { } Definition 2 Ford Circle. For every rational number p/q in lowest terms, the Ford circle C(p, q) is the circle with center p 1 1 1 ( , ) and radius . This means that C(p, q) is the circle tangent to the x-axis at x = p/q with radius . Observe q 2q2 2q2 2q2 that every small interval of the x-axis contains points of tangency of infinitely many Ford circles. May 11, 2011 1 Lattice Point Geometry Marin Math Circle [email protected] Problems. 1. Suppose that p1/q1 and p2/q2 are two successive terms of Fn. In this problem, we will use Pick’s Theorem to prove that p q p q = 1. Let T be the triangle with vertices (0, 0), (p ,q ), and (p ,q ). 2 1 − 1 2 1 1 2 2 (a) Show that T has no lattice points in its interior, i.e. I(T ) = 0. (b) Show that the only boundary points of T are the vertices of the triangle, i.e. B(T ) = 3. (c) Conclude, using Pick’s Theorem, that 1 A(T )= .
    [Show full text]
  • A Farey Sequence of Fibonacci Numbers
    A FAREY SEQUENCE OF FIBONACCI NUMBERS KRISHWASWASV1I ALLADI Vlvekananda College, Madras-600004, India The Farey sequence is an old and famous set of fractions associated with the integers. We here show that if we form a Farey sequence of Fibonacci Numbers, the properties of the Farey sequence are remarkably preserved (see [2]). In fact we find that with the new sequence we are able to observe and identify "points of symmetry/' "inter- vals," "generating fractions" and "stages." The paper is divided into three parts. In Part 1, we define "points of symmetry," "intervals" and "generating fractions" and discuss general properties of the Farey sequence of Fibon- acci numbers. In Part 2, we define conjugate fractions and deal with properties associated with intervals. Part 3 con- siders the Farey sequence of Fibonacci numbers as having been divided into stages and contains properties associated with "corresponding fractions" and "corresponding stages." A generalization of the Farey sequence of Fibonacci numbers is given at the end of the third part. th The Farey sequence of Fibonacci numbers of order Fn (where Fn stands for the n term of the Fibonacci se- quence) is the set of all possible fractions Fj/Fj, l=Q, 1, Z 3, —, n - 1, j = 1, 2, 3, —, n (i <j) arranged in ascend- ing order of magnitude. The last term is 1/1, i.e., Fj /F2. The first term is 0/Fn^j. We set FQ = O so that FQ +Ff = F2,F1 = F2=1. For convenience we denote a Farey sequence of Fibonacci numbers by f-f, that of order Fn by f-fn and the th r term in the new Farey sequence of order Fn by f(r)n .
    [Show full text]
  • Sara Munday Phd Thesis
    FINITE AND INFINITE ERGODIC THEORY FOR LINEAR AND CONFORMAL DYNAMICAL SYSTEMS Sara Ann Munday A Thesis Submitted for the Degree of PhD at the University of St. Andrews 2012 Full metadata for this item is available in Research@StAndrews:FullText at: http://research-repository.st-andrews.ac.uk/ Please use this identifier to cite or link to this item: http://hdl.handle.net/10023/3220 This item is protected by original copyright Finite and Infinite Ergodic Theory for Linear and Conformal Dynamical Systems. S. Munday i Abstract The first main topic of this thesis is the thorough analysis of two families of piecewise linear maps on the unit interval, the a-Lüroth and a-Farey maps. Here, a denotes a countably infinite partition of the unit interval whose atoms only accumulate at the origin. The basic properties of these maps will be developed, including that each a-Lüroth map (denoted La ) gives rise to a series expansion of real numbers in [0;1], a certain type of Generalised Lüroth Series. The first example of such an expansion was given by Lüroth. The map La is the jump transformation of the corresponding a-Farey map Fa . The maps La and Fa share the same relationship as the classical Farey and Gauss maps which give rise to the continued fraction expansion of a real number. We also consider the topological properties of Fa and some Diophantine-type sets of numbers expressed in terms of the a-Lüroth expansion. Next we investigate certain ergodic-theoretic properties of the maps La and Fa . It will turn out that the Lebesgue measure l is invariant for every map La and that there exists a unique Lebesgue-absolutely continuous invariant measure for Fa .
    [Show full text]