Problem 009

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
ramchand
Posts: 2
Joined: Thu Apr 20, 2006 7:21 pm

Problem 009

Post by ramchand »

Regarding Problem 9 of the original Mathschallenge problems,
There exists exactly one Pythagorean triplet for which a + b + c = 1000
I fail to see the unique solution and doubt whether it exists.
Can anyone answer this query?
Thanks
User avatar
quintic
Posts: 141
Joined: Wed Mar 29, 2006 9:33 pm
Location: Surrey, England
Contact:

Post by quintic »

I don't want to give anything away, but I can say there is definitely a solution! And it is unique.
User avatar
euler
Administrator
Posts: 5095
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Post by euler »

Hi ramchand,

I've moved this to the "Programming Problems" section.

Like quintic said we are not able to give too much away, but I hope you've realised that the equation a + b + c = 1000 is not given in isolation; that equation certainly does not have unique solutions. But the problem states that a, b, and c are a Pythagorean triplet, which means that it is also true that a2 + b2 = c2.

[edit]Edited to remove hint - after all we don't want to take away the fun in solving the problem![/edit]
Last edited by euler on Fri Apr 21, 2006 10:45 am, edited 2 times in total.
User avatar
wwtucker
Posts: 109
Joined: Thu Mar 16, 2006 6:45 pm
Location: Champaign, IL, USA

Post by wwtucker »

Here's a way of explaning the problem without giving away and hints toward the solution.

We want positive integers: a,b,c such that a+b+c=1000 and a2+b2=c2. It is clear by inspection that there are only a finite number of possibilities - the problem statement claims that there is only one set of a,b,c that works and (essentially) asks you to find it.
ramchand
Posts: 2
Joined: Thu Apr 20, 2006 7:21 pm

Problem 9

Post by ramchand »

Thanks.
Having the assurance that the solution exists, I solved it soon enough.
balex4o
Posts: 2
Joined: Sun Jan 13, 2008 11:23 am

problem with Problem9

Post by balex4o »

Hallo,
i've been trying to solve Problem 9 and i've found the answer, but it says that my answer is wrong :( I've been looking in Internet for the answer and i've found the same answer [removed by moderator]. Is there a problem with the website, oder i think wrong :(

Code: Select all

[removed by moderator]
Last edited by euler on Sun Jan 13, 2008 12:07 pm, edited 1 time in total.
Reason: Correct answer and a workable program posted
User avatar
euler
Administrator
Posts: 5095
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: problem with Problem9

Post by euler »

Hi balex4o. I had to edit your post because you posted the correct answer and a program that would give the right answer.

Could you try submitting your answer again and let me know if the problem persists?
Image
impudens simia et macrologus profundus fabulae
balex4o
Posts: 2
Joined: Sun Jan 13, 2008 11:23 am

Re: problem with Problem9

Post by balex4o »

Well, now is everything all right ! :=)
HazardTW
Posts: 1
Joined: Mon Nov 10, 2008 6:54 am

Problem 9

Post by HazardTW »

I was trying problem #9 but do not know how to enter my answer in the text input box, ie. should it be a=###, b=###, c=### ?

... or maybe ###+###+###=1000 ?
User avatar
uws8505
Posts: 58
Joined: Tue Sep 30, 2008 3:13 pm
Location: South Korea

Re: What format to enter an answer?

Post by uws8505 »

As indicated in the problem, you should enter the product of the three numbers a*b*c.
Math and Programming are complements
badperson
Posts: 4
Joined: Fri Jan 09, 2009 8:03 pm

Problem 009

Post by badperson »

Hi,
In the pythagorean triplet problem, the example given for a^2 + b^2 = c^2

is 3^2(9) + 4^2(16) = 5^2(25)

so the answer is 25, which has a square root of 5.

the problem is supposed to end up with an answer of 1000, but 1000 doesn't have a perfect square (I mean a square root that is a whole number, maybe I'm using the wrong terminology there)

also, in the problem description, it says this:
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc
a + b + c implies three numbers whose sum equals 1000,

"find the product abc" implies a x b x c....


my program so far finds two incorrect solutions:
100(a) + 324(b) + 576(c) = 1000
total2 is: 424
10 x 10 = 100
10 x 10 = 100
18 x 18 = 324
18 x 18 = 324
24 x 24 = 576
24 x 24 = 576
are the roots 10, 18 and 24 a pythag triangle? false
36(a) + 64(b) + 900(c) = 1000
total2 is: 100
6 x 6 = 36
6 x 6 = 36
8 x 8 = 64
8 x 8 = 64
30 x 30 = 900
30 x 30 = 900
are the roots 6, 8 and 30 a pythag triangle? false
Can anyone point me in the right direction?
thanks!
bp
User avatar
daniel.is.fischer
Posts: 2400
Joined: Sun Sep 02, 2007 11:15 pm
Location: Bremen, Germany

Re: problem understanding problem 9

Post by daniel.is.fischer »

It's not the squares that should sum up to 1000, but the lengths a, b and c themselves.
You have to find a, b and c with
  • a+b+c=1000,
  • a2+b2 = c2.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
badperson
Posts: 4
Joined: Fri Jan 09, 2009 8:03 pm

Re: problem understanding problem 9

Post by badperson »

gotcha...
reworked the program, and I thought I had it right, but it's not accepting my answer:
snip
I checked, and that is a pythag triplet... am I doing it wrong?
User avatar
Tommy137
Posts: 238
Joined: Sun Feb 24, 2008 6:02 pm
Location: Cologne, Germany
Contact:

Re: problem understanding problem 9

Post by Tommy137 »

You must enter the product a*b*c.

And please edit your post and delete your solution.
Image
badperson
Posts: 4
Joined: Fri Jan 09, 2009 8:03 pm

Re: problem understanding problem 9

Post by badperson »

ok, got it, and so sorry about posting the solution, I won't do that in the future.
thanks,
bp
User avatar
rayfil
Administrator
Posts: 1412
Joined: Sun Mar 26, 2006 5:30 am
Location: Quebec, Canada
Contact:

Re: problem understanding problem 9

Post by rayfil »

And there is a special forum for those kinds of questions relating to specific Project Euler problems. Its title is quite descriptive.

ProjectEuler Problems

Please use it in the future after making sure you read the first "sticky" post.
When you assume something, you risk being wrong half the time.
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: problem understanding problem 9

Post by hk »

Can someone remember me to merge it with viewtopic.php?f=50&t=1204#p593
(Same problem was treated there)
Image
War ruins the life and health of untold numbers of innocent children.
DaRabman
Posts: 1
Joined: Tue Oct 13, 2009 11:03 pm

Re: Problem 009

Post by DaRabman »

Hi there, I'm fairly sure that my answer to Problem 9 (View Problem) is correct, and wanted to clear up the policy on form. My answer has a decimal place, should it be rounded to an integer, and if not, how many significant figures?
Thanks,
Sam.
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: Problem 009

Post by elendiastarman »

a, b, and c should all be integers and as such the product should be an integer. Methinks you're allowing a decimal into one of the three...
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
craigcussler
Posts: 4
Joined: Sun Nov 07, 2010 5:26 pm

Problem 009

Post by craigcussler »

hello, I'm trying to solve the 9th problem, so i created asimple python code:

but the answer seems to be incorrect! please can you help me to find what's wrong?
Last edited by craigcussler on Thu Nov 11, 2010 12:00 pm, edited 1 time in total.
Post Reply