mini
|
  |
| Joined: 13 Jul 2007 |
| Total Posts: 19 |
|
|
| 30 Jun 2012 02:23 PM |
Sorry if this is not the right forum, but this is the only place where the 'smart people' (you people would probably need to lose 10 IQ points to be classified as smart, lol) go to.
I was wondering how I could solve this with algebra : 'find two numbers whose sum is 55 and whose product is 684'
Yes, please, if you're going to answer this, please tell me how you did it.
Thanks :D |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 02:31 PM |
x+y=55 x*y=684
x=55-y
(55-y)*y=684 55y-y^2=684
y^2-55y+684=0 (y-36)(y-19)=0 y=36 or 19
x+36=55 x=19
x+19=55 x=36
x=19 or 36 y=36 when x=16, or 19 when x=36
I think that's right. |
|
|
| Report Abuse |
|
|
BrainWart
|
  |
| Joined: 09 Nov 2009 |
| Total Posts: 214 |
|
|
| 30 Jun 2012 02:33 PM |
x1 + x2 = 55 x1 * x2 = 684
I would go for trial and error. You know that there is a certain area for testable numbers. It's between 1 and 54 because two negative numbers will never add to a positive number and a negative multiplied by a positive is always a negative.
19 + 36 = 55 19 * 36 = 684
So, your two numbers happen to be 19 and 36. ~BrainWart |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 02:33 PM |
"y=36 when x=16"
y=36 when x=19 is what I meant... |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 02:34 PM |
"I would go for trial and error."
Or you do it algebraically because trial and error has the possibility to take far longer, and he's probably looking for an algebraic solution anyways... |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
mini
|
  |
| Joined: 13 Jul 2007 |
| Total Posts: 19 |
|
|
| 30 Jun 2012 02:39 PM |
@Oysi
I know this might sound stupid but...
In 'y = (-55 +- sqrt(55^2 - 4*684)) / -2'
why do you multiply by 4? ;s |
|
|
| Report Abuse |
|
|
xasdx
|
  |
| Joined: 13 Sep 2011 |
| Total Posts: 12 |
|
|
| 30 Jun 2012 02:43 PM |
| @mini because school grades count |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 30 Jun 2012 02:53 PM |
| He's using the quadratic formula. I would do substitution though. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
Varp
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 5333 |
|
|
| 30 Jun 2012 03:12 PM |
Assuming the solution is an integer, find the prime factorization:
684 = 2^2 * 3^2 * 19
Then, any factor of that has the form:
2^a * 3^b * 19^c
Where a is in {0,1,2}, b is in {0,1,2} and c is in {0,1}
2^a * 3^b * 19^c + 2^(2-a) * 3^(2-b) * 19^(1-c)
Assume, Obvious either c or 1-c is 0. The order of the factors doesn't matter, so assume c = 0.
2^a * 3^b + 2^(2-a) * 3^(2-b) * 19 = 55
Since the sum is odd, one of the summands must be odd too. Therefore, either a or 2-a is zero. a must be either 0 or 2. Rearrange this equation to:
2^a * 3^b + 19u = 55 where u = 2^(2-a) * 3^(2-b)
We see that 19u must be strictly less than 55. This is only true if u is 1 or 2. It cannot be 2, however, since that would imply a = 1, which has been disproven. Therefore u = 1 and:
u = 1 = 2^0 * 3^0 = 2^(2-2) * 3^(2-2)
Therefore, both a and b are two. Substituting in:
2^2 * 3^2 + 19 = 55 36 + 19 = 55
which satisfies the original conditions. Q.E.D.
"You have to use the quadratic formula."
Or factor. You could also just do out the steps that yield the quadratic formula, which could be easier (especially if you don't have a calculator handy) |
|
|
| Report Abuse |
|
|
Varp
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 5333 |
|
|
| 30 Jun 2012 03:13 PM |
Agh, I really need to proof read _before_ I post. Oh well. To be clear, the equation (3rd in my post) should be:
2^a * 3^b * 19^c + 2^(2-a) * 3^(2-b) * 19^(1-c) = 55
And it relies on the fact that those summands must be a factor pair:
2^a * 3^b * 19^c * 2^(2-a) * 3^(2-b) * 19^(1-c) = 2^2 * 3^2 * 19 = 684 |
|
|
| Report Abuse |
|
|
sdfgw
|
  |
 |
| Joined: 08 Jan 2009 |
| Total Posts: 41681 |
|
|
| 30 Jun 2012 03:14 PM |
every substitution seems to result in
y^2-55y+684=0
or the same with x, the solutions for both being 19 and 36
these sum/product questions seem really common
generalising then gives
y^2 - sy + p = 0
where s is the sum of x and y, p is their product and I guess the y could be x if you want
and then quadratic formula
ANSWERS = (s+-root(s^2 - 4p))/2
or rather the two numbers are [s+root(s^2-4p)]/2 and [s-root(s^2-4p)]/2
which isn't really that pretty or particularly necessary but I've done the working out and I'm going to press "Post" because I can |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 30 Jun 2012 06:28 PM |
| I just use Lua and for loops ololol |
|
|
| Report Abuse |
|
|
redditor
|
  |
| Joined: 26 Jul 2011 |
| Total Posts: 182 |
|
|
| 30 Jun 2012 07:06 PM |
| @aboy doesn't work well with irrational numbers. |
|
|
| Report Abuse |
|
|
aboy5643
|
  |
| Joined: 08 Oct 2010 |
| Total Posts: 5458 |
|
|
| 30 Jun 2012 07:10 PM |
@redditor
Then I'd solve using substitution for a system of two equations k? In Lua. |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 07:56 PM |
"You have to use the quadratic formula."
No you don't. 684 factors out to 2^2*3^2*19, or 36*19. That also adds up to 55, which is what we want (well, we want -55, so we'd make both 36 and 19 negative, but that just makes our solution set 36 and 19 anyways which is what we want). See my first post in the thread, I didn't use the quadratic formula :P |
|
|
| Report Abuse |
|
|
Varp
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 5333 |
|
|
| 30 Jun 2012 08:50 PM |
"@aboy doesn't work well with irrational numbers."
It actually does (although you'd need a special library to be entirely exact). The solution to this problem (if the sum and product are both rational) is either a quadratic surd or a rational number. The set of all possible solutions is countable and enumerable. I'm working on a program to demonstrate this. |
|
|
| Report Abuse |
|
|
Varp
|
  |
| Joined: 18 Nov 2009 |
| Total Posts: 5333 |
|
|
| 30 Jun 2012 09:53 PM |
Got it. If you feel like "being lazy" and not using the quadratic formula, the following script will test every quadratic surd for you (warning: may take a long time. It will terminate though, assuming that integers are always precise. Note that this assumption does not hold in Lua). As it's set up now, it looks for solutions to:
x + y = 3 x * y = 1
On the bin of pastes: /4cVpY4FA
Note that this algorithm is really stupid. It's strategy for finding a solution is to try every single number of the form (a + bsqrt(c))/d where a,b,c and d are integers. If a solution does exist, it will terminate (assuming the operation on integers a*b is exact. It is not). If a solution does not exist, it will not terminate. However, also included is arithmetic on any real quadratic field.
It's difficult to make an efficient algorithm to exactly solve it. The set of quadratic surds and rationals (which is what my code looks through) is dense (between any two non-equal reals, there are an infinite number of potential solutions to check), but it is countable (so there's a bijection between the natural numbers and quadratic surds)
(Also, a doesn't like going negative. It's easy to fix, but I'm lazy. If it fails to terminate, try switching the signs. Also, I'm not sure it can handle non-integer rationals. Recall that I am lazy. If you changed line 111 to have local a,b,c,d = 0,0,1,1, it'd probably work over rationals) |
|
|
| Report Abuse |
|
|
| |
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 01 Jul 2012 09:25 AM |
| @Oysi, oh yeah, I meant to say you can factor it because that seems more basic. The quadratic formula is better in general though. |
|
|
| Report Abuse |
|
|