Skip to main content

SOLVING A REAL LIFE PROBLEM WITH A PICTURE

     John lives in a warm country. He has just 30 square meters of land. He can plant cocoa and pineapples. How much of pineapple and cocoa he has to plant in his plot to get maximum profit? This is a classical problem. It can be solved with graphs.

    Let x stand for the amount of cocoa and y for the amount of pineapple. When john harvests the crops, he will get a unit return of 3 dollars on the cocoa and of 2 dollars on the pineapples. His total return p will be  p = 3x+2y       ----(1)

    The profit p, we want to maximize. Planting comes with a cost. The unit cost of cocoa seed is 2 dollars and of pineapple, the seed is 1 dollar. Also, 4 dollars is required to cultivate both the crops in his land.

    Hence, the total cost c of growing the two crops is       c = 2x+y+4   -----(2)

     John has only 50 dollars in the bank. That is the first constraint. We write it mathematically as 

   c= 2x+y+4 < 50    ---(3)   constraint I

    The size of the field also provides the second constraint. The amount of space taken up by unit cocoa is one square meter and unit pineapple also takes one square meter land. The total amount of space s taken up by the two crops is   s=x+y -----(4)

   The size of the plot is 30 square meters. So s cannot exceed this value. s=x+y < 50    ----(5) constraint    -----II

                                                      

    It is clear that x and y both need to be greater than zero. They cannot be negative.

Solution:

     Take quantities of cocoa on the x-axis and that of pineapple on the y-axis. Convert the inequality (3) into an equation such as y = -2x+46 and plot the straight line for the equation in the graph. The points (x,y) that satisfy the inequality 3 are underneath that line (shaded area).

                        
                       ADVT: SELL ON AMAZON

    Next, we will convert inequality (5) into an equation y = -x+30 and also plot the straight line for it.



 Now the shaded region contains all the points (x,y) that satisfy both the constraints or in-equalities. The points are in the first quadrant and they are positive.

     "P is always maximized at one of the corner points of the shaded region". Here p is maximized at the corner point M.

    At M; x = 16, y = 14

hence p=3x+2y =3*16+2*14 =76

   76 dollars, maximum profit for 16 units of cocoa, and 14 units of pineapple. At other corner points, the p is smaller. You can verify yourself. The problem is solved.

    This method will work out when the equations are linear.  That is, the x and y should not have powers. Hence this process is called "linear programming".

    This method can be extended to work with more constraints (shaded region bounded by more lines) and also to work when more than two variables (crops) are involved. The extended method is called the "simplex algorithm" invented by George Dantzig. It has a wide variety of applications.

    A company makes many models of smartphones. How much quantity, the company has to manufacture in each model to maximize the profit? How to minimize the raw materials required? The simplex algorithm will answer this kind of question.  

Comments

Popular posts from this blog

THE EARTH, A SUPER ORGANISM

     JOIN MY COURSE: "Become a programmer in a day with python"       A man called 'love lock' (what a name) proposed a theory called Gaia theory, named after Greek Goddess.      It says, "Earth is a self-regulating organism like a human being.  The organic life in it interacts with in-organic matter and maintains atmosphere, temperature and environment".  Hence the earth is still suitable for the life to thrive.      Imagine, in a particular place, there are lot of flowers.  Some flowers are white and some are darkly coloured.  We know, white reflects light and heat while dark absorbs the same.  White flowers can thrive in hot climate.  But dark flowers requires cold climate.  The absorption and reflection balances and the environment reaches average, warm temperature at which both the flowers can co-exist.  This is the essence of "Gaia" theory.      On our earth, ...

DISORDER IS THE "ORDER OF THE DAY"

         Imagine a balloon full of air.  The air molecules are moving randomly inside the balloon.  Let us pierce the balloon with a pin.  The air rushes out.  Why should not the air molecules stay inside the balloon safely and ignore the little hole?  That is not the way the world works.  The molecules always "want to occupy as many states as possible".  Hence the air goes out in the open to occupy more volume.   The things always goes into disorder (entropy) and the disorder increases with time.  The above statement is what we call "second law of thermodynamics".      Consider a cup of coffee on the table. Suppose the heat from entire room flows to your cup of coffee, the coffee will boil and the rest of the room will freeze.  Freezing means bringing things to order and arrangement.  It violates the second law.  Hence it will never happen.  Hence heat must flow from high ...

CASINO'S GAME

           Let us find out how the casino survives with mathematics.      Say, your friend invite you for a game of dice.  You must bet (wager) 2 dollars.  If you roll 'six' you will get back 8 dollars.  The game will go on for 30 rounds.  All sounds good.      The probability of rolling 'six' is 1/6.  Since the game will be played for 30 times, the 'expected win' is 30*1/6 = 5.  That is, you are expected to win 5 rounds out of 30.  Hence your gain will be 5 * 8 =40 dollars.  ok.  This also implies that you will loose 25 rounds.  Hence your loss will be 25*2 =50 dollars.  Your net gain will be gain-less = 40-50 = -10 dollars. For 30 rounds, the loss is -10 dollars, Hence, for one round =-10/30 = -1/3 dollars.  There will be a loss of -1/3 or 0.33 dollars per round.  It is not a fair game.     Let us make a simple formula to calculate  'Pa...