AI3 Linear Programming
AI3 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 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:
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):
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:
Now we plug in our corner points and see which is the cheapest.
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