{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 128 0 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 0 128 0 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 128 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 128 128 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 128 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 263 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 128 128 1 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 128 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 128 128 1 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 269 "" 0 1 0 128 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 128 128 1 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 0 128 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 128 128 1 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 0 128 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 274 "" 0 1 0 128 128 1 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 275 "" 0 1 0 128 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 276 "" 0 1 0 128 128 1 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 277 "" 0 1 0 128 128 1 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 278 "" 0 1 0 128 128 1 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 279 "" 0 1 0 128 128 1 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 280 "" 0 1 0 128 128 1 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 281 "" 0 1 0 128 128 1 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 282 "" 0 1 128 128 0 1 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Time s" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 } {PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 2 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 1 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 257 50 "High School Modul es > Geometry by Gregory A. Moore" }}{PARA 3 "" 0 "" {TEXT -1 4 " \+ " }{TEXT 256 19 "Pythagorean Triples" }}{PARA 0 "" 0 "" {TEXT -1 128 " \nAn exploration of Pythagorean Triples, plenty of example of these my sterious numbers, and graphs of hundreds of these triples!\n" }}{PARA 0 "" 0 "" {TEXT 258 153 "[Directions : Execute the Code Resource secti on first. Although there will be no output immediately, these definiti ons are used later in this worksheet.]" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 1 " " }{TEXT 260 7 "0. Code" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "restart; with(plots): " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 491 "SumSquares := proc(n)\n \+ local A,i,j,k;\n \n A := array( [seq( [ seq(` `, j = 1..(n+2) ) ], i = 1..(n+2)) ]);\n A[1,1] := `Sum Squares` ; \n f or k from 1 to n do A[1,k+2 ] := k; od;\n for k from 1 to n do A [k+2, 1] := k; od;\n for k from 1 to n do A[2, k+2] := `__`; od; \n for k from 1 to n do A[k+2, 2] := `|`; od;\n \n for i from \+ 1 to n do \n for j from 1 to n do \n A[i+2,j+2] : = i^2 + j^2 ; od;od;\n \n print(A);\n end proc:\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 252 "SumSquares2 := proc(n)\n \+ local A,i,j,k;\n \n A := array( [seq( [ seq(` `, j = 1..(n) \+ ) ], i = 1..(n)) ]);\n for i from 1 to n do \n for j from 1 to i do \n A[i,j] := i^2 + j^2 ; od;od;\n \n p rint(A);\n end proc:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 564 "PythTripTable := proc(m)\n local A,i,j,k,n;\n n := m - 2; \n A := array( [seq( [ seq(` `, j = 1..(n+2) ) ], i = 1..(n+2)) \+ ]);\n A[1,1] := `triples`; A[2,1] := `p`; A[1,2] := `q`;\n \+ for k from 1 to n do A[1,k+2] := k+2; od;\n for k from 1 to n d o A[k+2, 1] := k+2; od;\n for k from 1 to n do A[2,k+2] := `__` ; od;\n for k from 1 to n do A[k+2, 2] := `|`; od;\n \n for i \+ from 3 to n+2 do \n for j from 3 to n+2 do \n if (j >i) then A[i,j] := [j^2-i^2,2*i*j,j^2+i^2] ; fi; od;od;\n \n pri nt(A);\n end proc:\n\n\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 213 "PythTrips := proc(n)\n local i,j,k;\n print(` Pythagorean Triples :\\n`);\n for j from 3 to n do \n for i from 3 to \+ j-1 do \n print([j^2-i^2,2*i*j,j^2+i^2] ); od;od;\n \n \+ \n end proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 453 "PythT rips := proc(n)\n local i,j,A,B,g;\n print(`Some Pythagorean T riples :`);print(` `);\n for j from 3 to n do \n for i from 3 to j-1 do \n A := [j^2-i^2,2*i*j,j^2+i^2];\n g \+ := igcd(A[1],A[2],A[3]); \n B := A/g;\n if( g =1) \+ \n then print(A,` Primitive Triple)(` );\n \+ else print(A,` a multiple of `, B );\n \+ fi; od;od;\n \n \n end proc:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 588 "PythTripPlot := proc(n)\n local i,j,k,Q,m,q,c ;\n print(`Some Pythagorean Triples :`);print(` `);\n k:= 0; \n \+ for j from 2 to n do \n for i from 1 to j-1 do \n \+ k := k+1;\n q := [ j^2-i^2, 2*i*j];\n c := COL OR(RGB, evalf(rand()/10^12,2)/3 + .3,\n eval f(rand()/10^12,2)/3 + .3,\n .8 );\n \+ Q||k := plot( [[0,0],[q[1],0],[q[1],q[2]],[0,0]], \n \+ color = c, axes = none): \n od;od; \n displ ay( [seq(Q||j, j = 1..k)], scaling=constrained);\n end proc:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 630 "PythPointPlot := proc(n) \n local i,j,k,Q,m,q,c;\n print(`Pythagorean Triple Vertices :`) ;print(` `);\n \n k:= 0;\n Q||k := pointplot([0,0], color = wh ite, axes = boxed): \n for j from 2 to n do \n for i fro m 1 to j-1 do \n k := k+1;\n q := [ j^2-i^2, 2*i*j ];\n c := COLOR(RGB, evalf(rand()/10^12,2)/3 + .2,\n \+ evalf(rand()/10^12,2)/3 + .1,\n \+ .8 );\n Q||k := pointplot([q[1],q[2]], \n \+ color = c, axes = boxed):\n od;od; \n display ( [seq(Q||j, j = 0..k)], scaling=constrained);\n end proc:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 754 "PythPrimPointPlot := proc (n)\n local i,j,k,Q,m,q,c,g;\n print(`Primitive Pythagorean Trip le Vertices :`);print(` `); \n k:= 0;\n Q||k := pointplot([0,0], color = white, axes = boxed): \n for j from 2 to n do \n fo r i from 1 to j-1 do \n q := [ j^2-i^2, 2*i*j];\n \+ g := igcd(q[1],q[2]);\n if( g=1)then \n k := k+ 1;\n c := COLOR(RGB, .7,\n e valf(rand()/10^12,2)/3 + .1,\n evalf(rand ()/10^12,2)/3 + .1 );\n Q||k := pointplot([q[1],q[2]], \n \+ color = c, axes = boxed, symbol = circle):\n \+ fi; \n od;od; \n display( [seq(Q||j, j \+ = 0..k)], scaling=constrained);\n end proc:" }}}}{SECT 0 {PARA 4 " " 0 "" {TEXT -1 1 " " }{TEXT 261 22 "1. Pythagorean Triples" }}{PARA 0 "" 0 "" {TEXT -1 43 "\nThis is the famous theorem of Pythagorus\n\\ " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Pyth := a^2 + b^2 = c^2; " }}}{PARA 0 "" 0 "" {TEXT -1 74 "\nTypically, if the two legs are int egers, the hypotenuse is a square root." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "subs( \{a=1, b=2\}, Pyth);\nsolve(%,c);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "subs( \{a=1, b=1\}, Pyth);\nsolve(% ,c);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "subs( \{a=1, b=2\}, Pyth);\nsolve(%,c);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "sub s( \{a=2, b=3\}, Pyth);\nsolve(%,c);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "subs( \{a=4, b=6\}, Pyth);\nsolve(%,c);" }}}{PARA 0 " " 0 "" {TEXT -1 111 "\nHowever, there are some wonderous cases where a ll three numbers are integers. We call threesomes of this type " } {TEXT 263 19 "Pythagorean Triples" }{TEXT -1 39 ". There are an infini te number of them." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "subs( \+ \{a=3, b=4\}, Pyth); solve(%,c);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "subs( \{a=5, b=12\}, Pyth); solve(%,c);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "subs( \{a=7, b=24\}, Pyth); solve(% ,c);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "subs( \{a=8, b=15\} , Pyth); solve(%,c);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "sub s( \{a=8, b=15\}, Pyth); solve(%,c);" }}}{PARA 0 "" 0 "" {TEXT -1 87 " \nThe mystery then is how to find these magical triplets and how many \+ of them there are." }}{PARA 0 "" 0 "" {TEXT -1 2 "\n " }}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 1 " " }{TEXT 264 30 "2. Finding Pythagorean T riples" }}{PARA 0 "" 0 "" {TEXT -1 284 "\nWe can also look at a sum of squares - and see if we recognize any perferct squares. For example, \+ in this chart, there are two entries of 25. If you trace them back to \+ the column and row they are (3,4) and (4,3). Every perfect square in t his table corresponds to a Pythorean triple.\n" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "SumSquares(6);" }}}{PARA 0 "" 0 "" {TEXT -1 67 " \n\nHow many perfect squares do you count here? Look for 25, 100, 225 " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "SumSquares(13);" }}} {PARA 0 "" 0 "" {TEXT -1 50 "\n\nHow many more can you find here? Hint : 289, 400" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "SumSquares2(1 7);" }}}{PARA 0 "" 0 "" {TEXT -1 202 "\n\nAs you can see there quite a few cases. In fact, it turns out that there are an infinite number of Pythagorean triples. Here a few more. Please test these out and verif y that they are indeed triples.\n" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "PythTripTable(9);" }}}{PARA 0 "" 0 "" {TEXT -1 126 " \nA \"primitive Pythagorean Triple\" is one where all three numbers ar e relatively prime. Its easy to generate an infinite number" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "`Primitive Pythagorean Triple`; [5, 12, 13]; igcd( 9, 40, 41);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "`Primitive Pythagorean Triple`; [9, 40, 41]; igcd( 9, 40, 41);" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 94 "`Primitive Pythagorean Trip le`; [111, 680, 689]; igcd( 111, 680, 689);\n111^2 + 680^2 = 689^2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 68 "`Non-primitive Pythagorea n Triple`; [21, 28, 35]; igcd( 21, 28, 35);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "`Non-primitive Pythagorean Triple`; [15, 36, 39]; \+ igcd( 15, 36, 39 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "`Non -primitive Pythagorean Triple`; [112, 66, 130]; igcd(112, 66, 130);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "`Non-primitive Pythagorean Triple`; [136, 255, 289]; igcd(136, 255, 289 );" }}}{PARA 0 "" 0 "" {TEXT -1 63 "\nHere a lot more - note which ones are primitive and whi ch not." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "PythTrips(20);" } }}{PARA 0 "" 0 "" {TEXT -1 2 "\n " }}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 1 " " }{TEXT 265 33 "3. Even & Odd Pythagorean Triples" }}{PARA 0 " " 0 "" {TEXT -1 1 "\n" }{TEXT 282 52 "[Optional Section - This is a li ttle more advanced.]" }{TEXT -1 70 "\n\nCan any of a, b, and c be even or odd numbers? Lets look into this.\n" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "Pyth;\n" }}}{PARA 0 "" 0 "" {TEXT -1 557 " 1. Ca n all three : a, b, and c be odd?\n 2. Can a and b be odd, but a even?\n 3. Can a and c be odd, but b even?\n 4. Can \+ a and b be even, but a odd?\n 5. Can a and c be even, but b odd ?\n 6. Can all three : a, b, and c, be even?\n\nTo analyze this , lets plut in some expressions for even and odd integers. We will fin d that many of the expanded terms have factors of 4. If we reduce mod \+ 4 - that is divide both sides by 4 and look only at the remainder, we \+ can see that most, but not all of the questions are not true.\n" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 110 "odd1 := 2*i + 1; odd2 : = 2*j + 1; odd3 := 2*k + 1;\neven1 := 2*l ; even2 := 2*n; \+ even3 := 2*m;" }}}{PARA 0 "" 0 "" {TEXT -1 13 "\n \n\n....... " } {TEXT 266 38 "1. Can all three : a, b, and c be odd?" }{TEXT 267 46 " \+ ............................................" }{TEXT 268 1 "\n" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 55 "subs(\{a=odd1,b=odd2,c=odd3\}, Pyth);\nexpand(%);\n % mod 4;" }}}{PARA 0 "" 0 "" {TEXT -1 3 "no." }{TEXT 270 2 "\n\n" } {TEXT -1 8 "....... " }{TEXT 272 35 "2. Can a and b be odd, but a eve n?" }{TEXT 271 47 " ............................................" }} {PARA 0 "" 0 "" {TEXT 269 1 " " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "subs(\{a=odd1,b=odd2,c=even1\}, Pyth);\nexpand(%);\n% mod 4;" }} }{PARA 0 "" 0 "" {TEXT -1 12 "no.\n\n...... " }{TEXT 274 34 "3. Can a \+ and c be odd, but b even?" }{TEXT 273 49 " ....................... ....................." }{TEXT -1 1 "\n" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "subs(\{a=odd1,b=even2,c=odd3\}, Pyth);\nexpand(%);\n% mod 4;" }}}{PARA 0 "" 0 "" {TEXT -1 14 "yes!\n\n....... " }{TEXT 277 35 "4. Can a and b be even, but c odd?" }{TEXT 275 47 " ........... ................................." }{TEXT 276 1 "\n" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "subs(\{a=even1,b=even2,c=odd1\}, Pyth);\nex pand(%);\n% mod 4;" }}}{PARA 0 "" 0 "" {TEXT -1 12 "no.\n....... " } {TEXT 279 34 "5. Can a and c be even, but b odd?" }{TEXT 278 49 " \+ ............................................" }{TEXT -1 1 "\n" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "subs(\{a=even1,b=odd2,c=even 3\}, Pyth);\nexpand(%);\n% mod 4;" }}}{PARA 0 "" 0 "" {TEXT -1 12 "no. \n....... " }{TEXT 281 30 "5. Can a, b and c all be even?" }{TEXT 280 49 " ............................................" }{TEXT -1 1 "\n " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "subs(\{a=even1,b=even2,c=even3\}, Pyth);\nexpand(%);\n% mod 4; " }}}{PARA 0 "" 0 "" {TEXT -1 201 "yes!\n\nUnless all three are even, \+ it must be the case that one leg is even and one is odd, and the hypot enuse is odd. If all three numbers are even - in which case we can div ide 2 out of each number.\n\n " }}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 1 " " }{TEXT 262 32 "4. Graphs of Pythagorean Triples" }}{PARA 0 "" 0 " " {TEXT -1 168 "\nWhat would it look like if we drew a diagram of all \+ of the Pythorean Triple Triangles upto a certain size on the same grap h? Would there be any rhyme or reason to it? " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "PythTripPlot(4);\n" }}}{PARA 0 "" 0 "" {TEXT -1 179 "\nCan you distinguish the primitive triples from the non-primitiv e triples? By the way, this plot eliminatres duplicates, for example, \+ only one of (3,4,5) and (4,3,5) is plotted.\n" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "PythTripPlot(8);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "PythTripPlot(12);" }}}{PARA 0 "" 0 "" {TEXT -1 357 " \nIts interesting that these triangles seem somewhat uniformly distrib uted, isn't it? This diagram gets increasingly cluttered because we ar e drawing so many triangles. If we only plot the upper right vertex (a ,b) of the right triangle with sides a, b, and c (for Pythagorean trip le right triangles only), what will it look like? Will there be some p attern?\n" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "PythPointPlot(1 2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "PythPointPlot(20);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "PythPointPlot(40);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "PythPointPlot(50);" }}} {PARA 0 "" 0 "" {TEXT -1 115 "\nThese plots included primitive and non -primitive triples. What if we limit the diagram to primitive triples \+ only?\n" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "PythPrimPointPlot (12);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "PythPrimPointPlot( 36);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "PythPrimPointPlot(5 0);" }}}{EXCHG }{EXCHG }{EXCHG }{EXCHG }}{PARA 0 "" 0 "" {TEXT 259 35 "\n \251 2002 Waterloo Maple Inc" }}}{MARK "0 1" 26 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }