finding ALL pythagorean triples (solutions to a^2+b^2=c^2)

preview_player
Показать описание

For more calculus tutorials, check out my new channel @bprpcalculusbasics
Рекомендации по теме
Комментарии
Автор

I always love your videos. Always so clear and doesn't just tell you the answer. Really like the format.

antimatter
Автор

I used this result a lot when I taught relativity to physics students.

Why?

In special relativity two quantities are often used, beta and gamma.

beta is v/c, or the fraction the speed of light at which the other reference frame is moving.

gamma can be defined by
beta^2 + 1/gamma^2 = 1 (though students are usually taught a formula which is harder to remember)

It turns out that Pythagorean triples turn up in an unusual way (because of the 1/gamma^2) but it can still be used, and actually IS often used by professors setting homework. I know because I was one

A clock on a spaceship travelling at 3
4/5 c is observed to run at 3/5 of its proper rate.

Notice the 3, 4, 5 Triangle?

A 1kg weight is observed to have a mass of 1.25 kg when observed from a spaceship zooming past at 0.6 c
(Those numbers as fractions are 5/4 and 3/5)

Using Pythagoras answer the following:
A stationary twin ages 25yrs: how much does her travelling twin age travelling at 0.28c?

(Hint think 0.28 as a fraction=7/25: 7, 24, 25

She ages 24 years.


When I was teaching Relativity for a UK University I used to encourage students to memorize the following triangles which are popular with Relativity exam setters

3, 4, 5
5, 12, 13
7, 24, 25

and I taught the general rule that if any fraction in a special relativity paper contains consecutive integers, add them and take the square root to find the smallest number in the Pythagorean Triple. That number forms a fraction with the bigger of the previous numbers to give you the ratio you need.

In exams (but not in real life) they usually come out as ratios of integers under 20.

I once set a not-for-grading quiz q where a cosmic ray was moving at (112/113).c An incoming particle had an observed mass of 113 keV, what would its rest mass have been? Almost all the class got the answer in under a second

Even if you don't know the physics, knowing Pythagoras applies you might instantly say an integer number of keV (go on post a guess... it's an integer below 20)

Of course I advised students to show conventional working in assessed work, because in Physics most of the marks come from showing the understanding of the physics and displaying knowledge of the usual equations, not showing off a crafty shortcut ;)

Even so knowing the result you are working towards can give you an edge, and serves to double check the result when you get it.

And to come back to this video, I deduced the generator formula roughly the way demonstrated here when I first started setting questions myself...

trueriver
Автор

My method of instantly finishing Pythagorean triples (very limited)

Let a be some odd number greater than 1.
Then b and c are the 2 consecutive numbers that add to a^2. In other words, b=(a^2-1)/2
and c=(a^2+1)/2

For example:
Let a=3
Then b = (3^2-1)/2 = 4
and c = (3^2+1)/2 = 5
It's the 3, 4, 5 triple.

It also works for 5, 12, 13, since 12 and 13 are the consecutive numbers that add to 5^2 = 25. 7, 24, 25 and 9, 40, 41 and so on also work similarly.

Short proof:

Given: n^2 = m + (m+1)
n^2 = 2m+1
n^2 + m^2 = m^2 + 2m + 1
n^2 + m^2 = (m+1)^2

It is limited but pretty fast.

threepointonefour
Автор

When I was about 16-17 years old, or 4-5 years ago, I discovered the way to generate 'rational' Pythagorean triples. This was what I did...

I observed that...
3²+4²=5² >> 3²=(4+5)(1) = (4+5)(5-4)
8²+15²=17² >> 8²=(15+17)(2) = (15+17)(17-15)

From the pattern, we can see that...
a²+b²=c² >> a²=(b+c)(c-b)=(c+b)(c-b) --(1)

Also, we can see that c-b is the difference of the sides b and c; therefore I let...
c-b=d, i.e. c=b+d --(2)

Substituting (2) into (1);
a²=((b+d)+b)((b+d)-b)
a²=(2b+d)d

Now I now get the pattern, which is:
a²=d(2b+d) --(*)

Let's generate an example..

Let a=26, with the difference between the other sides of 7 (d=7).

Entering the values a and d into (*);
26²=7(2b+7)

Solve the equation for b and we get b=627/14.

Substituting b into (2), we get c=725/14.

Now we get a set of rational triples: (a, b, c) = (26, 627/14, 725/14).

However, if you want the triples to be all whole numbers, I will multiply all sides by the denominator of non-whole numbers (14) to all sides by proportion:
(26×14, (627/14)×14, (725/14)×14)

Now we successfully generate a new set of Pythagorean triples in all whole numbers, which is
(a, b, c) = (364, 627, 725).
That means 364²+627²=725².

Kitnitisgame
Автор

“We are all adults now”

WOT! I’m 16! Lol

camerongray
Автор

What an elegant proof! If m, n are N, 0<n<m, gcd(m, n)=1 and (m+n) ≡ 1 (mod 2), then you will always get a unique primitive Pythagorean triple. All values will work, even non-integers, even complex numbers, and all will yield some sort of right triangle. If m = (root6)/2 and n = (root2)/2, you get a = root3, b = 1 and c = 2.

Qermaq
Автор

"wouldn't it be nice if we had a generator..."
me: *already opening pycharm*

-a
Автор

And m > n is sufficient in order all possible numbers of a, b and c to agree with the equation of inequality of triangle.

maksatilmyradov
Автор

Amazing! I have seen the way to get this same result using a different number theory approach where we realize that exactly one of the legs is even and the hypotenuse and the other leg is odd, then some algebraic and number theory manipulations, and that way was a lot longer than this! Once again, thank you! I love seeing multiple ways to solve the same problem :)

sahibakaur
Автор

Very nice!
This formula can also be derived using complex numbers, z, and the fact that
|z₁| |z₂| = |z₁z₂|

So you can go:
|z| |z| = |z|² = |x + yi|² = x² + y²
= |z·z| = |z²| = |(x + yi)²| = |x²–y² + 2xyi|

Squaring both "ends, "
(x²+y²)² = (x²–y²)² + (2xy)²

And then, just identify
a = x²–y²
b = 2xy
c = x²+y²

and you have a general PT.


Graphically, on a complex plot (Argand diagram), you can draw
z = x + yi
for positive integers x>y; and then its square,
Z = z² = x²–y² + 2xyi = a + bi
will make an integer right triangle with real & imaginary components as its legs, and the "radius" as its hypotenuse.

Fred

ffggddss
Автор

I got the same formulas a different way. Suppose you have a complex number a+bi, where a and b are integers that are chosen freely. When you plot a number in the complex plane you can draw a line from that point to the real axis perpendicular and another line straight to the number 0 from the number a+bi, thus forming a right triangle. By the Pythagorean theorem, this means that the line from a+bi to 0 is of course of length √(a^2+b^2), which I may refer to as r. Given the original condition that a and b must be integers, then r^2 must always be an integer because r^2=a^2+b^2. This is important for later. If we were to square the number a+bi we get a^2+2abi-b^2. For simplicity I will write it as a^2-b^2+2abi to keep real and imaginary parts separate. In our original number a+bi, a was of course the real part and b was of course the imaginary part. To get the length of the line from this point (a+bi)^2 to 0, we have to take (a^2-b^2)^2 (real part)^2 + (2ab)^2 (imaginary part)^2 and square root it. This yields that the length of this line is Combining like terms reveals that the length is also equal to √(a^4+2a^2b^2+b^4). The inside factors to (a^2+b^2)^2. The ^2 and the √ cancel each other revealing that the length of the line from (a+bi)^2 to 0 is a^2+b^2 which, from before, is r^2, which, remember, is an integer. This is where it all comes together. So after all this (showing that squaring a+bi and r yields that a, b, and r are integers and that complex numbers can form a right triangle when plotted in the complex plane), we have a Pythagorean triple (since I have used a, b, and c I will use x, y, and z) in the form of x=a^2+b^2, y=2ab, and z=a^2+b^2. If I explained anything to vaguely or incorrectly please let me know.

thesinglemathnerd
Автор

m > n always while n > 0 and m > 1. They work like indexes on an infinite set of triples!

christian.dev
Автор

You can expand the generator by adding a third variable k.
a = 2kmn
b= k(m^2-n^2)
c = k(m^2+n^2)

But this still doesn't include all the possible triples. ({3, 0, 3} is excluded for example)
And allowing k to be a rational number introduces new problems...

whebon
Автор

I remember doing an intuitive proof ages ago based on 'fitting' an odd length line (generated from each odd square) around a corresponding square to get the next square up. But I'm loving this!

matthewstevens
Автор

Your note about the different fraction solutions fits with the fact that you can multiply any pythagorean triple by a constant and still have a pythagorean triple. Taking the general solution to the fractions would introduce another unknown, say x, which would multiply all three values (unless I'm smoking something unhelpfu, it would have to be the same in both equations to maintain consistency in the system).

Assuming I didn't make any transcription errors: m = 67890, n = 12345 gives the triple 1676204100, 4456653075, 4761451125. And our friend 3, 4, 5 comes from m = 2, n = 1.

lostwizard
Автор

Great video...I haven't seen this approach. It seems the same result is reached if you square any complex number (and consider the lateral lines as pointed out in the 3B1B video). For example, pick any two whole numbers, say 3 and 8. If we square 3+8i, we get -55+48i. Now take the absolute value of the real part and the imaginary part to get the a and b of a pythagorean triple (48, 55, 73). And there you go, math is beautiful...though most people will never know it.

michaelbergwell
Автор

We have been taught a similar method in school but we just set m = 1 for all the forms of Pythaogorean triplets m² + 1, m² - 1 and 2m. This makes calculations a lot easier and works for all even values of m. I know it is very limited but works all the time.

Example

Let m = 6

2m = 3

m² + 1 = 3² + 1 = 10
m² - 1 = 3² - 1 = 8
2m = 2(3) = 6

The Pythaogorean triplet is 6, 8, 10

contemporarilyancient
Автор

Take any complex number in a form a+ib where a>b. Square it and you get a new complex number c+id. You find a pythagorean triple: c, d, sqrt(c^2 + d^2)

For example: (2+i)^2 = 4 + 4i -1 = 3+4i ; sqrt(3^2 + 4^2)=5

For a<b you get negative values and for a=b the real part is 0

jekoddragon
Автор

Pick any random complex number a+bi. e.g: 3+4i
square it to get another complex number c+di, then c, d are 2 in 3 Pythagorean Triple
(3+4i)²= -7+24i
7²+24²=625=25²

defishkoi
Автор

this is one of the most beautiful things i have seen in maths

hammozeen