THE STERN-BROCOT TREE

Similar documents
p-adic Egyptian Fractions

ENGI 3424 Engineering Mathematics Five Tutorial Examples of Partial Fractions

Intermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4

Minimal DFA. minimal DFA for L starting from any other

Farey Fractions. Rickard Fernström. U.U.D.M. Project Report 2017:24. Department of Mathematics Uppsala University

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

Lecture 3: Equivalence Relations

MTH 505: Number Theory Spring 2017

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer

Bases for Vector Spaces

Bridging the gap: GCSE AS Level

set is not closed under matrix [ multiplication, ] and does not form a group.

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

Chapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1

Handout: Natural deduction for first order logic

2.4 Linear Inequalities and Interval Notation

Parse trees, ambiguity, and Chomsky normal form

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

Convert the NFA into DFA

Exercises with (Some) Solutions

Coalgebra, Lecture 15: Equations for Deterministic Automata

Homework 3 Solutions

Mathematics Number: Logarithms

More on automata. Michael George. March 24 April 7, 2014

Consolidation Worksheet

Homework Solution - Set 5 Due: Friday 10/03/08

CMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014

Lecture 2: January 27

MATH 573 FINAL EXAM. May 30, 2007

Answers and Solutions to (Some Even Numbered) Suggested Exercises in Chapter 11 of Grimaldi s Discrete and Combinatorial Mathematics

AQA Further Pure 1. Complex Numbers. Section 1: Introduction to Complex Numbers. The number system

The Regulated and Riemann Integrals

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Math 4310 Solutions to homework 1 Due 9/1/16

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Introduction to Mathematical Reasoning, Saylor 111

UniversitaireWiskundeCompetitie. Problem 2005/4-A We have k=1. Show that for every q Q satisfying 0 < q < 1, there exists a finite subset K N so that

CS 275 Automata and Formal Language Theory

Lecture 3. Introduction digital logic. Notes. Notes. Notes. Representations. February Bern University of Applied Sciences.

CM10196 Topic 4: Functions and Relations

Math 8 Winter 2015 Applications of Integration

Formal languages, automata, and theory of computation

20 MATHEMATICS POLYNOMIALS

Torsion in Groups of Integral Triangles

1 Nondeterministic Finite Automata

2 b. , a. area is S= 2π xds. Again, understand where these formulas came from (pages ).

MATH FIELD DAY Contestants Insructions Team Essay. 1. Your team has forty minutes to answer this set of questions.

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

Compiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Lesson 25: Adding and Subtracting Rational Expressions

Introduction to Algebra - Part 2

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

Lecture 6. Notes. Notes. Notes. Representations Z A B and A B R. BTE Electronics Fundamentals August Bern University of Applied Sciences

Lecture 09: Myhill-Nerode Theorem

Section 6: Area, Volume, and Average Value

First Midterm Examination

378 Relations Solutions for Chapter 16. Section 16.1 Exercises. 3. Let A = {0,1,2,3,4,5}. Write out the relation R that expresses on A.

Formal Languages and Automata

SUMMER KNOWHOW STUDY AND LEARNING CENTRE

5: The Definite Integral

First Midterm Examination

are fractions which may or may not be reduced to lowest terms, the mediant of ( a

Problem Set 9. Figure 1: Diagram. This picture is a rough sketch of the 4 parabolas that give us the area that we need to find. The equations are:

Designing finite automata II

7. Indefinite Integrals

For the percentage of full time students at RCC the symbols would be:

CS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata

1 ELEMENTARY ALGEBRA and GEOMETRY READINESS DIAGNOSTIC TEST PRACTICE

I do slope intercept form With my shades on Martin-Gay, Developmental Mathematics

Improper Integrals, and Differential Equations

1 From NFA to regular expression

Improper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

Lecture 3 ( ) (translated and slightly adapted from lecture notes by Martin Klazar)

How can we approximate the area of a region in the plane? What is an interpretation of the area under the graph of a velocity function?

Lecture 2e Orthogonal Complement (pages )

Beginning Darboux Integration, Math 317, Intro to Analysis II

Recitation 3: More Applications of the Derivative

Section 4: Integration ECO4112F 2011

The graphs of Rational Functions

The area under the graph of f and above the x-axis between a and b is denoted by. f(x) dx. π O

Quadratic Forms. Quadratic Forms

List all of the possible rational roots of each equation. Then find all solutions (both real and imaginary) of the equation. 1.

CS 330 Formal Methods and Models

Linear Systems with Constant Coefficients

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

Advanced Algebra & Trigonometry Midterm Review Packet

5.2 Exponent Properties Involving Quotients

7.1 Integral as Net Change and 7.2 Areas in the Plane Calculus

MA 131 Lecture Notes Calculus Sections 1.5 and 1.6 (and other material)

n f(x i ) x. i=1 In section 4.2, we defined the definite integral of f from x = a to x = b as n f(x i ) x; f(x) dx = lim i=1

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors:

DISCRETE MATHEMATICS HOMEWORK 3 SOLUTIONS

CS 275 Automata and Formal Language Theory

Math 130 Midterm Review

A study of Pythagoras Theorem

Model Reduction of Finite State Machines by Contraction

Thoery of Automata CS402

Transcription:

THE STER-BROCOT TREE This is smple (drt) chpter rom: MATHEMATICAL OUTPOURIGS ewsletters nd Musings rom the St. Mr s Institute o Mthemtics Jmes Tnton www.jmestnton.com This mteril ws nd cn still e used s the sis o successul MATH CIRCLE ctivity. Jmes Tnton 2

STER-BROCOT TREE: ewsletter Jnury 2 JAUARY 2 PUZZLER: A CURIOUS FRACTIO TREE Here is something un to thin out. Consider the ollowing rction tree: c) Might the rction 3 pper twice in the 2 tree? d) Will the rction 457 777 the tree? Might it pper twice? eventully pper in e) Are ll the rctions tht pper in the tree in reduced orm? (For exmple, I see the rction 2 / 3, ut I don t see its equivlents 4 / 6 or 2 / 8.) ) Let me give things wy: Prove tht this tree produces ll possile positive rctions, written in reduced orm, with no rction ever ppering more thn once. It is constructed y the ollowing rule: Ech rction hs two children: let child, rction lwys smller thn, nd right child lwys lrger thn. ) Continue drwing the rction tree or nother two rows. ) Explin why the rction 3 2 will eventully pper in the tree. (It might e esier to irst igure wht should e the prent o 3 nd its grndprent, nd so 2 on.) THE EUCLIDEA ALGORITHM: I two numers nd re multiples o three, then so too will e their dierence:. In ct, it is not too hrd to see tht i one lists ll the common ctors o nd nd then lists ll the common ctors o nd, the two lists will e the sme. [For exmple, with = 84 nd 2 84,2 hs common = the pir ( ) ctors:, 2, 3, 4, 6, nd 2, nd the pir 84,36 hs common ctors:, 2, 3, 4, 6, ( ) nd 2!] Gree geometer Euclid (c. 3 B.C.E) noticed this too nd went urther to oserve tht i we ply the gme o repetedly sutrcting the smller numer rom the lrger rom pir o numers to produce new pirs, the lists o common ctors cnnot chnge: 84,2 84,36 48,36 ( ) ( ) ( ) ( 2, 36) ( 2, 24) ( 2,2) All pirs hve common ctors:, 2, 3, 4, 6 nd 2.

As the numers in the pirs re decresing in size (we do not llow ourselves to go to zero), this process must stop nd do so when there is no smller vlue to sutrct rom lrger. Tht is, this process must stop y reching pir with common vlue: d, d. But the pir o numers d nd d ( ) hs the sme list o common ctors s do the originl pir nd. Since d is clerly the lrgest common ctor o d nd d, we must hve tht this inl numer d is the lrgest common ctor o nd. EUCLID S ALGORITHM: To ind the gretest common ctor o two numers, repetedly sutrct the smller rom the lrger until common vlue ppers. This common vlue is the gretest common ctor! For exmple, consider 2 nd 7. The lgorithm gives: 2,7 2, 68 34, 68 34,34 ( ) ( ) ( ) ( ) Their gretest common ctor is 34. EXERCISE: Find the gretest common ctor o 457 nd 777. COECTIOS TO THE FRACTIO TREE: Strt t pex o the rction tree nd ollow pth down s r s you plese nd stop t some rction. Do you see tht this pth is just the Eucliden lgorithm conducted in reverse? In ct, strting t / nd ollowing your pth c to / is precisely the pth o Euclid s lgorithm,. As this reverse pplied to the pir ( ) pth yields the inl pir (, ), the rction / hs gretest common ctor etween its numertor nd denomintor. Tht is, / must e in reduced orm. Moreover, every reduced rction must pper in the tree: just pply the Eucliden lgorithm to the numertor nd denomintor to see where it lies in the tree. Finlly, no rction ppers twice in the tree. I one did, then its prent too would pper O REFLECTIO: ewsletter Jnury 2 twice, s would its grndprent, gret grnd prent, nd so on, ll the wy down to / ppering twice, which does not! COMMET: I we red the rctions let to right cross the rows o the tree we otin the sequence:,, 2,, 3, 2, 3,, 4, 2 3 2 3 4 3. This list contins ll the positive rctions. The ct tht one cn list the rtionls ws irst discovered y Georg Cntor in the 8s. He ccomplished this et dierent wy. CHALLEGE: Put ll the rtionls, oth the positive nd negtive rctions, including zero, into single list. SOME MYSTERIES: Loo t the numertors tht pper in the rction tree, reding cross the tree y its rows. We otin the sequence: 2 3 2 3 4 3 5 2 5 3 4 5 (The denomintors ollow the sme sequence oset y one.) ) Pluc out every second entry, the ones in even positions. This gives,, 2,, 3, 2, 3,,, the originl sequence! ) Ech entry in n odd position (ter the irst) is the sum o its two neighours! 2=, 3= 2, 3= 2, 4= 3, 5= 3 2, c) Every third entry is even. All other entries re odd. d) The entries etween the ones re plindromes: 2 323 4352534 547385727583745. The digits o ech o these plindromes dd to one less thn power o three. RESEARCH CORER: Prove these clims. Discover more remrle properties o this sequence. Cn you push the sequence cwrds? For instnce, ) sys tht the entry to the let o the irst must e zero. Wht s next on the let? 2 Jmes Tnton St. Mr s Institute o Mthemtics. mthinstitute@stmrsschool.org

STER-BROCOT TREE: Commentry STER-BROCOT TREE Jnury 2 COMMETARY, SOLUTIOS nd THOUGHTS This remrle rction tree is nown s the Stern-Brocot tree nd it ppers in [GRAHAM, KUTH nd PATASHIK]. A similr construct, nown s the Clin-Wil tree, is given y very similr lgorithm: ech reduced rction hs let child ut right child. Its properties, in to wht we hve outlined in the newsletter, re presented in [CALKI nd WILF]. The content o this newsletter lso ppers in [TATO]. In the Fll o 29, young students o the St. Mr s Institute o Mthemtics reserch clss lso explored the properties o the Stern-Brocot tree: They sed the ollowing question: I we enumerte the rctions reding cross the rows o the tree we otin the ollowing sequence o ll positive rtionls: 2 3 2 3 4 3 5 2 5 3 4 5 4,,,,,,,,,,,,,,,,,, 2 3 2 3 4 3 5 2 5 3 4 5 4 7 Wht is the th rction in this list? The 4,3 rd rction? Is it possile to determine the -th rction in this list without hving to enumerte entire rows o this tree? Here is their result: 2 Jmes Tnton

STER-BROCOT TREE: Commentry Theorem : Write in se two nd te note o the count o digits tht pper in ech loc o s nd s in its representtion. Suppose 2 = (with set equl to zero i is even). Then the -th rction in the Stern-Brocot sequence is the continued rction: = [,, 2,, ] = 2. For exmple, the numer one-hundred in se two is nd so 7 = = 9 2 2 2 nd 43 in se two is nd so 553 43 = [2,5,,,,, 2, 4, 2] =. 73 Proo: Construct tree o similr shpe using the counting numers: We see tht it ollows the rule: 2 Jmes Tnton

STER-BROCOT TREE: Commentry For numers written in inry, this hs nice interprettion: To crete the let child o counting numer, ppend zero t the end o its inry representtion. To crete right child, ppend one. Thus ech digit in inry representtion o numer represents let down-step in the tree nd ech (ter the irst) right down-step in the tree. The numer ourteen, or exmple, with inry code cn e interpreted s RRL which mens: Strt t. Step right. Step right. Step let. 2 In terms o locs, i = hs locs,,,, (with possily zero), then its let child, ddend zero, hs locs,,,,,, i nd locs,,,, i =, nd its right child, ddend, hs locs.,,,, The rctions in the Stern-Brocot tree ollow the sme pttern! I = 2 then its let child is: = = / 2 (which equls = = / 2 i = ), nd its right child is = = ( ) 2 This estlishes the proo. 2 Jmes Tnton

STER-BROCOT TREE: Commentry Students went urther nd ound the ollowing dditionl curiosity: Theorem 2: For,, 2,, 3, 2, 3,, 4, 3, 5, 2, 5, 3, 4,, 5, 4,, the sum o ny rction in 2 3 2 3 4 3 5 2 5 3 4 5 4 7 the sequence nd the reciprocl o its next term is lwys n odd integer. Precisely, 2 = where re the numer o zeros t the til end o the inry representtion o. This provides swit mens or computing the -th rction i is lredy nown. THE UMERATORS I THE FRACTIO TREE Agin let denote the -th rction in the Stern-Brocot tree in reding let to right cross its rows. Given the construct o the tree, it is not diicult to see tht the denomintor o lwys mtches the numertor o. Thus i e denotes the numertor o we hve: = e e with the sequence o numertors eginning,, 2,, 3, 2, 3,,. Also, given the construct o the tree: we see e 2 = e e = e e 2 This shows tht the even terms the sequence { e } mtch the originl sequence nd tht the odd terms stisy e2 = e e = e2 e2 2 s climed in the newsletter. The plindromic properties o the sequence ollow s consequence o these reltions. (The sequence strts with the plindromes nd 2 nd these represent the next ew even terms o the sequence perpetuting the symmetry. The odd terms, eing the sums o neighoring terms, preserve this symmetry too.) 2 Jmes Tnton

STER-BROCOT TREE: Commentry AOTHER BIARY COECTIO Every positive integer hs unique inry representtion using the digits nd. But i we permit use o the digit 2 s well, numer my e expressed in se two in more thn one wy. For exmple, the numer ten now hs ive possile representtions: 8 2 2 8 2 4 4 2 22 4 4 22 4 2 2 I present this to young students s weighing puzzle: I hve two rocs ech weighing pound, two rocs ech weighing 2 pounds, two ech weighing 4 pounds, two ech weighing 8 pounds, nd so on. In how mny wys cn I me ten pounds? Let ( ) denote the count o wys o ming weight o pounds. This gives the sequence ( ) nown s Stern s ditomic sequence [SLOAE, A2487]. { } I is odd, then we must use precisely one pound roc nd we re let trying to me weight o pounds using rocs o weights 2, 4, 8, 6. Dividing through y two we see tht this is equivlent to computing. Thus we hve: 2 ( 2 ) = ( ) I is even, we cn either use two pound rocs nd mtch weight o 2 pounds with the 2 remining rocs (nd there re wys to do this) or we cn use no - pound weights 2 nd mtch pounds with the remining rocs (nd there re wys to ccomplish this). 2 This gives: ( 2 ) = ( ) ( ) These reltions llow us to write down the sequence { ( )} :,2,,3,2,3,,4,3,5,2,5,3, 4,, 2 Jmes Tnton

STER-BROCOT TREE: Commentry nd we see the sequence { } re the sme.) e oset y one! (ote tht the recursive reltions or e nd ( ) Given our wor with the Stern-Brocot tree, the ollowing result is cler. But i it were presented cold, with no context or its derivtion, it is truly mind oggling! Theorem 3: Consider the sequence,2,,3,2,3,,4,3,5,2,5,3, 4,,. given y counting the numer o wys to represent ech integer in se two using the digits, nd 2. Then every, ppers in this sequence s pir o neighoring terms exctly pir o coprime integers ( ) once. We cn sy more out this sequence y rephrsing theorem 2: For ny three consecutive terms in this sequence, the sum o the irst nd lst term is n odd multiple o the middle term. REFERECES: [CALKI nd WILF] Clin,., nd Wil, H.S., Recounting the rtionls, Americn Mthemticl Monthly, 7 (2), 36-363. [GRAHAM, KUTH nd PATASHIK] Grhm, R.L., Knuth, D.E., nd Ptshni, O., Concrete Mthemtics: A Foundtion or Computer Science, 2 nd ed., Addison-Wesley, Reding, MA, 994. [SLOAE] Slone,.J.A., The On-Line Encyclopedi o Integer Sequences. URL: www.reserch.tt.com/~njs/sequences. [TATO] Tnton, J., THIKIG MATHEMATICS! Volume :Arithmetic = Gtewy to All, www.lulu.com, 29. 2 Jmes Tnton