In this video, I will be solving this LP problem in Desmos.
Go to Desmos.com Click Graphing Calculator.
I’m going to begin with the first constraint.
On the left here, I’m going to type 2x + y
then I can click the keypad icon here and click the ≤ sign.
I can also do that on the keyboard by typing the less than sign followed by the equal sign.
Then 40.
Now, I’m going to zoom out by clicking the minus button a few times.
I can click anywhere on the graph and drag to the position I want.
I can press Ctrl and scroll on the mouse to zoom.
Now, I want to keep the graph in the first quadrant
because of non-negativity and get rid of this overflow here.
I’m going to type curly bracket, then x>=0.
Close the bracket.
Then do the same for y.
And this looks much better.
Next, I’m going to copy the first constraint and paste it on the second line for the second
constraint.
That one is 3x + 4y <= 120.
I’m going to paste on line 3 for the 3rd constraint as well
That one is y >= 4.
Now, I can see that the intersection of the 3 constraints is this region here.
If you’re not sure, you can hide one constraint at a time by clicking on the circles to see
what’s left shaded.
Since I now know where my feasible region is,
I can change the constraint signs to equality to remove the shaded regions so I can better
see the lines.
I’m going to control scroll to zoom in.
Next, I can view the coordinates of the corner points of the feasible region by clicking
at each corner and holding for about 2 seconds.
If you don’t get the actual intersection point, just click and hold again.
Now, if we want, we can evaluate the objective function at each of these points to determine
which is optimal.
On the other hand, we can add the objective function line as well.
The objective function is 2x + 5y.
We can make it equal to any letter, say Z.
If you see add slider, just click on the letter Z and it will automatically create the slider.
You can see the Z line down here.
If I slide up and down, it doesn’t move much
because the range is from -10 to 10.
I’m going to click on the 10 and change the upper limit to like 300.
Now, I can slide much beyond the feasible area.
Since this is a maximization problem, the highest point the objective function line
touches just before leaving the feasible region is the optimal solution point.
So, the optimal solution occurs at X = 0, and Y = 30.
And the corresponding objective function value is 150.
We usually draw the objective function line as dotted line to distinguish it from constraint
lines.
So I’m going to click the settings icon here
click the objective function circle and select dotted line.
I can also change the colour by choosing and of the options here.
I’m going to put it back in purple and click Done.
Let’s hide the objective function line temporarily.
Now, suppose this were a minimization problem where all the constraints are “greater than
or equal to” constraints.
Then the feasible region will be to the right here.
I can then click and hold the corner points for about 2 seconds to reveal their coordinates.
Note again that you might need to click more than once to get the intersection right.
You can then substitute these into the objective function to determine the minimum.
On the other hand, I can turn on the objective function line,
then slide it down till I touch the lowest point,
which will represent the optimal solution point.
Note that the objective function value at this point is 89.333.
90 is displayed here because the objective function is not exactly at the intersection
point and because the slider is not displaying decimals.
Finally suppose the objective function is 12x + 5y,
then the optimal solution for our initial maximization problem will occur at (4, 18)
here.
And for the minimization problem, the optimal solution will occur at (0, 40) here.
And that’s it for this video.
Thanks for watching.