Author Topic: Pitagoric Triplet  (Read 11996 times)

0 Members and 2 Guests are viewing this topic.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Pitagoric Triplet
« 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.


Offline Goplat

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 289
  • Rating: +82/-0
    • View Profile
Re: Pitagoric Triplet
« Reply #1 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² ;)
Numquam te deseram; numquam te deficiam; numquam circa curram et te desolabo
Numquam te plorare faciam; numquam valedicam; numquam mendacium dicam et te vulnerabo

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Pitagoric Triplet
« Reply #2 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.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Pitagoric Triplet
« Reply #3 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.
« Last Edit: March 25, 2011, 07:05:41 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline christop

  • LV3 Member (Next: 100)
  • ***
  • Posts: 87
  • Rating: +20/-0
    • View Profile
Re: Pitagoric Triplet
« Reply #4 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
Christopher Williams

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Pitagoric Triplet
« Reply #5 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

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Pitagoric Triplet
« Reply #6 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.
« Last Edit: March 25, 2011, 07:24:31 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Pitagoric Triplet
« Reply #7 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.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Pitagoric Triplet
« Reply #8 on: March 25, 2011, 07:28:40 pm »
See the spoiler titled "Derivation"
« Last Edit: March 25, 2011, 07:29:11 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline christop

  • LV3 Member (Next: 100)
  • ***
  • Posts: 87
  • Rating: +20/-0
    • View Profile
Re: Pitagoric Triplet
« Reply #9 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...
Christopher Williams

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Pitagoric Triplet
« Reply #10 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.
« Last Edit: March 25, 2011, 07:40:48 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline christop

  • LV3 Member (Next: 100)
  • ***
  • Posts: 87
  • Rating: +20/-0
    • View Profile
Re: Pitagoric Triplet
« Reply #11 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! :)
Christopher Williams

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Pitagoric Triplet
« Reply #12 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
« Last Edit: March 25, 2011, 07:47:10 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Pitagoric Triplet
« Reply #13 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}

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Pitagoric Triplet
« Reply #14 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