Text problem (linear diophantine equation??)

84 Views Asked by At

An intermediary bought $\,x\,$ units of a commodity at a price of $\,€27\,\,$ and sold $\,y\,$ units at a price of $\,€37\,\,$ on $\,4$ April this year. In doing so, he made a profit of $\,€89\,\,$ earned.

The following task is given for this purpose: How much did he buy and sell on that day, if he buys a maximum of $\,50\,$ units every day?

Intuitively, I would say that this task can be solved with a linear Diophantine equation. $$ax+by= gcd(a,b)$$ and $$gcd(a,b)|c$$

$$27x+37y = c$$ But now I am at a loss as to which value is $\,c\,$ and how to proceed with $\,€89\,$ and $\,50$!

1

There are 1 best solutions below

0
On BEST ANSWER

Since 89 = 37y - 27x, we get two congruences with which we can compute x and y.

First $89 \equiv -27x \equiv 15 \mod 37$. Solve for x and you get $x \equiv 20 \mod 37$.

Second $89 \equiv 37y \equiv 8 \mod 27$. Solve for y to get $y \equiv 17 \mod 27$.

Now, 20 is the only solution for x that is positive and less than or equal to 50. So x = 20.

On the other hand, y can be either 17 or 44. Of course, since only 20 were bought then he can’t have subsequently sold more than that. So y = 17.

For verification: $37*17 - 27*20 = 629 - 540 = 89$