0
$\begingroup$

$x$ and $y$ are two integer numbers and $x \geq y$. The values of $x$ and $y$ are positive or negative integers. When the sum of these two numbers are multiplied by $y$ we obtain $P$ and when the absolute value of the subtraction of these two numbers is multiplied by $x$ we obtain $Q$. Given $P$ and $Q$ we need to find the value of $x$ and $y$. An input example: $(160, 48)$ output: $(12, 8)$

I'm trying to solve this by systems, but I don't know how to solve it when there's this absolute value of $x-y$.

$\endgroup$
  • $\begingroup$ I don't see the need for the absolute value, since $X \geq Y$. $\endgroup$ – Gary. Jul 11 '15 at 18:45
  • $\begingroup$ @Gary, Perhaps the problem setter wanted to remove ambiguity in case the student interpreted the "subtraction of these two numbers" as $y-x$. Which would make it negative, but the problem setter wanted it to be positive? I dunno. $\endgroup$ – Zain Patel Jul 11 '15 at 18:47
1
$\begingroup$

We have the equation $$y(x+y) = p$$ and $$x|x-y| = x|y-x| = q.$$

But since $x \geq y$ then $x-y$ will always be positive so $$|x-y| = x-y.$$

Hence our system becomes $$x(x-y) = q \quad \text{and} \quad y(x+y) = p$$

Can you solve this quadratic system now?

$\endgroup$
  • $\begingroup$ Thank you, now I can solve it! :) $\endgroup$ – Mateus Coutinho Marim Jul 11 '15 at 18:45
  • $\begingroup$ @MateusCoutinhoMarim, Yay! :-) $\endgroup$ – Zain Patel Jul 11 '15 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.