Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫  π  -¹ ² ³ °

You are not logged in.

#26 2017-04-09 22:26:40

Member
Registered: 2016-04-16
Posts: 1,086

Re: Local fruit store

{1}Vasudhaiva Kutumakam.{The whole Universe is a family.}
(2)Yatra naaryasthu poojyanthe Ramanthe tatra Devataha
{Gods rejoice at those places where ladies are respected.}

Offline

#27 2017-04-10 00:36:42

bob bundy
Registered: 2010-06-20
Posts: 8,386

Re: Local fruit store

hi,

Here's an algebraic method with no trial and error.

Step 1 eliminate a variable so that it is a 2-D linear programming question.  Using A, B and P and working in cents

P = 100 - A - B  so

P > 2B becomes 100 > A + 3B
3A > P becomes 4A + B > 100

We also have

3B > 4A and 3A > 2B

If you were to plot (1) 3B = 4A      (2) 3A = 2B       (3) A + 3B = 100       and      (4)  4A + B = 100     these lines enclose a quadrilateral and the solution must lie therein.

In fact a sketch is sufficient.

The top left corner is found by solving (1) together with (3)  from that we find that A < 20  Continuing in this way you get to a single solution for A and B and hence for P.

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

#28 2017-05-11 22:59:36

Eduardo.juan
Member
Registered: 2017-05-11
Posts: 2

Re: Local fruit store

Dear bobbym,
I just fell on this very nice problem.
Can I ask something? I understand that you add this stack variable e to all 3 inequalities, to make them equations, right? Why does this variable has to be the same for all 3?

Thank you!

bobbym wrote:

Hi phrontister;

Okay, thanks for coming in. See you later.

Hi chen.aavazi;

Calling x = apples and y = bananas, we can reduce the system down to:

A)

100 - x > 3 y

3 y > 4 x

4 x > 100 - y

We can now graphically solve for the answer, I used Geogebra.

http://i.imgur.com/4A8ZlQC.png

The answer lies in the small darker triangle and must be an integer for (x,y). That reduces down the possibilities to just a few, as a matter of fact there is just one integer coordinate in there.

We can go a bit further with a trick that is used in numerical work which I invented?!

The three inequalities in A) can be changed to equations with the addition of what I call a slack variable... This is a term used in linear optimization but I give it an added meaning.

If 100 - x > 3 y  we only have to add something to the RHS to pick up the slack. I add e ( slack variable) which balances the inequality and gives us the equality of 100 - x = 3 y + e. We do that with all 3 inequalities and hope for the best.

100 - x = 3 y + e

3 y = 4 x + e

4 x = 100 - y + e

this can be solved by ordinary means

x = 19.0476, y = 26.1905, e = 2.38095

Remembering that x = apples and y equals bananas we can guess and try the closest integers and get apples = 19 and bananas = 26. We test to see that we are right and we are done!

Offline