How many of each kind of fruit was bought

diophantine equationslinear-diophantine-equations

A customer bought a dozen of apples and oranges $\$1.32$. If an apple costs $3$ cents more than oranges and more apple than oranges were bought, using linear diophantine equation find,how many of each kind of fruit was bought.

My Attempt:

$$x \leftarrow number\ of\ apples$$

$$y \leftarrow number \ of\ oranges$$
$$z \leftarrow cost \ of \ an \ orange \ in \ \underline{dollar}$$
so then I get
$$x+y=12$$ and
$$x(z+0.03)+yz=1.32$$
$$0.03x+12z=1.32$$
multiplying the both sides by 100 then
$$3x+1200z=132$$
$$x+400z=44$$
then the general solution of $x+400z=44$ is $z=t,x=44-400t$ where $t \in \mathbb{Z}$

since $z,x>0$
$$t>0 \ and \ t<0.11$$
then I stuck, answer of this problem got $z$ as cost of an orange in cents but here I got $z$ as cost of an orange in dollar where am I wrong? why my method is wrong?

Best Answer

You are assuming that $z=t$ (the price of an orange in dollars) is an integer (why?) and you conclude that $0<t<0.11$ which implies that such integer does not exist.

On the other hand, by assumption $100z$ is an integer (the price of an orange in cents) and $x$ is an integer in $(0,12)$ such that, by your work, $$x=44-400z=4\underbrace{(11-100z)}_{\in\mathbb{N}^+}\in \{4,8\}.$$ Since $x>y$ (more apples than oranges), it follows that $x=8$ and $z=0.09$.

Related Question