Modular arithmetic word problem

1.7k Views Asked by At

We are buying a total of 12 fruits (apples and bananas) for 132 dollars. If the apples are 3 dollars more expensive than the bananas, and we bought more apples than bananas, how many bananas we bought?

Or in other words:

  • Let $a=$ Apple price
  • Let $b=$ Banana price
  • Let $x=$ Apples bought
  • Let $y=$ Bananas bought

We know that:

$$x+y=12$$

$$x>y$$

$$a=b+3$$

$$xa+yb=132$$

therefore $$x(b+3) + yb=132$$

which yields $x=44-4b$ or $y=4b-32$

1

There are 1 best solutions below

8
On BEST ANSWER

Let be $\,x=$ the number of apples, $\,a=$ price of each apple, $\,y=$number of bananas, $\,b=$ price of each banana, then you have the equations

$$x+y=12\Longleftrightarrow x = 12-y\;\;,\;\;\;ax+by=132\;\;,\;\;\;a=b+3\Longleftrightarrow$$

$$(b+3)(12-y)+by=132\Longleftrightarrow 4b-y=32$$

Do a little more algebra, take into account that $\,y>x\,$ and they both are integers...and what is a clear divisor of $\,y\,$?