Omnimaga

General Discussion => Other Discussions => Math and Science => Topic started by: Munchor on March 25, 2011, 06:50:42 pm

Title: Pitagoric Triplet
Post by: Munchor on March 25, 2011, 06:50:42 pm
A pitagoric triplet is, as most of you know, a group of numbers a,b,c that solve the following rule:

Code: [Select]
a²+b²=c²

The most common example is 3²+4²=5².

The challenge is the following:

Code: [Select]
a²+b²=c²
a,b,c are all natural numbers
a+b+c=200

You can easily find the answer on the Net, but I want the mathematical (by hand) proof of your work.

Good Luck! If you find the answer like some already did, post it in spoiler tags please.

Title: Re: Pitagoric Triplet
Post by: Goplat on March 25, 2011, 06:59:31 pm
There are actually two solutions (four if you allow a > b), so I'm going to be a smartass and give the unintended one:
Spoiler For Spoiler:
0² + 100² = 100² ;)
Title: Re: Pitagoric Triplet
Post by: Munchor on March 25, 2011, 07:01:39 pm
There are actually two solutions (four if you allow a > b), so I'm going to be a smartass and give the unintended one:
Spoiler For Spoiler:
0² + 100² = 100² ;)


0 is not a natural number :P

That answer is wrong. The answer is easy, the getting there by hand is hard.
Title: Re: Pitagoric Triplet
Post by: AngelFish on March 25, 2011, 07:04:43 pm
Derivation:

Spoiler For Spoiler:
Let us start with the premises that sqrt(A2+B2)=C and A+B+C=200. From this, we can ascertain that the upper bound on A, B, and C is the same as the upper bound on C. Thus, A<C>B. This suggests that the best course of action is to write the equation 200= sqrt(A2+B2)+A+B, which is equivalent to the second premise.

From that, we get A2+B2=(200-A-B)2 or A2+B2=40,000-400A-400B+A2+B2+2AB.

Then, dividing by A2+B2, we get 1=(40,000-400A-400B+A2+B2+2AB)/(A2+B2).

Breaking this into partial fractions brings out 1=(40,000)/(A2+B2)-(400A)/(A2+B2)-(400B)/(A2+B2)+(A2+B2)/(A2+B2)+(2AB)/(A2+B2).

Simplifying and subtracting the ones from both sides gives us 0=(40,000-400A-400B+2AB)/(A2+B2). The roots of this equation are the solutions.

I then solved this equation for B, which results in the nice equation B=(200(A-100))/(A-200). The answers should be obvious from this point onwards, so I'll let you do the rest :)

Answer:
Spoiler For Spoiler:
A=40, B=75, C=85. There's another trivial solution where A and B are reversed.
Title: Re: Pitagoric Triplet
Post by: christop on March 25, 2011, 07:21:51 pm
Here's my method and solution:

Spoiler For method:
First I typed this program into my computer (by hand), compiled it (by typing gcc by hand), and then ran it (again, typing the command by hand):
Code: [Select]
#include <stdio.h>

int main()
{
long a, b, c;
long aa, bb, cc;
for (a = 1; a <= 200; ++a) {
aa = a*a;
for (b = 1; b <= 200 - a - 1; ++b) {
bb = b*b;
c = 200 - a - b;
cc = c*c;
if (c > 0 && aa + bb == cc)
printf("a=%ld b=%ld c=%ld\n", a,b,c);
}
}
return 0;
}
Spoiler For solution:
When I ran the program I got this answer:
a=40 b=75 c=85
a=75 b=40 c=85

(one solution and the other trivial solution with A and B reversed)

40^2 + 75^2 = 85^2
40, 75, and 85 all are natural numbers
40 + 75 + 85 = 200

QED. :P

Time between reading the problem and instructing the computer how to find a solution: less than 5 minutes
Time to run the program and obtain a solution: 4 milliseconds
Finding a solution in less time than doing it purely by hand: priceless
Title: Re: Pitagoric Triplet
Post by: Munchor on March 25, 2011, 07:23:04 pm
Here's my method and solution:

Spoiler For method:
First I typed this program into my computer (by hand), compiled it (by typing gcc by hand), and then ran it (again, typing the command by hand):
Code: [Select]
#include <stdio.h>

int main()
{
long a, b, c;
long aa, bb, cc;
for (a = 1; a <= 200; ++a) {
aa = a*a;
for (b = 1; b <= 200 - a - 1; ++b) {
bb = b*b;
c = 200 - a - b;
cc = c*c;
if (c > 0 && aa + bb == cc)
printf("a=%ld b=%ld c=%ld\n", a,b,c);
}
}
return 0;
}
Spoiler For solution:
When I ran the program I got this answer:
a=40 b=75 c=85
a=75 b=40 c=85

(one solution and the other trivial solution with A and B reversed)

40^2 + 75^2 = 85^2
40, 75, and 85 all are natural numbers
40 + 75 + 85 = 200

QED. :P

Time between reading the problem and instructing the computer how to find a solution: less than 5 minutes
Time to run the program and obtain a solution: 4 milliseconds
Finding a solution in less time than doing it purely by hand: priceless

Nice Christop, I did the same, but using Python. It's relatively easy to do that (no offense!). I wanna see if someone comes up with a by hand formula of it :O
Title: Re: Pitagoric Triplet
Post by: AngelFish on March 25, 2011, 07:23:53 pm
Actually, that derivation took me about three minutes...

EDIT: Scout, I did come up with a version done by hand.
Title: Re: Pitagoric Triplet
Post by: Munchor on March 25, 2011, 07:27:48 pm
Actually, that derivation took me about three minutes...

EDIT: Scout, I did come up with a version done by hand.

NICE QWERTY, show me.
Title: Re: Pitagoric Triplet
Post by: AngelFish on March 25, 2011, 07:28:40 pm
See the spoiler titled "Derivation (http://ourl.ca/9901/189836)"
Title: Re: Pitagoric Triplet
Post by: christop on March 25, 2011, 07:30:00 pm
Spoiler For Spoiler:
I got up to this point:

B=(200(A-100))/(A-200)

but I got stuck when plugging in (200(A-100))/(A-200) for B in the original equation...
Title: Re: Pitagoric Triplet
Post by: AngelFish on March 25, 2011, 07:32:51 pm
I suppose you could do that, but it sounds really painful. At that point, I just recognized that the answer would necessarily be a natural number, so all you have to do is find a number A such that sqrt(A2+((200(A-100))/(A-200))2) is a whole number. That sounds like random guessing, but I already had a good idea of the value of A, so I really only had to deal with thirty values or so, which is easily done in your head.
Title: Re: Pitagoric Triplet
Post by: christop on March 25, 2011, 07:43:49 pm
I suppose you could do that, but it sounds really painful. At that point, I just recognized that the answer would necessarily be a natural number, so all you have to do is find a number A such that sqrt(A2+((200(A-100))/(A-200))2) is a whole number. That sounds like random guessing, but I already had a good idea of the value of A, so I really only had to deal with thirty values or so, which is easily done in your head.
It's not easily done in MY head! :)
Title: Re: Pitagoric Triplet
Post by: AngelFish on March 25, 2011, 07:46:22 pm
I must be a freak then, because I still can't count change properly without spending some serious thought :P
Title: Re: Pitagoric Triplet
Post by: Xeda112358 on March 25, 2011, 07:50:19 pm
Aww, I was going in the completely crazy direction... :(
Spoiler For Spoiler:
{a,b,c}={m2-n2,2mn,m2+n2}
From there I did:
200=m2-n2+2mn+m2+n2
Which simplifies to:
200=m2+2mn+m2
200=2m2+2mn
100=m2+mn
100=m(m+n)

That told me that m and n had to be less than 10. I got nowhere. Then I realised that the result was not likely to be a primitive Pythagorean Triple. So I took the prime factors of two hundred:
200=23*52
I divided by the highest factor (5) and got 40
20=m(m+n)

So m had to be less than sqrt(20). That got me to m=4, n=1. So:
{a,b,c}={m2-n2,2mn,m2+n2}
{a,b,c}={42-12,2*4*1,42+12}
{a,b,c}={16-1,8,16+1}
{a,b,c}={15,8,17}

That gives us 15+8+17=40, so multiply those by 5 and you get:
{a,b,c}={75,40,85}
Title: Re: Pitagoric Triplet
Post by: Deep Toaster on March 25, 2011, 08:41:09 pm
Here's a harder one: Find natural numbers a, b, and c where a3+b3=c3 :P
Title: Re: Pitagoric Triplet
Post by: Xeda112358 on March 25, 2011, 08:41:38 pm
:P We discussed this on IRC
Title: Re: Pitagoric Triplet
Post by: AngelFish on March 25, 2011, 10:20:29 pm
Does a proof that it's not possible count?
Title: Re: Pitagoric Triplet
Post by: Munchor on March 26, 2011, 07:14:25 am
I like what Zeda did, at least, I get most of it :)
Title: Re: Pitagoric Triplet
Post by: Deep Toaster on March 26, 2011, 01:26:33 pm
Does a proof that it's not possible count?

Sure. Post a full, formal proof here.
Title: Re: Pitagoric Triplet
Post by: Goplat on March 26, 2011, 07:07:35 pm
Here's a harder one: Find natural numbers a, b, and c where a3+b3=c3 :P

03 + 03 = 03

And yes, 0 is a natural number. The standard way to define the natural numbers in modern mathematics is to represent 0 with the empty set, 1 as the set {0}, 2 as the set {0,1}, etc.
Title: Re: Pitagoric Triplet
Post by: AngelFish on March 26, 2011, 07:25:12 pm
That's defining the cardinality as a number, which it does not appear to be. For example, the cardinality of the set of natural numbers is infinity. The cardinality of the set of real numbers is of a greater infinity. If cardinality are real numbers, then would there not be multiple types of natural infinities?