May 21, 2013 OPTIMIZATION: Linear Programming Linear programming (OPTIMIZATION) is the process of taking various linear inequalities (constraints) related to some situation, and finding the "best" value obtainable under those conditions lesson 1 A typical example: You produce various types of shoes. Your have limited materials and labor. Each type of shoe that you produce uses different amounts of material and labour. Each type of shoe sells for different amounts. You must determine the "best" production level to maximize your profits. Another example: You have limited amounts of flour and sugar and limited "oven" time (these are your "constraints") to make some cookies and some cakes. You sell the cookies and cakes for different prices...and you may make more money selling a cake but because of the constraints you are able to make/sell more cookies...you need to determine exactly how much you should make of each In "real life", linear programming is part of a very important area of mathematics called "optimization techniques"...in order to OPTIMIZE your profit. Linear programming is used every day in the organization and allocation of resources. The general process for solving linearprogramming problems is to first graph the inequalities (called the "constraints") to form a walled-off area on the x,y-plane These "real life" systems can have dozens or even hundreds of variables. In this class, though, you will only work with the simple (and graphable) twovariable linear case. This area is called the "feasibility region" or the "polygon of constraints".
The "feasibility region" (polygon of constraints) is the region that contains ALL the points that meet every single constraint set out at the start of the problem The second step is to determine the coordinates of the corners of this feasibility region (that is, find the intersection points of the various pairs of lines) A long time ago somebody proved that, for linear systems like this, the maximum and minimum values of the optimization equation will always be on the corners of the feasibility region. Step three is to test these corner points in the "optimization equation" for which you're trying to find the highest or lowest value. consider the following example: Let's walk through an example: The three inequalities in the curly braces are the constraints. The polygon on the plane that they create will be the feasibility region. The formula "z = 3x + 4y" is the optimization equation. Find the (x, y) corner points of the feasibility region that return the largest and smallest values of z. This will be optimizing z.
The formula "z = 3x + 4y" is the optimization equation. This is an equation that right now is GIVEN to you, but in the context of a story you may have to deduce the optimization equation. My first step is to solve each inequality for the more-easily graphed equivalent forms: turn them into y=ax + b Graph it: this is from last year imagine they are straight lines--we did this last year--draw the solid or dashed line (according to the inequality) choose a "test point"...do a test...indicate if it is true or false shade appropriately according to your test find the area that is commonly covered by all three shadings we usually use (0,0) or (10.0) true: start at line and shade toward test point false: start at line and shade away from test point find the area that is covered by all three shadings--this is the feasibility region...or the "polygon of constraints" EVERY point that is in the shaded region (including on the lines) meets all the constraints of the situation. There are an infinite number of them.
To find the corner points -- which aren't always clear from the graph -- pair up the lines that meet (thus forming a system of linear equations) and solve: the corner points are (2, 6), (6, 4), and ( 1, 3). So, to find the solution to this problem (to find the optimal solution--either a maximum or a minimum) I only need to plug these three corner points into the optimization equation: "z = 3x + 4y" z = 3x + 4y (2, 6): z = 3(2) + 4(6) = 6 + 24 = 30 (6, 4): z = 3(6) + 4(4) = 18 + 16 = 34 (-1, -3): z = 3(-1) + 4(-3) = -3-12 = -15 the maximum of z = 34 occurs at (6, 4) the minimum of z = 15 occurs at ( 1, 3). Can you outline the general steps solve this type of problem? 1. 2. 3. 4....
here's another example: constraints: there are 6 of them this vertical line means nothing I put them in this form so I can graph them a little easier optimization equation z = - 0.4x + 3.2y Graph it. Shade it. From the graph, determine which lines cross to form the corners pair them up in order to find the coordinates. start at the "top" of the shaded area and work clockwise around the edges
Now I'll plug each corner point into the optimization equation, z = - 0.4x + 3.2y Let's look at a problem in context: (1, 6): z = 0.4(1) + 3.2(6) = 0.4 + 19.2 = 18.8 (5, 2): z = 0.4(5) + 3.2(2) = 2.0 + 6.4 = 4.4 (5, 0): z = 0.4(5) + 3.2(0) = 2.0 + 0.0 = 2.0 (4, 0): z = 0.4(4) + 3.2(0) = 1.6 + 0.0 = 1.6 (0, 2): z = 0.4(0) + 3.2(2) = 0.0 + 6.4 = 6.4 (0, 5): z = 0.4(0) + 3.2(5) = 0.0 + 16.0 = 16.0 Then the maximum is 18.8 at (1, 6) and the minimum is 2 at (5, 0). A calculator company produces a scientific calculator and a graphing calculator. Past sales indicate an expected demand of at least 100 scientific and 80 graphing calculators each day. Because of limitations on production capacity, no more than 200 scientific and no more than 170 graphing calculators can be made daily. To satisfy a shipping contract, a total of at least 200 calculators must be shipped each day. If each scientific calculator sold results in a $2 loss, but each graphing calculator produces a $5 profit, how many of each type should be made daily to maximize net profits? The question asks for the optimal number of calculators, I need to determine HOW MANY of EACH KIND OF CALCULATOR to produce so my variables will be: x: # of scientific calculators produced y: # of graphing calculators produced Since they can't produce negative numbers of calculators, there are two non-negative constraints, x > 0 y > 0 What information does the story give us about the constraints? What are the limitations on "resources"?
Past sales indicate an expected demand of at least 100 scientific and 80 graphing calculators each day. Because of limitations on production capacity, no more than 200 scientific and no more than 170 graphing calculators can be made daily. To satisfy a shipping contract, a total of at least 200 calculators must be shipped each day. In addition to the two non-negative constraints, x > 0 y > 0 Also, x > 100 y > 80 x < 200 y < 170 x + y > 200 or for graphing purposes y > x + 200. The revenue equation will be the optimization equation: maximize profit P = 2x + 5y loss for sci. calc. profit for the graph. calc {x > 100 y > 80 x < 200 y < 170 y > x + 200. 20 20 Corner points are: (100, 170) either through observation or (200, 170) solving systems (200, 80) (120, 80) and (100, 100)
Test them all in R (100, 170) (200, 170) (200, 80) (120, 80) and (100, 100) R = 2x + 5y RESULT: the maximum value of R = at (x, y) = (, ) That is, scientific calculators and graphing calculators is the OPTIMAL production rate to maximize profit considering the constraints. Another example You need to buy some filing cabinets. You know that Cabinet X costs $10, requires six square feet of floor space, and holds eight cubic feet of files. Cabinet Y costs $20, requires eight square feet of floor space, and holds twelve cubic feet of files. You have been given $140 for this purchase, though you don't have to spend that much. The office has room for no more than 72 square feet of cabinets. How many of each type of model should you buy, in order to maximize storage volume? The question ask for the number of cabinets needed to maximize storage,, but always taking constraints into consideration variables will be: x: number of model X cabinets y: number of model Y cabinets Naturally, x > 0 and y > 0. costs and floor space will be my constraints volume will be my optimization equation space: cost : cost
Naturally, x > 0 and y > 0. costs and floor space will be my constraints volume will be my optimization equation cost: 10x + 20y < 140 space: 6x + 8y < 72 Naturally, x > 0 and y > 0. costs and floor space will be my constraints volume will be my optimization equation cost: 10x + 20y < 140 y < - (1/2)x + 7 space: 6x + 8y < 72 y < - (3/4)x + 9 Test the corner points at (8, 3), (0, 7), and (12, 0) (8, 3) (0, 7) (12, 0) (8, 3) (0, 7) (12, 0) you should obtain a maximum volume of 100 cubic feet by buying eight of model X and three of model Y