The moose likes Programming Diversions and the fly likes Does this count? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Reply Bookmark "Does this count?" Watch "Does this count?" New topic
Author

Does this count?

Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8439
Not sure if this qualifies or not...
Given:
a * a = b + c and
b = c - 1
Prove:
a * a + b * b = c * c

p.s. it's a way to generate arbitrarily large right triangles with integral sides.
[ June 02, 2003: Message edited by: Bert Bates ]

Eliminate fossil fuel subsidies. (If you're not on the edge, you're taking up too much room.)
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18652
Given
(1) a * a = b + c
and
(2) b = c - 1
Rearrange (2):
(3) 1 = c - b
Multiply (1) by (3)
(4) (a * a) * 1 = (b + c) * (c - b)
Simplify (4):
(5) a * a = c * c - b * b
Rearrange (5):
(6) c * c = a * a + b * b
--------------------
Quod erat demonstrandum
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1812

[ June 02, 2003: Message edited by: Joel McNary ]

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
David Weitzman
Ranch Hand

Joined: Jul 27, 2001
Posts: 1365
We have
1) a*a = b + c
and
2) b = c - 1
We're looking for squares, so square 2 to get
3) b*b = c*c - 2c + 1
Add 1 and 3
4) a*a + b*b = c*c - 2c + 1 + b + c
Substitue 2 (b = c - 1) into the right side of 4
5) a*a + b*b = c*c - 2c + 1 + c - 1 + c
Simplify
6) a*a + b*b = c*c
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
For what integral values of a,b, and c is this equation true?


Rob
SCJP 1.4
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4312

a=3, b=4, c=5
a^2 + b^2 = c^2
9 + 16 = 25


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
but are those the only values that work?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
didn'y you use A^2 + B^2 = C^2 when you were in grammer school?? It is basic gem. It works for bunch of numbers.... Plug them in for A and B and solve for C and you get your answer....
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
Also works for
5, 12 & 13
7, 24 & 25
9, 40 & 41
11, 60 & 61
etc..
Can't remember any other whole number solutions to Pythagora's equation of the top of my head but there are an inifinite number.
I also have a really nice proof of Pythagora's theorem if anyone is interested.
[ June 16, 2003: Message edited by: Andy Bowes ]

Andy Bowes<br />SCJP, SCWCD<br />I like deadlines, I love the whoosing noise they make as they go flying past - Douglas Adams
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8439
Rob -
Those aren't the only integer sided right triangles but I don't know of a formula to generate others.
Andy Bowes
Ranch Hand

Joined: Jan 14, 2003
Posts: 171
There is a very simple formula to get a list of right angle triangles with integer sides.
Ok start with x where x is the smallest side and an odd number.
z = ((x * x ) + 1 )/2
y = z - 1
 
 
subject: Does this count?
 
Threads others viewed
disadvantages with java
JMS question
Help needed on Inheritance
inheritance query
HFSJ Mock Exam 2 Question
developer file tools