0% found this document useful (0 votes)
299 views

AI3 Linear Programming

This document introduces linear programming as a tool to solve problems with multiple constraints that require maximizing an objective function. It provides an example of a company that produces ice cream sandwiches and buckets, with constraints on production quantities and materials. The solution involves writing constraint equations, graphing the feasible region, and testing the corner point solutions to find the combination of sandwiches and buckets that maximizes profit. The optimal solution was found to be 1,600 sandwiches and 850 buckets, earning a profit of $617.50.

Uploaded by

Kevin Roberts
Copyright
© Attribution Non-Commercial ShareAlike (BY-NC-SA)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
299 views

AI3 Linear Programming

This document introduces linear programming as a tool to solve problems with multiple constraints that require maximizing an objective function. It provides an example of a company that produces ice cream sandwiches and buckets, with constraints on production quantities and materials. The solution involves writing constraint equations, graphing the feasible region, and testing the corner point solutions to find the combination of sandwiches and buckets that maximizes profit. The optimal solution was found to be 1,600 sandwiches and 850 buckets, earning a profit of $617.50.

Uploaded by

Kevin Roberts
Copyright
© Attribution Non-Commercial ShareAlike (BY-NC-SA)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Linear Programming 

 
You should have a good background in graphing and solving linear equations and inequalities at this point 
which allows us to now look at a really neat way to solve more complex problems. By now you have seen 
many situations where you have to use a single equation to find a value. For example:  
 
A taxi ride costs $2.00 plus $0.35 for every mile traveled. How much would it cost to ride 5 miles?  
 
This should seem pretty easy by now. You have also dealt with situations that involve more than one 
equation, also called a system of equations. For example: 
 
Taxi A costs $2.00 for a ride plus $0.35 every mile. Taxi B costs $4.00 for a ride but only charges $0.25 per 
mile. For what distances is Taxi A a better deal?  
 
This previous example also includes an inequality as it is asking for a range of possible values, not just the 
single point where the two rides cost the same.  
 
 
But what if you have a system of equations that has multiple constraints that require more than just 
simple manipulation of one or two linear equations? Consider the following problem:  

The Yummy Dairy Ice Cream Company makes two main products:  ice cream sandwiches and small 
buckets of ice cream.  With the staff and materials available they are able to produce a maximum of 
5,000 pints of ice cream each day.  The ice cream sandwiches take 1 pint to make and the buckets contain 
4 pints. They can produce a maximum of 1600 packs of ice cream sandwiches and a maximum of 1000 
buckets each day. The company makes a profit of 20 cents per pack of ice cream sandwiches sold and 
makes 35 cents for each tub of ice cream sold.  

Ok, so not quite the same as the previous linear equations we have encountered.  It looks similar to other 
systems of equations problems except that there are a few more pieces to this puzzle.   

 
The first question to ask in a situation like this is:  What do you think the goal is?  
 
Well, if I were the owner of this company, I would probably be trying to figure out how much money I 
can make from selling my ice cream. Furthermore, I would probably be trying to find the perfect 
combination of ice cream sandwiches and buckets that can make me the most money.  

This means that we have a couple things to worry about:  

1. What combinations of sandwiches and buckets are possible given our situation?  

2. Which of these combinations makes us the most money? 

 
Let’s try a little logic first. We make more money from selling the buckets (35 cents versus 20 cents for 
sandwiches). However, it takes 4 times as much ice cream to make the buckets so we probably don’t 
want to waste all the ice cream on the buckets. We need to find some kind of middle ground.  

This is where linear programming comes in. This is a tool to help with situations like these where there 
are multiple restrictions that are being placed on our situation that we can’t solve easily by using our 
other linear equations and system of equation tools.  

So here is how we solve problems such as these:  

1. Figure out what the goal of the problem is – what are you trying to accomplish? 

2. Use all the restrictions to write equations. 

3. Graph these equations to see which combinations are possible. 

4. Look through these possible values and see which one gives you the best outcome (from step 1). 

Let’s do this with our ice cream example. We already figured out that our goal will be to maximize profit, 
so now let’s start writing some equations. We begin by looking at what our restrictions are. 

Restriction 1:  We can only make 5000 pints of ice cream each day (sandwiches take 1, buckets take 4) 

Restriction 2: We can only make 1600 sandwiches each day 

Restriction 3: We can only make 1000 buckets each day 

That’s it. The only other information in the problem deals with money which we don’t need until the end.  

Now let’s write some equations. We will call the total number of sandwiches ‘s’ and total number of 
buckets ‘b’.  These equations are called constraint equations: 

Equation 1:    1s + 4b ≤ 5, 000   (read this one carefully, make sure you get where the 1 and 4 came from) 

Equation 2:    s ≤ 1, 600  

Equation 3:   b ≤ 1, 000   

Alright, now we are set up to make a graph. Notice that these are all linear inequalities which means we 
will end up with straight lines and will need to shade the graph to find the region where they all overlap 
(if you don’t remember inequalities, you will need to review that so that the rest of this will make sense). 

Notice also that we have 2 variables here:  ‘s’ and ‘b’.  We need to put one of these on the x‐axis and one 
on the y‐axis. It doesn’t matter what you choose, just remember which one you assigned to x and which 
you assigned to y.  
 

For the following graph, we will put ‘s’ on the x‐axis and ‘b’ on the y‐axis.  

  s ≤ 1600  

 
Total Buckets  b ≤ 1000  
  of 
Ice Cream 
 
1s + 4b ≤ 5000  
 

 
Total Ice Cream Sandwiches 
 

What we have here is a system of 3 different inequalities and we have shaded in the region that could be 
possible solutions to all three. This shaded area is called the feasible region.  

If we look at our graph, everything in this feasible region could be a possible solution to the restrictions 
we were given. For example, notice that the point (400, 800) is in the feasible region. This means that if 
we make 400 sandwiches and 800 buckets, we will fall within our restrictions:  

Restriction 1:   1(400) + 4(800) = 400 + 3200 = 3600  this is under our 5000 pint limit 


 
Restriction 2:   400 ≤ 1600  so we are under our limit on number of sandwiches 
 
Restriction 3:   800 ≤ 1000 so we are under our limit on number of buckets 
 
 
Now the next question is:  Which point is going to make the most money? 
 
If we think about the point (400, 800) we can tell pretty easily that even though this is a possible solution, 
it’ not going to be the best one. There are plenty of other points that end up producing more ice cream 
which means they would make more money. We want to try and get as close to the limits as possible to 
ensure we produce as much ice cream as possible. We could make 10 ice cream sandwiches and 5 
buckets then close the factory for the day, but our company wouldn’t be in business very long.  
So what’s the solution? If we want to get as close to the limits as possible then we should be looking 
along the outer edge of the feasible region.  
 
In fact, the optimal solution will always be one of the vertices (or corners) of the feasible region.  
 
We don’t even have to look at all the points along the edges, we can just look at the corners! This is what 
makes linear programming such a useful tool. When you have thousands or even millions of different 
possible points to choose from, YOU DON’T HAVE TO TEST THEM ALL!  
 
You just have to look at the feasible region and test out the corner points.  
 
So let’s go back to our graph: 
 
 
  s ≤ 1600  
 
 
 
 
 
 
  (1000, 1000) 
Total Buckets 
  (0, 1000)  b ≤ 1000  
  of  (1600, 850) 
  Ice Cream 
 
  1s + 4b ≤ 5000  
 
 
 
 
  (0, 0)  (1600, 0) 
 
 
 
 
Total Ice Cream Sandwiches 
 
 
We have now labeled all the corner points of our feasible region. If you don’t remember how you would 
do this, you need to go back and review linear equations a bit more to see how to find where two lines 
intersect.  
 
For this situation, our possible solutions are the following points:  
 
(0,0)     (0, 1000)    (1000, 1000)           (1600, 850)          (1600, 0) 
 
  
Now our final step is to see which one of these will make us the most money (you probably have a guess 
already) 
 
 
 
Our original problem said that we make 20 cents for each pack of ice cream sandwiches and 35 cents for 
each bucket of ice cream. Let’s make this into an equation to make things a little easier. This equation is 
basically the goal of our problem so we call this our objective equation. 
 
Profit =  0.20 s + 0.35b     or to write it as a function      P ( s, b) = 0.20 s + 0.35b  
 
Let’s use this equation to test our points:  
 
P(0, 0) = 0.20(0) + 0.35(0) = 0 + 0 = 0  
 
P (0,1000) = 0.20(0) + 0.35(1000) = 0 + 350 = 350  
 
P(1000,1000) = 0.20(1000) + 0.35(1000) = 200 + 350 = 550  
 
P(1600,850) = 0.20(1600) + 0.35(850) = 320 + 297.50 = 617.50  
 
P(1600, 0) = 0.20(1600) + 0.35(0) = 320 + 0 = 320  
 
 
And this is our solution! The best combination of sandwiches and buckets will be (1600, 850) which will 
earn us $617.50. (remember that we were using x as sandwiches and y as buckets) 
 
 
Let’s review those steps then look at one more example all the way through.  
 
Step 1.   Figure out what the goal of the problem is – what are you trying to accomplish? 

Step 2.   Use all the restrictions to write equations. 

Step 3.   Graph these equations to see which combinations are possible (shade the feasible region). 

Step 4.   Look through the feasible region and see which point gives you the best outcome. The best 
solution will always be one of the corners of the feasible region so don’t waste time testing more than 
you need to.  

Here’s another one to try. There are a lot of steps involved with linear programming so be careful and 
take your time. With so many steps, it’s easy to make small mistakes so WATCH OUT!  Try this one on 
your own first and then take a look at our graph and results to compare. 

 
Mark is planning a wedding reception and needs tables to seat 240 guests. The reception hall has two 
types of tables available: circular tables that seat 8 people and rectangular tables that seat 10 people. The 
circular tables cost $35 each to rent and the rectangular tables cost $55 each to rent. The reception hall 
has 25 circular tables available and 28 rectangular tables. The floor space can only handle a maximum of 
44 tables. Which combination of circular and rectangular tables will be best?  

 
First, we look at the goal of the situation. Mark needs to find a way to seat 240 people using the tables 
and space available. More importantly, the biggest goal will be to try to save money (The goal of these 
types of problems is often about either money or space). 

So let’s see what restrictions we have on our situation (number of circular = c, number of rectangular=r): 

Restriction 1:  Total people needs to be at least 240   Æ    8c + 10r ≥ 240  


 
Restriction 2:  There are only 28 rectangular tables available  Æ    r ≤ 28  
 
Restriction 3:  There are only 25 circular tables available  Æ     c ≤ 25  
 
Restriction 4:  Total number of tables can’t exceed 44   Æ    c + r ≤ 44  
 
 
These are the only restrictions. The other information is about cost of tables which come into play at the 
end of the problem. First we need to find which combinations are possible. To do this, we make a graph:  
 
 
 
 
 
 
  c ≤ 25
 
Number of 
 
Rectangular 
 
Tables 
  (0, 28)  (16, 28)  r ≤ 28
 
 
  (0, 24) 
  (25, 19) 
 
 
 
  8c + 10r ≥ 240
  c + r ≤ 44
(25, 4) 
 
 
 

  Number of Circular Tables  
 

 
We have also filled in the feasible region and labeled the vertices. Remember, you only have to test the 
corner points. One of these will be the best choice.  

If you didn’t already make this graph on your own, take a minute to examine what’s going on here. Make 
sure you understand how the lines were graphed and why we shaded the part that we did.  
Now that we have our feasible region clearly labeled, let’s test the vertices to see which will be the best 
choice. Remember that the original goal of the problem was to try to spend as little as possible and still 
be able to seat everyone. So let’s first write an equation for the cost.  

Circular tables cost $35 each and rectangular tables cost $55 each. This gives us the formula:  

Price =  35c + 55r     or to write it as a function     P (c, r ) = 35c + 55r  

Now we plug in our corner points and see which is the cheapest.  

P(0, 28) = 35(0) + 55(28) = 0 + 1540 = 1540  

P(16, 28) = 35(16) + 55(28) = 560 + 1540 = 2100  

P(25,19) = 35(25) + 55(19) = 875 + 1045 = 1920  

P(25, 4) = 35(25) + 55(4) = 875 + 220 = 1095    

P(0, 24) = 35(0) + 55(24) = 0 + 1320 = 1320  


 

And there we have it. The least expensive option will be the point (25, 4) which translates into 25 circular 
tables and 4 rectangular tables. The final cost for this combination will be $1095. This fits all our 
constraints and, as an extra bonus, this option ended up seating exactly 240 people with no empty spots.  

If you want some more practice, it’s easy to just change some of the restrictions or prices for these 
examples and try them again. For example, what if the event center was having a special offer where 
circular tables were $20 and rectangular tables were $30. How would that change the choice? Would the 
feasible region change? Would the cheapest option still seat 240 people or would you end up with extra 
space?  

Or what if you want to have some extra tables in case people show up that are unexpected. If you change 
the total seating from 240 to 260, would that change your final selection? Would it affect your feasible 
region? Try some variations such as these so get some extra practice and get a feel for how the values in 
the word problem affect the graphs and final results.  

The concept of linear programming is pretty simple but it does involve many steps so you just have to be 
really careful when you are writing the equations, making your graphs, finding your feasible region, and 
determining your vertex coordinates.  This is more an exercise to practice writing and graphing 
inequalities than anything else. The only really new concept here is the feasible region and the fact that 
the best choices always fall on the corners of this region. The rest involves skills you already have.  

 Take your time with these problems and pay attention to detail. They are long and will take a while, but 
keep in mind that this is still better than testing every possible combination! Good luck! 

www.mathmadesimple.org 

You might also like