(This isn't homework, its part of a puzzle, and its got me stumped)
I have 2 known numbers, n and z. They relate thus:
n=x*y
z=(x-1)*(y-1)
n-z=x+y-1
I need to find x and y. Any ideas?
![]() |
(This isn't homework, its part of a puzzle, and its got me stumped)
I have 2 known numbers, n and z. They relate thus:
n=x*y
z=(x-1)*(y-1)
n-z=x+y-1
I need to find x and y. Any ideas?
From what I can see you have infinite solutions. Plug in anything for x and y.
I used x=2 and y=3.
I essentially agree. Any choice of n,z does not restrict the values that x and y can take. i.e. neither x nor y are functions of n or z.
The reason that I see is that you have 4 unknowns but really only 2 equations (the 3rd is just a combination of the first 2). Therefore, two variables remain unconstrained.
Your right. I forgot to mention something: All the unknowns are whole numbers. Specific whole numbers, there is only one pair x,y for each given pair n,z
So, if n=11227 and z=11016, what are x and y? Plugging in a 2 or 3 doesn't result in whole numbers.
What I need is a formula that I can plug any pair n,z into in order to get x and y.
You're right in that x and y aren't functions of n or z. It's the other way around, n and z are both functions of x and y. But n and z are what's given. Its like Jeopardy, you're given the answer and have to come up with the question.
n=x*y
z=(x-1)*(y-1)
n-z=x+y-1
from the first equ:
y=x/n
put this into the third equ:
n-z=x+x/n-1
(n-z)=x*(1+1/n)
x=(n-z)/(1+1/n)
put it back into the first equation
n=y(n-z)/(1+1/n)
y=n(1+1/n)/(n-z)
so
x=(n-z)/(1+1/n)
y=n(1+1/n)/(n-z)=-(n+1)/(z-n)
I'm not sure how these are supposed to give whole numbers. Only for very specific n,z will you get whole numbers. Not sure at the moment how we'd know which combo of n,z give whole x,y.
for the n,z you gave I get x,y=2368897/11228,11228/211
you will note, for example, that x*y=11227=n but x,y are obviously not whole numbers.
is the question, "find the values for n,z,x,y such that these equations hold and all are whole numbers"?
All times are GMT -7. The time now is 08:03 AM. |