Video Transcript
In this video, we will learn how to
find the optimal solution of a linear system that has an objective function and
multiple constraints. The method that we will use to find
this optimal solution is called linear programming. Letβs begin by looking at a
definition.
Linear programming is a method to
find an optimal that is a maximum or minimum solution for a given linear objective
function bounded by constraints represented by linear inequalities. Letβs consider a linear function
that is a function of two variables π₯ and π¦ such that π of π₯, π¦ is equal to
ππ₯ plus ππ¦ plus π. This is known as the objective
function and is defined for all π₯- and π¦-values. As stated in the linear programming
method, we also include constraints that are represented by linear inequalities. For example, we could have that
both π₯ and π¦ are greater than or equal to zero. We could also have constraints that
involve both variables. For example, π₯ plus π¦ is less
than or equal to five.
Given this objective function and a
set of constraints, we need to solve for an optimal solution, which will either
maximize or minimize the objective function. One way to represent this is to
draw a two-dimensional graph. We begin by drawing an π₯π¦-plane
as shown. We can now use the constraints to
find an area on the graph that satisfies these. Firstly, as π₯ is greater than or
equal to zero, we can draw a line at π₯ is equal to zero. In this case, this is a solid
line. However, if the inequality was a
strict inequality, π₯ is greater than zero, weβd use a dotted line.
At this stage, we can either shade
out or shade in the region we want. We know that any values of π₯ to
the left of this vertical line will be outside of our region. So in this example, we will shade
out the region. We can do something similar with
our next constraint. Since π¦ is greater than or equal
to zero, we can draw a line at π¦ equals zero. The area below the π₯-axis will not
be in our feasible region. Letβs now consider the third
constraint. π₯ plus π¦ is less than or equal to
five. In order to represent this on our
graph, weβll firstly draw the line with equation π₯ plus π¦ equals five. Substituting π₯ equals zero into
this equation gives us π¦ is equal to five. Likewise, when π¦ is equal to zero,
π₯ is equal to five. We can therefore conclude that the
points with coordinates zero, five and five, zero will lie on this line.
Next, we must determine which area
on the graph this linear inequality represents. One way of doing this is to make π¦
the subject. Subtracting π₯ from both sides of
the inequality, we have π¦ is less than or equal to negative π₯ plus five. This means that the line drawn has
equation π¦ is equal to negative π₯ plus five. Therefore, the region where the
π¦-coordinate is less than negative π₯ plus five is below the line as this is where
the π¦-coordinates are smaller. We can therefore shade out the
region above the line. We now have a region shaded in
green that satisfies all three of these constraints. This is known as the feasible
region. And any point outside of this area
violates at least one of the constraints.
Any point inside this feasible
region could potentially be an optimal solution for the objective function. However, this provides us with a
problem, as there are an infinite number of solutions inside this region. As a result, this is where an
amazing property of this method comes in. Whenever we have a well-defined
feasible region as in this case, then the only points that we need to check for an
optimal solution are the vertices of the feasible region, in this case the points
with coordinates zero, zero; zero, five; and five, zero. These are the only points at which
we could have a maximum or minimum value. In order to see why this is the
case, letβs consider a three-dimensional sketch.
In general, our objective function
takes in two variables, in this case π₯ and π¦. And this function outputs some
value from them. We will call this a π§-value. And we can plot this on a π§-axis
of our coordinate frame. As our objective function has both
π₯- and π¦-values, it wonβt be represented by a line, but instead by a plane. In other words, if we were to plot
the objective function for all π₯- and π¦-values, it would be a plane that would
look something like this, where the points on this plane represent all π§-values or
objective function values for every possible π₯ and π¦ input combination. This means that π§ could be
infinitely positive or infinitely negative. However, for any given linear
programming problem, only a subset of these π§-values are allowed. They are the π§-values that
correspond to the π₯- and π¦-values in the feasible region.
To see what this feasible set of
π§-values is, we can project upwards onto the plane. When we do this, another triangular
region is created. But this one follows the slope of
our plane. If we consider the vertices of the
feasible region in the π₯π¦-plane, we notice that these project onto the very
highest and very lowest values of π§. This means that the maximum and
minimum solution will occur on one of these vertices. Whilst this isnβt a conclusive
proof that the optimal solution lies at one of the vertices of the feasible region,
it at least suggests that this is plausible. However, this is true. Regardless of what kind of plane we
have and what angle it takes, when we project the feasible region onto it, one or
more of the vertices will represent the optimal solution.
In summary, in order to find an
optimal solution, we substitute the coordinates of the vertices of the feasible
region into the objective function. Doing this for all vertices will
enable us to find the maximum and minimum solution. Letβs now consider how this works
in practice.
Using linear programming, find the
minimum and maximum values of the function π is equal to four π₯ minus three π¦
given that π₯ is greater than or equal to zero, π¦ is greater than or equal to zero,
π₯ plus π¦ is less than or equal to nine, and π¦ is greater than or equal to
five.
As well as the information in the
question, we are given a graph which shows the feasible region for our
constraints. There are four such constraints
represented by linear inequalities. We note that since π¦ must be
greater than or equal to zero and greater than or equal to five, we only need to
consider the second inequality. This is represented by the
horizontal line that passes through five on the π¦-axis. The inequality π₯ is greater than
or equal to zero is represented by the line π₯ equals zero. And the feasible region is
everything on or to the right of this line, all values of π₯ greater than or equal
to zero.
Finally, we have the line π₯ plus
π¦ is equal to nine. And since π₯ plus π¦ is less than
or equal to nine or π¦ is less than or equal to negative π₯ plus nine, then the
feasible region contains all points on or below this line. If our inequality had just been
less than, the feasible region would just be below the line.
In this question, we are asked to
find the minimum and maximum values of the function π is equal to four π₯ minus
three π¦. And using linear programming, we
know that these occur at one of the vertices of our feasible region. These three vertices have
coordinates zero, five; zero, nine; and four, five. It is only at these values that our
function can be optimal, i.e., have a minimum or maximum value. Substituting π₯ equals zero and π¦
equals five into our function, we have π is equal to four multiplied by zero minus
three multiplied by five. This is equal to negative 15. At the point zero, nine, we have π
is equal to four multiplied by zero minus three multiplied by nine. This is equal to negative 27.
Finally, at the vertex of the
feasible region, where π₯ equals four and π¦ equals five, we have π is equal to
one. We now simply choose the minimum
and maximum of these three results. We see that negative 27 is the
minimum value and one is the maximum value. The minimum and maximum values of
the function π is equal to four π₯ minus three π¦ subject to the given constraints
are negative 27 and one.
We will now look at a second
example in context.
A small company dyes shirts to be
either solid-color or tie-dye, and they want to decide how many shirts of each color
to prepare for an upcoming sale. The company has a budget of 240
dollars. Purchasing an undyed shirt costs
two dollars. It costs an additional 50 cents to
dye a shirt with a solid color and one dollar 50 to dye a shirt with a tie-dye
pattern. The company only has eight hours to
prepare all the shirts for the sale. And it takes two minutes to produce
a solid-color shirt and 10 minutes to produce a tie-dye shirt. They decide to make a graph to help
them maximize profit, given that they make eight dollars profit for each solid-color
shirt and 10 dollars profit for each tie-dye shirt. Let π₯ represent the number of
solid-color shirts and π¦ represent the number of tie-dye shirts.
There are three parts to this
question, which we will look at shortly. Before doing this, letβs consider
some of the information we are given. There are two types of shirts made
by the company, solid-color shirts represented by π₯ and tie-dye shirts represented
by π¦. We will solve this problem using
linear programming by firstly defining an objective function and some constraints in
the form of linear inequalities. The company is looking to maximize
profit. And we are told they make an
eight-dollar profit for each solid-color shirt and a 10-dollar profit for each
tie-dye shirt. This means that the profit in
dollars π is equal to eight π₯ plus 10π¦. We can also write this as a
function in terms of π₯ and π¦ such that π of π₯, π¦ is equal to eight π₯ plus
10π¦.
The constraints placed on the
company involve both time and money. If we consider money first, we are
told that the company has a budget of 240 dollars. We are told that an undyed shirt
costs two dollars and that it costs an additional 50 cents to dye a shirt with a
solid color and one dollar 50 to dye a shirt with a tie-dye pattern. It therefore costs two dollars 50
to make each solid-color shirt. As the company are making π₯ of
these, this can be written as 2.5π₯. It costs three dollars 50 to make a
tie-dye shirt. And this can be written as
3.5π¦. We know that the sum of these terms
must be less than or equal to 240 as the total budget was 240 dollars.
Letβs now consider the time
constraints. We are told it takes two minutes to
produce a solid-color shirt and 10 minutes to produce a tie-dye shirt. The company has eight hours or 480
minutes to prepare all the shirts. This can be represented by the
inequality two π₯ plus 10π¦ is less than or equal to 480. We will now clear some space and
consider the three parts of this question.
The three parts to the question are
as follows. Which of the following shows the
feasible region? State the objective function. How many of each type of shirt
should the company produce to maximize profit?
We have already answered the second
part of this question. The objective function or profit
function in this question π of π₯, π¦ is equal to eight π₯ plus 10π¦. In the first part of this question,
weβre given four graphs with the straight lines 2.5π₯ plus 3.5π¦ equals 240 and two
π₯ plus 10π¦ equals 480 drawn on them. We know that two π₯ plus 10π¦ must
be less than or equal to 480. This means that the feasible region
lies below this line. We can therefore rule out option
(B).
We are also told that 2.5π₯ plus
3.5π¦ is less than or equal to 240. The feasible region must therefore
also lie below the blue line on our graphs. This rules out option (C). To decide whether graph (A) or
graph (D) is the correct one, we need to consider two further constraints. Since we canβt make a negative
number of shirts, both π₯ and π¦ must be greater than or equal to zero. This means that the feasible region
must lie above the π₯-axis and to the right of the π¦-axis. We can therefore rule out option
(A) as part of the feasible region here occurs when π₯ is less than zero. The correct answer to the first
part of our question is therefore option (D).
We will now clear some space and
solve the third part of this question. We recall that this asked us to
work out the number of each type of shirt the company should produce to maximize
profit. We recall that the profit or
objective function was equal to eight π₯ plus 10π¦ and that the feasible region was
subject to four constraints. We know that the possible maximum
values of the function occur at the vertices of the feasible region. So we will begin by working out the
coordinates of these points. Firstly, we have the point zero,
zero. We know that when a line intersects
the π₯-axis, π¦ is equal to zero. And substituting this into the
equation, 2.5π₯ plus 3.5π¦ equals 240, we find that π₯ is 96. So the coordinates of this vertex
are 96, zero.
In the same way, when a line
intersects the π¦-axis, our π₯-coordinate is zero. Substituting this into the equation
two π₯ plus 10π¦ equals 480 gives us π¦ is equal to 48 and another vertex at zero,
48. The fourth vertex of our feasible
region is the point of intersection of our two diagonal lines. One way of working out this point
would be to find a solution of the simultaneous equations shown. There are many ways of solving
these. One way would be to multiply the
second equation by two. This gives us the equation five π₯
plus seven π¦ is equal to 480.
Rewriting the first equation
underneath and then subtracting the two equations, we have three π₯ minus three π¦
is equal to zero. Adding three π¦ to both sides of
this equation and then dividing through by three, we see that π₯ is equal to π¦. We can then substitute this back
into our first equation such that two π¦ plus 10π¦ is equal to 480. Solving this gives us π¦ is equal
to 40 and as π₯ is also equal to this. The fourth vertex has coordinates
40, 40.
We can now substitute each of these
coordinates in turn into our objective function. It is important to note here that
any of these points could be the optimal solution and it will not necessarily be the
point of intersection we have just found. Substituting in the values of π₯
and π¦, the objective function is equal to zero, 480, 768, and 720. As the company is trying to
maximize the profit, they choose the highest value. Since π₯ represents the number of
solid-color shirts and π¦ the number of tie-dye shirts, producing 96 solid-color
shirts and zero tie-dye shirts would maximize the profit. Assuming that all the shirts were
sold, this would yield a profit of 768 dollars.
We will now summarize the key
points from this video. Linear programming is a method to
find an optimal solution for a given linear objective function bounded by
constraints represented by linear inequalities. We saw that the area bounded by the
constraints is the feasible region and that optimal solutions are found at the
vertices of this region.