flat assembler
Message board for the users of flat assembler.

Index > Heap > Math Question

Author
Thread Post new topic Reply to topic
victor



Joined: 31 Dec 2005
Posts: 126
Location: Utopia
victor
It seems that many of us are interested in Math challenges. Here is a question I found in a Math & Science journal.

Given that a & b are positive integers and (ab - 1) / (a + b) = 2007. Find the min and max values of the sum (a + b). Smile
Post 25 Mar 2008, 03:34
View user's profile Send private message Reply with quote
victor



Joined: 31 Dec 2005
Posts: 126
Location: Utopia
victor
Already worked out the max value, which is (2008 + 4030057) = 4032065.

To find the min value, we may try all integers starting from 4014 and go backward (4013, 4012, 4011, ...), up to 2008.

Any smarter methods? Smile
Post 25 Mar 2008, 03:43
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 821
Location: Jakarta, Indonesia
TmX
This is my idea

Let's assume (ab-1)/(a+b) = 2007/1, so ab-1 = 2007 and a+b = 1 Laughing

ab - 1 = 2007 --> ab = 2008 ... (1)
a + b = 1 --> a = 1-b ... (2)

Substituting (2) to (1) gives :
(1-b)b = 2008
b - b^2 = 2008
b^2 - b + 2008 = 0

Well, the solution is irrational numbers, so (a+b) must be > 1 Laughing
Post 25 Mar 2008, 03:50
View user's profile Send private message Reply with quote
AlexP



Joined: 14 Nov 2007
Posts: 561
Location: Out the window. Yes, that one.
AlexP
Smile Brute force!!!
Post 25 Mar 2008, 04:45
View user's profile Send private message Visit poster's website Reply with quote
r22



Joined: 27 Dec 2004
Posts: 805
r22
(((2007*y+1)/(y-2007)) * y - 1) / (((2007*y+1)/(y-2007)) + y) = 2007
...
...
...
funny Victor
Post 25 Mar 2008, 19:55
View user's profile Send private message AIM Address Yahoo Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.