15 views

Original Title: The Trinary Tree

Uploaded by eduardo_ricaldi

The Trinary Tree

Attribution Non-Commercial (BY-NC)

- Homework 1
- cs_a_se_sy
- Box2d Manual
- Linux Dev Tree
- A P2P Platform for Real-Time Multicast Video Streaming Leveraging on Scalable Multiple Descriptions to Cope with Bandwidth Fluctuations
- New Microsoft Office Word Document
- Gravity Tree _ Week of Code 23 Question _ Contests _ HackerRank
- Data Structures With C Dec 2010
- 00b7d528f32db0f646000000
- 14 Dynamic 1
- tree_traversal
- bcsl-033
- CRE 2.6.2 Reference Guide Ver1.6
- treeview_progressbar
- Formulation
- 1
- b Tree Example
- rec05
- 15211Fall10MT1
- Algo - Binary Search Tree

You are on page 1of 8

========== FOUNDATION ========== I've known this a long time: Let ( a, b, c ) be a Pythagorean Triple a2 + b2 = c2 Parameterize a,b,c as follows a = q + m b = q + n c = q + m + n Substitute (q + m)2 + (q + n)2 = (q + m + n)2 Expand, cancel common terms, and take square root to get q = sqr(2*m*n) Thus, Pythagorean Triples can be generated by finding m,n such that 2*m*n is a perfect square. The following observations are offered without proof: * If m,n are relatively prime then the Pythagorean Triple will also be relatively prime. This is known as a Primitive Pythagorean Triple, or PPT. * q will always be even. * In PPTs, either m or n must be even and the other odd This is also true for a and b. * q is larger than m or n or both * q is smaller than m + n The reverse equations are easily derived: m = c - b n = c - a q = a + b - c m,n,q > 0 a,b,c > 0

======================== LOOK, THEY COME IN PAIRS ======================== This is the new twist: Traditionally, q is assumed to be the positive root. However if you instead choose the negative root, a different Pythagorean Triple is formed with a or b or both being negative. Discard the sign(s) and you have a perfectly good Pythagorean Triple. Thus each valid combination of m and n produce two Triples. Again, Triples. other sign, One of the triples will have all positive terms, and in the a or b will be negative. The c's will always have the same if m and n are relatively prime so will be a, b and c in both

assumed positive without loss of generality. The odd/even pattern in PPTs will be identical. SPPT. The Signed Primitive Pythagorean Triple will be known as the For example: let m = 25 and n = 8 q = sqr( 2 * 25 * 8 ) = 20 a = q + m = 45 b = q + n = 28 c = q + m + n = 53 a' = -q + m = 5 b' = -q + n = -12 c' = -q + m + n = 13

The PPT is (45,28,53) and the SPPT is (5,-12,13) which corresponds to a PPT of (5,12,13). value The c' value of the SPPT will always be smaller than the c of the PPT. ================= TREE CONSTRUCTION ================= The construction of the trinary tree is based on the observation that PPTs and SPPTs always come in pairs and every valid PPT can generate three, and only three, SPPTs simply by changing the

signs

on a and b. Start with (3,4,5) as the root node called "P". Build a table of values: A === 3 -3 3 -3 B === 4 4 -4 -4 C === 5 5 5 5 M === 1 1 9 9 N === 2 8 2 8 Q === 2 -4 -6 -12 Q' === -2 4 6 12 A' === -1 5 15 21 B' === 0 12 8 20 C' === 1 13 17 29

You can now read the three child nodes from the table: P3 They are (5,12,13), (15,8,17) and (21,20,29) called P1, P2 and respectively. tree Repeat the process for each child node to build as large a as you want. For example: A === 5 -5 5 -5 B === 12 12 -12 -12 C === 13 13 13 13 M === 1 1 25 25 N === 8 18 8 18 Q === 4 -6 -20 -30 Q' === -4 6 20 30 A' === -3 7 45 55 B' === 4 24 28 48 C' === 5 25 53 73

Notice that the first row points back to the parent PPT when the sign is removed from the PPT. Also the sign pattern will tell which branch was taken. As you build the tree you will notice that the c's are always increasing as you traverse from the root, that is the list of PPTs is 'quasi-sorted' in a heap sort sense. ================================== THE SELF ROOTED NATURE OF THE TREE ================================== Something funny happens at the apparent parent of (3,4,5) which is (1,0,1).

Since one of the values is zero, there is only one signed variation of the node instead of the usual three. A === 1 -1 B === 0 0 C === 1 1 M === 1 1 N === 0 2 Q === 0 -2 Q' === 0 2 A' === 1 3 B' === 0 4 C' === 1 5

This tree will lead to all PPTs where a is odd and b is even, similarly (0,1,1) will lead to all the PPTs where a is even and b is odd. ========================== CUTTING OUT THE MIDDLE MEN ========================== Now apply the same technique to a node in general. again, assume a,b,c,m,n,q > 0 A === a -a a -a B === b b -b -b C === c c c c M === m m1 m2 m3 N === n n1 n2 n3 Q === q q1 q2 q3 Q' === -q -q1 -q2 -q3 A' === a0 a1 a2 a3 B' === b0 b1 b2 b3 C' === c0 c1 c2 c3 Once

Processing the first child shows: m1 = c - b m2 = c - (-a) = c + a q1 = (-a) + b - c a1 = -q1 + b1 = -q1 + c1 = -q1 + = 2*a -

(always < 0)

Putting these equations into matrix form: (a1 b1 c1) = (a b c)( 1 2 2 ) = (a b c)*T1 ( -2 -1 -2 ) ( 2 2 3 ) Similar calculations yield:

(a0 b0 c0) = (a b c)( -1 -2 -2 ) = (a b c)*T0 ( -2 -1 -2 ) ( 2 2 3 ) And this is a remarkable result. It means that any Pythagorean Triple can generate three new Triples by means of matrix multiplications with T1, T2 and T3 with larger c's, and can generate a signed version of a smaller c triple with a matrix multiplication with T0. If the triple is a PPT the child nodes will be PPTs and the T0 transform will yield a SPPT corresponding to the parent. ================= SPANNING THE PPTS ================= The trinary tree covers the entire set of PPTs completely and uniquely. The unique part is inherent from the construction of the tree. Each node has only one unique SPPT 'mnq-twin' and thus has only one parent. The completely part requires a proof by contradiction. Suppose you have a PPT which is not spanned by the tree. It would still have a 'mnq-twin' SPPT with a smaller c. And the absolute values of those numbers would form another PPT. be, zero, This PPT can't be on the tree either or the original one would and so on. Since the c's are decreasing, and are bounded by

this sequence must terminate in a different 'self-parent' than (1,0,1) or (0,1,1). Since everything is relatively prime these two are the only two triples where q = 0, since q = 0 implies m = 0 or n = 0 (Remember q = sqr(2*m*n)). ================================ MNQ-TWINS IN LINEAR ALGEBRA FORM ================================

T ------------------------------------> (a b c) -----> (m n q) -----> (m n -q) -----> (a' b' c') InvP U4 P InvP = ( 0 -1 1 ) ( -1 0 1 ) ( 1 1 -1 ) U4 * U4 = I T = InvP * U4 * P = ( -1 -2 -2 ) ( -2 -1 -2 ) ( 2 2 3 ) Note, T * T = I Proof: * P = InvP * P = I Thus the T transform will find the 'mnq-twin' of any triple. ======================================== TREE CONSTRUCTION IN LINEAR ALGEBRA FORM ======================================== Parent -------------------------> Child Signed Variation MNQ-Twin T * T = InvP * U4 * P * InvP * U4 * P = InvP * U4 * U4 U4 = ( 1 ( 0 ( 0 0 0 ) 1 0 ) 0 -1 ) P = ( 1 0 1 ) ( 0 1 1 ) ( 1 1 1 )

PPT SPPT PPT (a b c) -----> ( a' b' c ) -----> ( a" b" c" ) Ui T i = 1,2,3 U1 = ( -1 0 0 ) ( 0 1 0 ) ( 0 0 1 ) U2 = ( 1 0 ( 0 -1 ( 0 0 0 ) 0 ) 1 ) U3 = ( -1 0 ( 0 -1 ( 0 0 0 ) 0 ) 1 )

================================ The Eigenvectors of T are also interesting. The characteristic equation of T is -x3 + x2 + x - 1 = 0 Which yields roots of 1, 1, and -1. Since there is a double root at one the eigenvectors require two parameters. A set of corresponding eigenvectors are: ( s1, s2, s1+s2 ) and ( s3, s3, s3 ) Since (1,1,1) can never be a Pythagorean triple when multiplied by any length (except the trivial zero), it can be discarded. Applying the Pythagorean constraint to the first family of vectors: (s1)2 + (s2)2 = (s1 + s2)2 s12 + s22 = s12 + 2*s1*s2 + s22 0 = 2*s1*s2 Therefore s1 = 0 or s2 = 0 or both. Both is again the trivial solution and can be discarded. That leaves two vectors: ( s1, 0, s1 ) and ( 0, s2, s2 ) which reduce to ( 1, 0, 1 ) and ( 0, 1, 1 ) when relative primeness is introduced. These are precisely the two self rooted triplets that lead to all the odd/even/odd and even/odd/odd PPTs respectively. ==================== AN INTERESTING TWIST ==================== Reversing the first two rows of T has the effect of swapping the odd/even pattern of a and b. This has the effect of making (1 0 1) the parent of (0 1 1) and vice versa. So instead even/odd of two separate self rooted trees, you get sort of 'Siamese' trees joined at the head where the tiers alternate between and odd/even triples. The eigenvalues of this matrix are -1, -1, and 1 with eigenvectors: ( s1, s2, (s1+s2)/2 ) and (1,1,2) Applying the Pythagorean constraint to these shows no real solutions possible. Therefore there can be no other

- Homework 1Uploaded byDustin Rudiger
- cs_a_se_syUploaded byv.miheer
- Box2d ManualUploaded bykonjuslav
- Linux Dev TreeUploaded bySubramanyam Kalyana Raman
- A P2P Platform for Real-Time Multicast Video Streaming Leveraging on Scalable Multiple Descriptions to Cope with Bandwidth FluctuationsUploaded byAIRCC - IJCNC
- New Microsoft Office Word DocumentUploaded bysushil4056
- Gravity Tree _ Week of Code 23 Question _ Contests _ HackerRankUploaded byIfj Oriskó Norbert
- Data Structures With C Dec 2010Uploaded byPrasad C M
- 14 Dynamic 1Uploaded byOrchid Majumder
- 00b7d528f32db0f646000000Uploaded bymvdurgadevi
- tree_traversalUploaded byGaurav Tyagi
- bcsl-033Uploaded bypujan bajracharya
- CRE 2.6.2 Reference Guide Ver1.6Uploaded byNgười Của Đảng
- treeview_progressbarUploaded byrajeev020
- FormulationUploaded bySalim Dubreh
- 1Uploaded byapi-3814854
- b Tree ExampleUploaded bygayanjali
- rec05Uploaded byPallav Anand
- 15211Fall10MT1Uploaded byOverkillAnkit
- Algo - Binary Search TreeUploaded bydwiarin1997
- taUploaded byJayakar Kurimilla
- ps1_solUploaded bydalton_hubble
- Basic Comp 2Uploaded byNilam Kumar
- Efficient Evaluation of Generalized Path Pattern Queries on XML DataUploaded bymachinelearner
- Connor Ch9Uploaded byJose Haro
- lec05.448Uploaded byMukul Bhalla
- L04 AdvancedSetRepresentationMethodsAVLtrees2 3(4)TreesUnion FindADTUploaded byAndrei Ardelean
- INFO1905 Cheat Sheet FinalUploaded byJeffrey
- recentUploaded bybinukiruba
- 02-dynprogUploaded byHemesh Singh

- Replacing Paradigms Requires Open MindsUploaded byeduardo_ricaldi
- 1-37-1-PBUploaded byeduardo_ricaldi
- 1 CHAOS2012 Proceedings Papers a-BUploaded byeduardo_ricaldi
- ZLOZANGLUploaded byeduardo_ricaldi
- ZIG-ZAG9Uploaded byeduardo_ricaldi
- Abaout OrchidsUploaded byeduardo_ricaldi
- ThanksUploaded byMarhamah Udin
- NewsUploaded byAlessandro Coppolecchia
- Manual Garmin GpsUploaded byJavier Casique
- TUTOR1Uploaded byeduardo_ricaldi
- A Fable for the TimeUploaded byeduardo_ricaldi
- ChronostratChart2013-01.pdfUploaded byFeli Monnom
- capítulo-6Uploaded byeduardo_ricaldi
- Graham Darby Origins of the First World WarUploaded byeduardo_ricaldi
- Carl Von Clausewitz- On War-IUploaded byeduardo_ricaldi
- Abramowitz and StegunUploaded byeduardo_ricaldi
- Ecomonic EvaluationUploaded byeduardo_ricaldi
- 2007_issue1Uploaded byeduardo_ricaldi
- Nikon D70Uploaded byeduardo_ricaldi
- Ecomonic Evaluation12Uploaded byeduardo_ricaldi
- Project EditorUploaded byeduardo_ricaldi
- FPSO Lease Rate CalculatorUploaded byeduardo_ricaldi
- A Survey of Offshore Oilfield Drilling Wastes and Disposal Techniques to Reduce the Ecological Impact of Sea DumpingUploaded byeduardo_ricaldi
- LicenseUploaded byeduardo_ricaldi
- Using Counting Numbers to Generate Pythagorean TriplesUploaded byeduardo_ricaldi
- SamplesUploaded byeduardo_ricaldi
- Boastvhs ManualUploaded byeduardo_ricaldi

- Simulation and Experimental Validation of Sound Transmission Loss of Pure Reactive Muffler With Different Expansion RatioUploaded byIJARTET
- Jee Main Online Question PaperUploaded bymadhesh
- E-M10_Markk_II_En.PDFUploaded byBob Lee
- Service Best Practice Off-Board Fluid FiltrationUploaded byVictor Cipriani
- How to Create CNT Thin Films With NanoIntegris CNTs in Aqueous SolutionUploaded byNasos Masouras
- Arusha Technical College- Prospectus 2014/2015-2016/2017Uploaded byGasto Leseiyo
- Aldemir 2002 Optimal Control of Structures Withsemiactive-tuned Mass DampersUploaded byMarcelo Guajardo
- AP Physics Course DescriptionUploaded byJake Madd
- 44-136839TCH Validating UV VisibleUploaded byMahmoued Yasin
- stats_ch6Uploaded byNarayan Nandeda
- Chemistry AssignmentUploaded byNeha Haloi
- Getting Started With AbaqusUploaded byMohammedAL-Athari
- Diesel Pump and TimingUploaded byMickye Mickyedj
- Mahematics of music (Fourier).pdfUploaded byPetre Jovanov
- Seismic Analysis of Fire Sprinkler SystemsUploaded byTeja Dewanti
- P&ID SeminarUploaded by蔡蕲
- 1-s2.0-S1359029411001087-main.pdfUploaded byMagdalena Mihai
- shear strength of slabUploaded byaleena4
- Fluid Codes Training CatalogueUploaded byMohamedJaberKutkutMjk
- Flyer HSS Tubes Cranes OkUploaded byNoman Abu-Farha
- API 5L pptUploaded bymullanji
- Is 15328 Pvc Pipes in SewerageUploaded bykathir1965
- Traffic Measure ClassifyUploaded byakarimi7961
- Article Dynamic Modeling of Three Phase TransformerUploaded byrasim_m1146
- Orbitalum High Purity Pipe & Tube Cutting Tools and Orbital Welding Systems (1)Uploaded bytekijac
- Paper CaracterizacionUploaded byLuis Carlos Patiño Lagos
- SAME: Oct 2010Uploaded bypromechmags
- cpedfinals1Uploaded byAlin
- SectionII_IntroToGasProcessingUploaded byfructora
- Photography 1: People and PlaceUploaded byPaul Vincent