Equation solving help for the intellectually challenged
June 4, 2007 6:49 AM   Subscribe

(x + y)-(x*y)=79. What are x and y?

I know that, once upon a time I knew how to do this - sadly it must be in one of the parts of my brain knocked out by decades of alchol. Apparently neither are allowed to be 0 - which ruled out my boss' solution. Any help much appreciated - particularly if you show your working out!
posted by prentiz to Science & Nature (17 answers total) 2 users marked this as a favorite
 
-5 and 14.
posted by krark at 6:52 AM on June 4, 2007


Response by poster: Isn't -5*14 -70...
posted by prentiz at 6:55 AM on June 4, 2007


prentiz: it is...
posted by edd at 6:59 AM on June 4, 2007


Isn't -5*14 -70

Yes, but a negative times a negative equals a positive, so:

-5 + 14 - (-70) = 9 + 70 = 79
posted by cerebus19 at 6:59 AM on June 4, 2007


Show your work! In my dim Monday morning, pre-coffee genius, I have successfully proven that x=x and y=y.

I expect the Nobel people's call shortly.
posted by robocop is bleeding at 7:00 AM on June 4, 2007 [3 favorites]


There's two variables and only one equation, so there's a bunch of solutions. Valid pairs (assuming no zeroes) include:
-12, 7
-5, 14
-2, 27
-1, 40
2, -77
3, -38
There aren't any positive integer solutions.
posted by 0xFCAF at 7:00 AM on June 4, 2007


There are infinitely many solutions to this - they all lie on a hyperbola. Pick any value you want for y, except y=1. Then let x=(79-y)/(y-1).

For example, (x,y) = (-77,2) or (-38,3) or (-25,4) or...

Is there some other constraint that you need satisfied?
posted by Wolfdog at 7:01 AM on June 4, 2007 [1 favorite]


I assume we're also taking this to be Diophantine?
posted by edd at 7:03 AM on June 4, 2007


I just did it off the top of my head and wrote down the first integer solution that came through. Wolfdog is correct, there are infinite solutions because you're describing a hyperbola.
posted by krark at 7:04 AM on June 4, 2007


Oh and this will let you calculate it and also gives methods of solving in general.
posted by edd at 7:06 AM on June 4, 2007


You have 1 equation but 2 unknowns, so there is no unique solution, but you can re-arrange the equations.

Simply pick an x or y, and plug it into the appropriate equation to find the corresponding y or x:
    y = (79 - x) / (1 - x)
    x = (79 - y) / (1 - y)
e.g. if x = -1, then y = 80 / 2 = 40
posted by rjt at 7:07 AM on June 4, 2007


And that's the trick, having one of the numbers be negative. If both x and y are positive then the largest value for (x+y)-(x*y) is 1 when x=1: (1+y)-(1*y) = 1+y-y = 1. If you increase x and y it'll be in vain, for (x*y) grows faster than (x+y) you will only get further and further away from 79.
posted by Khalad at 7:07 AM on June 4, 2007


Here's my Python solution: askme.py. It finds 13 solutions.
posted by jepler at 7:23 AM on June 4, 2007


As has been said there are infinitely many solutions. Just solve for y:
(x + y)-(x*y)=79
y-xy=79-x
y(1-x)=79-x
y=(79-x)/(1-x), as long as x=/=1. If you're trying to maximize y for positive values of x you can just notice the horizontal asymptote at y=(-1)/(-1)=1, but there is no positive x that corresponds to y=1; x has to be infinitely large.
Just look at a graph of y=(79-x)/(1-x) and notice that any (x,y) point on the graph represents a solution.
posted by monkeymadness at 8:24 AM on June 4, 2007


Here's a nice way to think about it, which gives you a general way to solve all problems of this form. Instead of

x + y - xy = 79

write

-1 + x + y - xy = 78

or

1 - x - y + xy = -78

Now note that we can factor the left side to get

(1-x)(1-y) = -78

and what's left is to factor -78 in every way we can think of. For instance, -78 = -6 x 13; this yields

1-x = -6, 1-y = 13

or x=7,y=-12. It's not hard to write down all the factorizations of -78; each factorization is of the form -78 = (m) (-78/m) where m is a positive divisor of 78. Now 78 has 8 positive divisors, so there are 8 choices for m; for each of choices, we can now either take 1-x = m or 1-y = m. But note that x and y are not allowed to be 0, so we shouldn't let m = 1, which leaves 7 choices for m, each giving two choices for (x,y). That's 14 solutions, namely, the ones given by 0xFCAF above (together with those obtained by flipping x and y.)

Remark: the fact that there are two variables and one equation does suggest, but not imply, that there are infinitely many real solutions (what about x^2 + y^2 = 0?) but it is definitely not obvious (though it is true in this case) that there are a bunch of solutions with (x,y) integers. Indeed, the problem of understanding when an equation in two variables has any integer solutions is at the very heart of number theory and lots of people like me spend our whole lives studying it!
posted by escabeche at 8:32 AM on June 4, 2007 [3 favorites]


robocop is bleeding: don't you mean the Field's Medal? :)
posted by yggdrasil at 11:07 AM on June 4, 2007


No, no, Fields medal is for doing mathematics; Nobel prize (probably in economics) is for x=x kinds of trivialities.
posted by Wolfdog at 11:18 AM on June 4, 2007 [1 favorite]


« Older What should I do with my life?   |   To doublemajor or not to doublemajor? Newer »
This thread is closed to new comments.