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.
Simple, but bounded method, because it has 1 parameter only. It has 2 parameters in the video - so it covers all the existing triples (at least, I hope that all =D).
I found one that's similar to that which can cover all pythaogrean triplets given a value A and a value x that shares the same parity as A. For example, using the formula b=(a^2-x^2)/(2x) and c=(a^2+x^2)/(2x) you can use a=15 and x=1 to get the pythagorean triplet 15,112,113. You can also use x=3 to get 15,36,39. The equation b=(a^2-x^2)/(2x) also works with even numbers. For example, with a=8 and x=2 you get the pythagorean triplet 8, 15, 17. With x=4 you also get the pythagorean triplet 8, 6, 10.
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².
Nice one! What I once figured out or probably saw somewhere (because I don't find myself worthy enough to generate ingenious mathematical results) Some Pythagorean triplets are m^2-1,2m,m^2+1.
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...
My teacher used the pytaghorean identity (sin^2 = 1-cos^2 or cos^2 = 1 - sin^2) in order to make analogous similarity to a formula in relativity (i forget which formula)
- A i did it in regular python for all triples up to 100 code: For a in range (1,100): for b in range(1,100): for c in range(1.100): if (a**2+b**2==c**2): if c>b and c>a: print: (a, b, c) that prints a list of every pythagorean triple up to 84, 35, 91
@@supercool1312 Your code is correct but that will give one pythagorean triplet 2 times for eg it will give 3,4,5 as well as 4,3,5 both This code can help with it for a in range(1,100): for b in range(1,100): for c in range(1,100): if ((a**2)+(b**2)==(c**2)): if a
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 :)
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 √((a^4-2a^2b^2+b^4)+(4a^2b^2)). 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.
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
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!
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.
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.
I really like this video! i've always been introduced this proof using geometry, trig functions, parametric equations and so on, this is the first explanation i've seen that's almost entirely algebraic!
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
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...
I am not sure if anyone has mentioned this (I checked most of the comments) but it should be m>n, if we want this to make sense geometrically. In the other case, b can be negative, which cannot be the length of an edge... No matter, keep up the good work!
9:00 i think taking the simplest solution is a bitt redudnant cuz u can just divide by a^2 on the pythagorean equation and get 1 + b^2/a^2 = c^2/a^2 and then place the val.ues of each and then get the same result
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
Love the video! This is super cool. I do wonder, what are the broader implications of having this formula, i.e., what problems can it be used to solve?
Awesome approach! My idea was just to take any complex number with integer parts (a + bi) and square it (a^2 - b^2 + 2abi), give you a right-triangle on the complex plane with side lengths of a^2 - b^2, 2ab and a^2 + b^2, which are all positive integers, provided a > b > 0
It's a nice triples generator but to be complete you should include multiples of a, b, and c: a = k(2mn) b = k(m^2 - n^2) c = k(m^2 + n^2) For instance, if you double the traditional 3,4,5 solution you get 6^2 + 8^2 = 10^2, which is also solution but cannot be generated with m,n as whole numbers. 3,4,5 is generated by m,n as 1,2, but neither 2,2 nor 1,4 generate 6,8,12 - the former generates the trivial 0,8,8 and the latter generates 8,15,17. This issues because the "easiest solution" for resolving the c/a and b/a fractions is, as you explain at 9:00, not the only solution; in fact it works for all multiples of k on the top and k on the bottom as well.
I must admit I didn't see where the math was going until towards the end but once I saw it my mind was blown! What I find particularly fascinating is that this shows that for an integer value of c, c must be the sum of two square numbers, so a^2+b^2=(m^2+n^2)^2. So many squares!
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²
This can be done easier (solved in 1 line) by using midpoints: rewrite it as (m+x)^2 - (m-x)^2 = a^2, which is a^2 = 4mx. QED. So any time 4 * midpoint * (distance from the midpoint) multiply to a square, it forms a Pythagorean triple. E.g. 16 = 4*4*1, so sqrt(16),(4-1),(4+1) is a Pythagorean triple: 4,3,5. Another: 15^2 = 225 = 4*(15/2)*(15/2), and we can move factors of 15 around to: 4*(3*5*3/2)*(5/2), so 15,(45/2 - 2.5),(45/2 + 2.5) is a triple: 15,20,25. Just take any square a^2, and write it as 4*(a/2)*(a/2) and then move any factors of a from x to m. This generator makes it easy to exhaustively do all triples for a particular a^2 before moving on to the next square.
Sir ... at 3:49 when you wrote a/(c-b) = (c+b)/a ...we can directly take that when (c-b),a,(c+b) are in geometric progression .....a,b,c are gonna be Pythagorean tripples ...
Playing around with M and N there’s a fun relationship where if M = N+1 then you get that C = A+1 as well (B is the smallest number of the trio). For instance, with M=2 and N=1 you get the 3,4,5 triplet (A = 2MN = 4, C = M^2 + N^2 =5). Likewise M = 3 and N = 2 gives the 5,12,13 triple (A=12 C=13). And so on. Also coincidentally in each case B is the odd number 2N + 1, and thus for every odd number Q there is a Pythagorean triple of the form Q, P, P+1 where P in generated as above.
You can be more general than taking the "easy solution". You can fix the value for a and then use m and n to generate the values for b and c. You have intoduced m and n as known constants, and with them two equations that constrain abc. The original equation is also a constraint. Three unknowns abc and three constraints fully determine your system.
Here are my implementations of the *algorithm* in the video *in Python, Java, and Javascript* just to help out those in the comments. *Python:* for m in range(1, 10): for n in range(1, 10): a = 2 * m * n b = m**2 - n**2 c = m**2 + n**2 if b
Pythagoras Square also happens to be a location name in Samos Town, Greece. Unfortunately, so far as I can tell the space is roughly rectilinear, rather than in the form of a right angled triangle. Source: www.dreamstime.com/editorial-stock-photo-pythagoras-square-samos-town-greece-view-greek-island-image60861603
blackpenredpen thanks to your videos I already know most of the calculus course that I will be studying for 2 years starting when I return to school in September and more :)
I would also add multiplication by some k in these values because if we multiply all elements of pythagorean triple by some natural number we also get pythagorean triple
yeah, the k should have appeared when he equaled the numerators and denominators to each other, even though they don't have to be exactly the same but rather multiples of each other.
Does this get rid of all the ones that are just multiples of other Pythagorean triples? Would those come in if we didn't just make top=top and bottom=bottom?
Keenan Horrigan Technically, yes. With this formula you can't get the triple 6,8,10 because it's a multiple of the 3,4,5 triple. You'll skip over multiples of the triples who are coprime. If you want to include the multiples of the triples multiply the equation a² + b² = c² by a constant (say, k) to get: ka² + kb² = kc²
35cut: You can get some of the multiples of Pythagorean triples, but not all of them. You CAN get the 6,8,10 triple with the values m=3 and n=1. However, there are no integral values for m and n that produce the 9,12,15 triple.
The generator can be generalized as follows: a = m^2 - n^2; b = 2m(m*cos(C) + n); c = m^2 + n^2 +2mn*cos(C). If cos(C) is rational, this will generate scalene triangles having angle 'C' and three rational sides. For example, if C is 60 degrees, cos(C) = 1/2. The equations above generate triangles which are obtuse. If you want acute triangles, use an acute angle for C and change the formula for 'a' to: a = n^2 - m^2 + 2b*cos(C).
If you assume that gcd(a,b)=1, you also have gcd(a,c)=1. If not, call them capital A,B,C and divide by gcd(A,B) to get lower case Pythagorean equation with gcd(a,b)=1. From there you can prove that a=2mn and c=m^2 + n^2 is the only possibility later on. We get that gcd(m,n)=1 here, and if a,b,c positive, m>n. Then we see that all other cases are scaling by k.
holy crap... this video made me want to get back into math a little more. I'm working on project euler, what got me here, and i'll make this elegant solution into a fine program ^^ thanks!
#YAY THANKS ! We can even have The triplet (2m,m²-1, m²+1) ? Example : If one of the triplet is 6, Let's say 2m = 6 Therefore m = 3 m²-1 = 8 m²+1 = 10 Therefore (6,8,10) is a triplet.
By this formula are we reaching all possible triplets? I'm trying to solve Challenge 54 from CodeAbbey. The input is S, where S=a+b+c, and S is above 10e7 values. There are missing triplets? (Primitive as Scalar)
This would also prove that b=0 is a right triangle when m=n. What are exact angles of the triangle when n=m/2 and m->Inf? Could that be called "golden angles"?
Does it guarantee that we can find every pythagorean triple by taking a = 2 mn and then using the "formula" ? What happens if you choose a different a ? Can you find new pythageron triple for each value of a? I suppose it is only a sufficient condition but not a necessary condition
So a^2+(a+1)^2=c^2. 2a^2+2a+1=c^2 . c^2 is odd so c is odd. 2a^2+2a+1=(2k+1)^2. 2a^2+2a+1=4k^2+4k+1. 2a^2+2a=4k^2+4k a^2+a=2k^2+2k. a^2+a-2k^2-2k=0. a =( -1 ± √(1-4(2k^2+2k)) ) /2. c=2k+1. c-1=2k. k=(c-1)/2 a =( -1 ± √(1-4(0.5(c-1)^2+c-1)) ) /2. a =( -1 ± √(-2c^2-8c+3) ) /2.
I developed an algorithm to find pythagorian triplets where if a^2 + b ^2 = c^2 . and c - b = 3. Pick a value of a>6 and then c = ((a^2 + 9)/6)^2 and b = ((a^2 - 9)/6)^2
Beau O Applying the formula blindly will lead to the conclusion that it is 0. But if we are using complex numbers does it still make sense to retain the triangle analogy?
If the triangle was drawn on the complex plane, the hypotenuse would be either 0 or 2, because when you draw a right triangle with sides a and b on the complex plane, one is represented on the real axis and the other is represented on the imaginary one, so it has to be multiplied by i or -i. In this case, this multiplication gives -1 or 1
Peter Brough But is that really what it means to have a length with a complex value? Remember that the Argand Diagram is a representation of the magnitude of the number's complex and real component. Following your logic, how would you represent a length of 1 + 3i. What I anticipate will happen is that you will choose the point with coordinates (1,3). Recall that a length is a scalar quantity and therefore direction does not matter therefore there must be more ways to represent the length 1 + 3i apart from the straight line from the origin to (1,3). Most people would then choose lengths with the same magnitude as 1+3i (root10) but is this really the same as 1+3i? It is for the same fundamental reasons that the hypotenuse of a right angled triangle with lengths i and 1 cannot be root2. I cannot imagine what complex lengths mean in a geometrical sense but it wouldn't be too bad to assume Pythagoras' theorem is valid even for complex values. (Leading to the conclusion that the hypotenuse is 0.) I have yet to offer a proof but on the other hand I have yet to encounter a disproof.
Danilo, my understanding is that complex numbers like (1+3i) are points and therefore have no length. However the modulus of (1+3i) is a scalar length used in the polar representation of z= (1+3i) = (|z| , θ) if z= 1+3i then the modulus(z) = |z|= sqrt(1+9), as determined by the Pythagorean theorem. But I see the problem you point out with the original question. Can there be such thing as a "side of length=(imaginary)". I'd have to say I don't know what it might mean either. To draw a line from (Re, Im) to (Re, Im + i) on the Argand Plane would NOT be to draw a line of length = i, but a line of length =1, is my best understanding. And I suppose that's why 'modulus' is used instead of 'length'.
I found a generator where you can get a Pythagorean triple by letting a be any number besides a perfect power of two. That is, a can be any odd number, or any multiple of an odd number, so it will have the form h(2k+1), where k and h are integers. Then b will be 2h(k^2 + k), and c will be b+h. It's not quite as clean, but you can find a triple for almost every a. I was thinking we would be able to combine that with the 2mn approach, where m and n are powers of 2, to get a pythagorean triple for every integer a, but it doesn't seem to work for a = 2, 4, 8, or 16, because m^2-n^2 (b) ends up being smaller than a, (though it does for all larger powers of 2). Are there no pythagorean triples for a=2^1 through 2^4? If so, why would that be? I guess there are if you relax and let b be smaller than a, but that doesn't seem fully satisfying.
If you plug in m = 1/sqrt(2) and n = i/sqrt(2) you get a 1 i 0 triangle! (source: I was bored, so I set a = i, b = 1 and c = 0 and just calculated m and n)
If m=0 then a=0, b=-n^2 and c=n^2. Thus a^2 + b^2 = c^2 is 0 + (-n^2)^2 = (n^2)^2. Meaning that (-n)^4 = n^4. Proving a nice fact that (-x)^2y is always equal to x^2y for any given value of x and y.
My question now is this, using this method you get an algorithm that's O(n) complexity, although you cannot get all pythagorean triples this way. The way I found that gets you all of them is O(n^2). So my question now is this, is it possible to solve in O(n) such that it produces all triples?
~~You most certainly can get any of the possible triples this way,~~ (edit: not 100% sure about that part after a bit of coffee) but there is no algorithm or method to "get them all" as there are infinitely many of them. You need a better defined question, cause O(infinity^2) doesn't make sense (that would be to get "all") and if you don't define how each "n" maps to a triple, it is still insufficient. There is no natural "nth" triple.
@@louisvictor3473 The question was that given some n, can you print out all Pythagorean triplets up to n? I did actually find an O(nlogn) algorithm and I think that you can't do any better than that?
Alternatively, you can find m and n using a, b and c. m = √((c + a) / 2) n = √((c - a) / 2) Turns out you don't really need b, but if you insist, m = √((√(a^2 + b^2) + a) / 2) n = √((√(a^2 + b^2) - a) / 2) Here you don't need c. You can have both, but not all three.
#YAY I have a similar generator. It works with all whole numbers greater than 2. If the number is even (n) than use the formula (n/2)^2=x. You then take x and add 1 to produce the second triplet and subtract 1 to produce the third triplet and (n) being the first triplet. It very similar for odd numbers but slightly different. If the number is odd (n') then use the formula (n^2)/2=x. You then take x and add .5 to produce the second triplet and then subtract .5 to produce then third triplet. Unfortunately it does not produce a unique triplet for every number. For instance if you use 3 you get the familiar 3^2+4^2=5^2 and the same is true when you use 4. Hope this makes sense and it's a little easier to remember for me.
I find it rather hard to solve this Q, can you solve it please? "A right angle triangle has a base of 11 cm. The other two sides are integers. Find the Perimeter of the triangle."
You can apply the method given in the video. Take the base to be equal to m²-n² (don't take it as 2mn because 11 isn't divisible by 2, so that way, m or n could be fractions instead of whole numbers, which we don't want) (m-n)(m+n) = 11. This gives m-n = 1, m+n = 11, since 11 is a prime so it only has 2 factors. Solving for m and n gives m=6, n=5. Plug these values into 2mn and m²+n² to get the other 2 sides. So you get the Pythagorean triple (11,60,61)
An alternative approach for 'a' (short leg) of odd length is to just square the number ... b (long leg) = (a^2-1)/2 c (hypotenuse) = (a^2+1)/2 in this case a=11 ... a^2 =121 ... 121/2 = 60.5 ... the integers either side are b and c :)
Jeremy Buchanan It follows that there are infinitely many right triangles where the hypotenuse is exactly one more than one leg. The two that BPRP had on the board are just the first two in an infinite series, the next being 7,24,25 which is the smallest where the hypotenuse is already a square. (You might already know the smallest right triangle where any side is a square)
I do not know any other way how to send you this question: if cos(x/2) = 0.2 for 180 < x < 270, find sin(x-45). There might be an error with the boundaries above. This is how I saw it in a photo from a book.
I know this generator for years, but I don't understand one thing: After we generated the numbers 5, 12 and 13, Where did the m and n disappeared? I mean in the 5, 12, 13 triangle, where is the "memory" of 2 and 3? The two numbers that generated these 3 pithagorians numbers. In other words: when I see 5,12,13 triangle, how can I find or calculate (fast) the two numbers that genareted this triangle?
I always love your videos. Always so clear and doesn't just tell you the answer. Really like the format.
I am glad to hear!!
Really agree it
this.
I got lost after the third sentence
هذا رائع جدا استفدت من هذا الفيديو
"We're all adults now"
Yes!
nah
Oon Han lmaoo
Im 15 lol
However, I disagree!
(Like if you get the reference)
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.
Simple, but bounded method, because it has 1 parameter only.
It has 2 parameters in the video - so it covers all the existing triples (at least, I hope that all =D).
Yup, I've known about this for a long time now, it's great, though the more generalised version is better (but less simple), of course.
I found one that's similar to that which can cover all pythaogrean triplets given a value A and a value x that shares the same parity as A. For example, using the formula b=(a^2-x^2)/(2x) and c=(a^2+x^2)/(2x) you can use a=15 and x=1 to get the pythagorean triplet 15,112,113. You can also use x=3 to get 15,36,39. The equation b=(a^2-x^2)/(2x) also works with even numbers. For example, with a=8 and x=2 you get the pythagorean triplet 8, 15, 17. With x=4 you also get the pythagorean triplet 8, 6, 10.
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².
Nice one!
What I once figured out or probably saw somewhere (because I don't find myself worthy enough to generate ingenious mathematical results)
Some Pythagorean triplets are m^2-1,2m,m^2+1.
I also discovered this similar tactic too . Also I also did it while I was 16 years old .
Bro When I was in 8th standard our teacher taught use how to generate pythagoras triplets
bro i was ez doin it when i was 2 years old
@ཀཱ I was doing this during impregnation
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...
Wow
we need more people like you
Beta = 3/5 and 4/5 are frequently used because gamma results in easy fractions, no radicals. Beta=3/5 gives gamma=5/4, beta=4/5 gives gamma = 5/3.
My teacher used the pytaghorean identity (sin^2 = 1-cos^2 or cos^2 = 1 - sin^2) in order to make analogous similarity to a formula in relativity (i forget which formula)
I remember noticing that when I was taking a class that touched on relativity.
“We are all adults now”
WOT! I’m 16! Lol
You're a math adult tho!
blackpenredpen I learn from the best
@@camerongray7767 now you are adult
Oh shit I am 19
Now you are 21
"wouldn't it be nice if we had a generator..."
me: *already opening pycharm*
- A i did it in regular python for all triples up to 100 code:
For a in range (1,100):
for b in range(1,100):
for c in range(1.100):
if (a**2+b**2==c**2):
if c>b and c>a:
print: (a, b, c)
that prints a list of every pythagorean triple up to 84, 35, 91
@@supercool1312 I think we do not need to check condition "if c>b and c>a".
@@supercool1312 you are blessed :)
@@supercool1312 Your code is correct but that will give one pythagorean triplet 2 times for eg it will give 3,4,5 as well as 4,3,5 both
This code can help with it
for a in range(1,100):
for b in range(1,100):
for c in range(1,100):
if ((a**2)+(b**2)==(c**2)):
if a
@@supercool1312 time complexity goes brrrrrrrrrr
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 :)
What an elegant proof! If m, n are N, 0
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 √((a^4-2a^2b^2+b^4)+(4a^2b^2)). 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.
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
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!
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.
"We're all adults now" yo I literally turn 18 yesterday and this is the first video from him that I see since then
And m > n is sufficient in order all possible numbers of a, b and c to agree with the equation of inequality of triangle.
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.
I really like this video! i've always been introduced this proof using geometry, trig functions, parametric equations and so on, this is the first explanation i've seen that's almost entirely algebraic!
this is one of the most beautiful things i have seen in maths
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
m > n always while n > 0 and m > 1. They work like indexes on an infinite set of triples!
OMG, I was just reading the Wikipedia article on Euclid's formula for Pythagorean triples earlier today.
9:15 so shouldn’t you say
a = k * mn
b = k * (m^2 - n^2)
c = k * (m^2 + n^2)
with k a whole number?
You can but not necessary since it is trivial that if (a,b,c) is a pythagorean triple then (ka,kb,kc) is as well.
With k=1 you already have all answers since if you take m=kb and n=kc then you get the same results
we don't need to write k... because m and n are variable..
@@helloitsme7553 you have explained in better way
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...
a, b and c should be all different
K should be whole since you want a b and c to be whole as well
I am not sure if anyone has mentioned this (I checked most of the comments) but it should be m>n, if we want this to make sense geometrically. In the other case, b can be negative, which cannot be the length of an edge... No matter, keep up the good work!
He did say in the video that he would allow negative answers, but people could not allow it, if they wanted to
9:00 i think taking the simplest solution is a bitt redudnant cuz u can just divide by a^2 on the pythagorean equation and get 1 + b^2/a^2 = c^2/a^2 and then place the val.ues of each and then get the same result
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
Love the video! This is super cool. I do wonder, what are the broader implications of having this formula, i.e., what problems can it be used to solve?
A Number Theory video by blackpenredpen, i feel like a kid on Christmas day! #YAY
Brilliantly presented!
Awesome approach! My idea was just to take any complex number with integer parts (a + bi) and square it (a^2 - b^2 + 2abi), give you a right-triangle on the complex plane with side lengths of a^2 - b^2, 2ab and a^2 + b^2, which are all positive integers, provided a > b > 0
It's a nice triples generator but to be complete you should include multiples of a, b, and c:
a = k(2mn)
b = k(m^2 - n^2)
c = k(m^2 + n^2)
For instance, if you double the traditional 3,4,5 solution you get 6^2 + 8^2 = 10^2, which is also solution but cannot be generated with m,n as whole numbers. 3,4,5 is generated by m,n as 1,2, but neither 2,2 nor 1,4 generate 6,8,12 - the former generates the trivial 0,8,8 and the latter generates 8,15,17.
This issues because the "easiest solution" for resolving the c/a and b/a fractions is, as you explain at 9:00, not the only solution; in fact it works for all multiples of k on the top and k on the bottom as well.
actually, you are the ONE who teached me loving mathematics, thank you so much!
Glad to hear! Thank you!!
When you got to the exemple --> mindblow.
Awesome class, thank you very much.
Yay, bprp upload video again 😂
Greeting from Indonesia sir! ❤
and of course you can always scale the term by and integer, so that means theres a transform from 3d space to the pythagorean triple space.
Exactly what i was looking for, so beautifully explained. Thank you! :)
I must admit I didn't see where the math was going until towards the end but once I saw it my mind was blown! What I find particularly fascinating is that this shows that for an integer value of c, c must be the sum of two square numbers, so a^2+b^2=(m^2+n^2)^2. So many squares!
3:17 good awareness!
You can further set m=a and n=1/2 so that you get a simpler solution set of Pythagorean triples in one variable: (a, a^2 + 1/4, a^2 - 1/4)
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²
This can be done easier (solved in 1 line) by using midpoints: rewrite it as (m+x)^2 - (m-x)^2 = a^2, which is a^2 = 4mx. QED.
So any time 4 * midpoint * (distance from the midpoint) multiply to a square, it forms a Pythagorean triple. E.g. 16 = 4*4*1, so sqrt(16),(4-1),(4+1) is a Pythagorean triple: 4,3,5.
Another: 15^2 = 225 = 4*(15/2)*(15/2), and we can move factors of 15 around to: 4*(3*5*3/2)*(5/2), so 15,(45/2 - 2.5),(45/2 + 2.5) is a triple: 15,20,25.
Just take any square a^2, and write it as 4*(a/2)*(a/2) and then move any factors of a from x to m. This generator makes it easy to exhaustively do all triples for a particular a^2 before moving on to the next square.
Sir ... at 3:49 when you wrote a/(c-b) = (c+b)/a ...we can directly take that when (c-b),a,(c+b) are in geometric progression .....a,b,c are gonna be Pythagorean tripples ...
Wonderful job. I was confused at the beginning, but it made sense once I watched a whole thing
Playing around with M and N there’s a fun relationship where if M = N+1 then you get that C = A+1 as well (B is the smallest number of the trio). For instance, with M=2 and N=1 you get the 3,4,5 triplet (A = 2MN = 4, C = M^2 + N^2 =5). Likewise M = 3 and N = 2 gives the 5,12,13 triple (A=12 C=13). And so on. Also coincidentally in each case B is the odd number 2N + 1, and thus for every odd number Q there is a Pythagorean triple of the form Q, P, P+1 where P in generated as above.
Terrific! Yet complex, but absolutely terrific.
You can be more general than taking the "easy solution". You can fix the value for a and then use m and n to generate the values for b and c. You have intoduced m and n as known constants, and with them two equations that constrain abc. The original equation is also a constraint. Three unknowns abc and three constraints fully determine your system.
Here are my implementations of the *algorithm* in the video *in Python, Java, and Javascript* just to help out those in the comments.
*Python:*
for m in range(1, 10):
for n in range(1, 10):
a = 2 * m * n
b = m**2 - n**2
c = m**2 + n**2
if b
Could only understand the python one...🤔🤔🤔🤔🤔🤔🤔
Cool
Girlfriend picked a nice new Mic. great video my dude keep up the great work.
Thank you for your nice comment!
I miss the old mike
The pokeball mic is the best 😆😆
I like to generate Pythagorean tripples by taking any odd number, squaring it, then think of the 2 consecutive numbers that add up to your squared odd number.
Examples:
3^2 = 9 = 4 + 5. Thus, 3, 4, 5.
5^2 = 25 = 12 + 13. Thus, 5, 12, 13.
7^2 = 49 = 24 + 25. Thus, 7, 24, 25.
9^2 = 81 = 40 + 41. Thus, 9, 40, 41.
...
(odd number)^2 = (integer Z) + (integer Z+1). Thus, (odd number), (integer Z), (integer Z+1).
Wow cool
Pythagoras Square also happens to be a location name in Samos Town, Greece. Unfortunately, so far as I can tell the space is roughly rectilinear, rather than in the form of a right angled triangle.
Source: www.dreamstime.com/editorial-stock-photo-pythagoras-square-samos-town-greece-view-greek-island-image60861603
and i was waiting for this
Jin Yang Li same!
: )
blackpenredpen thanks to your videos I already know most of the calculus course that I will be studying for 2 years starting when I return to school in September and more :)
I would also add multiplication by some k in these values because if we multiply all elements of pythagorean triple by some natural number we also get pythagorean triple
yeah, the k should have appeared when he equaled the numerators and denominators to each other, even though they don't have to be exactly the same but rather multiples of each other.
Does this get rid of all the ones that are just multiples of other Pythagorean triples? Would those come in if we didn't just make top=top and bottom=bottom?
Keenan Horrigan
Technically, yes. With this formula you can't get the triple 6,8,10 because it's a multiple of the 3,4,5 triple. You'll skip over multiples of the triples who are coprime. If you want to include the multiples of the triples multiply the equation a² + b² = c² by a constant (say, k) to get: ka² + kb² = kc²
35cut: You can get some of the multiples of Pythagorean triples, but not all of them. You CAN get the 6,8,10 triple with the values m=3 and n=1. However, there are no integral values for m and n that produce the 9,12,15 triple.
@@zanti4132 m=4 n= 3
The generator can be generalized as follows:
a = m^2 - n^2;
b = 2m(m*cos(C) + n);
c = m^2 + n^2 +2mn*cos(C).
If cos(C) is rational, this will generate scalene triangles having angle 'C' and three rational sides. For example, if C is 60 degrees, cos(C) = 1/2.
The equations above generate triangles which are obtuse. If you want acute triangles, use an acute angle for C and change the formula for 'a' to:
a = n^2 - m^2 + 2b*cos(C).
Please check the video below :
method and general equations to find ALL Pythagorean Triples by Indonesian :
ruclips.net/video/6txKnwphALg/видео.html
If you assume that gcd(a,b)=1, you also have gcd(a,c)=1. If not, call them capital A,B,C and divide by gcd(A,B) to get lower case Pythagorean equation with gcd(a,b)=1.
From there you can prove that a=2mn and c=m^2 + n^2 is the only possibility later on. We get that gcd(m,n)=1 here, and if a,b,c positive, m>n.
Then we see that all other cases are scaling by k.
Question: when you have (2n-1)²+(2n²-2n)²=(2n²-2n+1)² you can generate infinite a²+b²=c² with whole numbers right?
Right. This is a clear demostration of why there are infinite pythagorean triples :)
@@angel-ig okay😁👍🏻
holy crap... this video made me want to get back into math a little more. I'm working on project euler, what got me here, and i'll make this elegant solution into a fine program ^^ thanks!
#YAY THANKS !
We can even have The triplet (2m,m²-1, m²+1) ?
Example :
If one of the triplet is 6,
Let's say 2m = 6
Therefore m = 3
m²-1 = 8
m²+1 = 10
Therefore (6,8,10) is a triplet.
By this formula are we reaching all possible triplets? I'm trying to solve Challenge 54 from CodeAbbey. The input is S, where S=a+b+c, and S is above 10e7 values. There are missing triplets? (Primitive as Scalar)
Not sure if this was noted or not, but m and n must not be equal and m must be greater than n for this to work for triangles.
This would also prove that b=0 is a right triangle when m=n.
What are exact angles of the triangle when n=m/2 and m->Inf?
Could that be called "golden angles"?
Make video about solving integrate (x^-x) from 0 to inf. I think it will be very interesting
wow, you are a great RUclips teacher 😊😊😊
I love your enthusiasm buddy
Does it guarantee that we can find every pythagorean triple by taking a = 2 mn and then using the "formula" ? What happens if you choose a different a ? Can you find new pythageron triple for each value of a?
I suppose it is only a sufficient condition but not a necessary condition
This kind of questions are also fun: give the collection of possible values of a, b and c, such that b is one greater than a and a^2+b^2=c^2
So a^2+(a+1)^2=c^2. 2a^2+2a+1=c^2 . c^2 is odd so c is odd. 2a^2+2a+1=(2k+1)^2.
2a^2+2a+1=4k^2+4k+1.
2a^2+2a=4k^2+4k
a^2+a=2k^2+2k. a^2+a-2k^2-2k=0. a =( -1 ± √(1-4(2k^2+2k)) ) /2. c=2k+1. c-1=2k. k=(c-1)/2
a =( -1 ± √(1-4(0.5(c-1)^2+c-1)) ) /2. a =( -1 ± √(-2c^2-8c+3) ) /2.
In the context of the video, is the act of choosing m & n related to the Axiom of Choice?
What is the restrictions of m&n in this case? If m&n both equal to 1, the formula doesn't work anymore. Should both m&n be greater than 1?
For non-zero positive sides of the triangle, do m>n choices
Also, m and n should be naturals
I developed an algorithm to find pythagorian triplets where if a^2 + b ^2 = c^2 . and c - b = 3. Pick a value of a>6 and then c = ((a^2 + 9)/6)^2 and b = ((a^2 - 9)/6)^2
If I have a right triangle with side lengths 1 and i, how long is the hypotenuse?
Beau O Applying the formula blindly will lead to the conclusion that it is 0. But if we are using complex numbers does it still make sense to retain the triangle analogy?
If the triangle was drawn on the Complex plane, the hypotenuse would be the modulus of (1+i) = sqrt(2) ?
If the triangle was drawn on the complex plane, the hypotenuse would be either 0 or 2, because when you draw a right triangle with sides a and b on the complex plane, one is represented on the real axis and the other is represented on the imaginary one, so it has to be multiplied by i or -i. In this case, this multiplication gives -1 or 1
Peter Brough But is that really what it means to have a length with a complex value? Remember that the Argand Diagram is a representation of the magnitude of the number's complex and real component.
Following your logic, how would you represent a length of 1 + 3i. What I anticipate will happen is that you will choose the point with coordinates (1,3). Recall that a length is a scalar quantity and therefore direction does not matter therefore there must be more ways to represent the length 1 + 3i apart from the straight line from the origin to (1,3). Most people would then choose lengths with the same magnitude as 1+3i (root10) but is this really the same as 1+3i?
It is for the same fundamental reasons that the hypotenuse of a right angled triangle with lengths i and 1 cannot be root2.
I cannot imagine what complex lengths mean in a geometrical sense but it wouldn't be too bad to assume Pythagoras' theorem is valid even for complex values. (Leading to the conclusion that the hypotenuse is 0.) I have yet to offer a proof but on the other hand I have yet to encounter a disproof.
Danilo, my understanding is that complex numbers like (1+3i) are points and therefore have no length.
However the modulus of (1+3i) is a scalar length used in the polar representation of z= (1+3i) = (|z| , θ)
if z= 1+3i then the modulus(z) = |z|= sqrt(1+9), as determined by the Pythagorean theorem.
But I see the problem you point out with the original question.
Can there be such thing as a "side of length=(imaginary)". I'd have to say I don't know what it might mean either. To draw a line from (Re, Im) to (Re, Im + i) on the Argand Plane would NOT be to draw a line of length = i, but a line of length =1, is my best understanding. And I suppose that's why 'modulus' is used instead of 'length'.
Are all pythagorean triples of kind (2mn,m²-n²,m²+n²) for some m and n integers?
Yeah
I found a generator where you can get a Pythagorean triple by letting a be any number besides a perfect power of two. That is, a can be any odd number, or any multiple of an odd number, so it will have the form h(2k+1), where k and h are integers. Then b will be 2h(k^2 + k), and c will be b+h. It's not quite as clean, but you can find a triple for almost every a.
I was thinking we would be able to combine that with the 2mn approach, where m and n are powers of 2, to get a pythagorean triple for every integer a, but it doesn't seem to work for a = 2, 4, 8, or 16, because m^2-n^2 (b) ends up being smaller than a, (though it does for all larger powers of 2). Are there no pythagorean triples for a=2^1 through 2^4? If so, why would that be? I guess there are if you relax and let b be smaller than a, but that doesn't seem fully satisfying.
Excellent!! Love this.
This video is what I was looking for 😃
If you plug in m = 1/sqrt(2) and n = i/sqrt(2) you get a 1 i 0 triangle! (source: I was bored, so I set a = i, b = 1 and c = 0 and just calculated m and n)
If m=0 then a=0, b=-n^2 and c=n^2. Thus a^2 + b^2 = c^2 is 0 + (-n^2)^2 = (n^2)^2. Meaning that (-n)^4 = n^4. Proving a nice fact that (-x)^2y is always equal to x^2y for any given value of x and y.
I will steal your knowledge 🏃🏻♂️🏃🏻♂️🏃🏻♂️🏃🏻♂️
My question now is this, using this method you get an algorithm that's O(n) complexity, although you cannot get all pythagorean triples this way. The way I found that gets you all of them is O(n^2).
So my question now is this, is it possible to solve in O(n) such that it produces all triples?
~~You most certainly can get any of the possible triples this way,~~ (edit: not 100% sure about that part after a bit of coffee) but there is no algorithm or method to "get them all" as there are infinitely many of them. You need a better defined question, cause O(infinity^2) doesn't make sense (that would be to get "all") and if you don't define how each "n" maps to a triple, it is still insufficient. There is no natural "nth" triple.
@@louisvictor3473 The question was that given some n, can you print out all Pythagorean triplets up to n?
I did actually find an O(nlogn) algorithm and I think that you can't do any better than that?
My Pythagorean Triple:
a= Some Komplex Number
b= Synatx Error
c= Somehow Infinity
Such a great vid, love the videos you post.
Alternatively, you can find m and n using a, b and c.
m = √((c + a) / 2)
n = √((c - a) / 2)
Turns out you don't really need b, but if you insist,
m = √((√(a^2 + b^2) + a) / 2)
n = √((√(a^2 + b^2) - a) / 2)
Here you don't need c.
You can have both, but not all three.
#YAY I have a similar generator. It works with all whole numbers greater than 2. If the number is even (n) than use the formula (n/2)^2=x. You then take x and add 1 to produce the second triplet and subtract 1 to produce the third triplet and (n) being the first triplet.
It very similar for odd numbers but slightly different. If the number is odd (n') then use the formula (n^2)/2=x. You then take x and add .5 to produce the second triplet and then subtract .5 to produce then third triplet.
Unfortunately it does not produce a unique triplet for every number. For instance if you use 3 you get the familiar 3^2+4^2=5^2 and the same is true when you use 4.
Hope this makes sense and it's a little easier to remember for me.
It took me 12 minutes to realise that we wrote Pythagoras theorem in terms of Pythagoras theorem but of different variables
I find it rather hard to solve this Q, can you solve it please?
"A right angle triangle has a base of 11 cm. The other two sides are integers. Find the Perimeter of the triangle."
You can apply the method given in the video. Take the base to be equal to m²-n² (don't take it as 2mn because 11 isn't divisible by 2, so that way, m or n could be fractions instead of whole numbers, which we don't want)
(m-n)(m+n) = 11. This gives m-n = 1, m+n = 11, since 11 is a prime so it only has 2 factors. Solving for m and n gives m=6, n=5.
Plug these values into 2mn and m²+n² to get the other 2 sides.
So you get the Pythagorean triple (11,60,61)
Reeta Singh Thanks for the help!
An alternative approach for 'a' (short leg) of odd length is to just square the number ...
b (long leg) = (a^2-1)/2
c (hypotenuse) = (a^2+1)/2
in this case a=11 ... a^2 =121 ... 121/2 = 60.5 ... the integers either side are b and c :)
Jeremy Buchanan
It follows that there are infinitely many right triangles where the hypotenuse is exactly one more than one leg.
The two that BPRP had on the board are just the first two in an infinite series, the next being 7,24,25 which is the smallest where the hypotenuse is already a square.
(You might already know the smallest right triangle where any side is a square)
@@reetasingh1679 Thanks for the approach man!!
Nice video, have you ever seen the video "all possible Pythagorean triples, visualized" by 3Blue1Brown? also very interesting
Nice to notice that this generator is one of the most important theorems in chromogeometry
Thanks for the video, helped me solve a project euler challenge.
Very cool. Thanks!
Glad you liked it!
So, m should be bigger then n is it?
YAY from swiss ! Your channel is awesome
can you do the same for pythagorean quadruples? (find it interesting because we use a lot of 3D Space and need absolute value of vectors 😁)
I do not know any other way how to send you this question:
if cos(x/2) = 0.2 for 180 < x < 270, find sin(x-45).
There might be an error with the boundaries above. This is how I saw it in a photo from a book.
love it. Just like all the other ones.
No, I won't allow you to write the m^2 first!!!
What?
I know this generator for years, but I don't understand one thing:
After we generated the numbers 5, 12 and 13,
Where did the m and n disappeared?
I mean in the 5, 12, 13 triangle, where is the "memory" of 2 and 3?
The two numbers that generated these 3 pithagorians numbers.
In other words: when I see 5,12,13 triangle, how can I find or calculate (fast) the two numbers that genareted this triangle?
what are the cases or conditions for m and n?
For non-zero positive sides of the triangle, do m>n choices
Also, they should be naturals
Thank you!
This is quite commonly taught in high school to convert and eqn into parametric form. Though well explained.
Really awesome video nice work
Take a right triangle that has a pythagorean triple. Then compute tan(2theta), the right triangle with 2theta in it will also be a pythagorean triple.