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