Monday, December 7, 2009

Generating Pythagorean Triples




The 5 millennia old clay tablet designated Plimpton 322 contains a trig table. The second and third columns represent a leg and hypotenuse of a right triangle with positive integer sides. The rows are arranged in approximately equal steps of angle.

The existence of such a table suggests that the Babylonians were adept at producing Pythagorean triples (integers a, b, and c satisfying a2 + b2 = c2), a trick which is also useful to many algebra, geometry, and trig teachers attempting to create exercises with nice values.

Every positive Pythagorean triple can be generated by choosing positive integers u and v with u > v and setting a = 2uv, b = u2 - v2, and c = u2 + v2 (or by scaling such a triple by a positive integer). We'll derive that fact below. (Pythagorean triples with no common factor are called primitive Pythagorean triples, and all the primitive Pythagorean triples are generated when u and v are relatively prime with exactly one of them being odd.)

It's straightforward to verify that the a, b, and c so defined do form a Pythagorean triple. And conversely, if a, b, and c form a Pythagorean triple, then (a/c, b/c) is a point on the unit circle x^2+y^2=1, so the positive Pythagorean triples can be mapped onto the rational points of the unit circle that lie in the first quadrant.

The line y = 1 + mx will intersect the unit circle at (0,1) and also at a point in the first quadrant when the slope m is between -1 and 0. In fact, we can find the x-coordinate of the second intersection point by solving the equation x2 + (1 + mx)2 = 1--we find that x=\frac{-2m}{1+m^2}, so y=1-\frac{2m^2}{1+m^2}.

Thus the second intersection point is a rational point if m is rational. Of course the slope between (0,1) and any rational point on the unit circle is rational, so we have a 1-1 correspondence between positive rational points on the unit circle and rational slopes between -1 and 0.

We now assume that m is a rational number between -1 and 0, so we can write m = -v/u, where u and v are positive integers with u > v. Then the second intersection point we found above has the form

\left(\frac{-2(\frac{-v}{u})}{1+(\frac{-v}{u})^2}, \,\, 1- \frac{2(\frac{-v}{u})^2}{1+(\frac{-v}{u})^2}\right) = \left(\frac{2uv}{u^2+v^2}, \frac{u^2-v^2}{u^2+v^2}\right).

Thus every rational point on the unit circle can be written in this form. In particular, every primitive Pythagorean triple a, b, and c can be expressed as above in terms of u and v.

1 comment:

Bruce Yoshiwara said...

Manjul Bhargava's MathFest 2011 Thursday Hedrick talk used (-1,0) as the base point on the unit circle--a nicer choice than my use of (0,1). It gives a natural 1-1 correspondence between rational numbers (plus infinity) as slopes and rational points on the unit circle.