

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Linear Programming
incomplete
2: Profit Function
incomplete
3: Contour Lines
incomplete
4: Simplex Algorithm
incomplete
5: Simplex Algorithm for Solving LP Problems
incomplete
6: Tableau Review
incomplete
7: Simplex Tableau – Slack Variables
incomplete
8: Simplex Tableau – Slack Variables
incomplete
9: Simplex Tableau – Basic Variables and the Solution
incomplete
10: Tableau Solution
incomplete
11: Pivoting the Tableau – When to Stop
incomplete
12: Finding the Pivot Column
incomplete
13: Finding the Pivot Row
incomplete
14: Pivot Row Review
incomplete
15: The Pivot Operation
incomplete
16: Pivot Review
incomplete
17: Solving the Whole Simplex
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Using the function we wrote to calculate profit, we can create contour lines to show where the maximum profit is found.
This will be easier to understand if we rewrite our profit function with x for num_cakes and y for num_cookies. We'll also use the single-letter variable c for profit:
c = 5x + y
The equation can then be rearranged into the "slope-intercept" form:
y = -5x + c
What we see in the graph above is a series of contour lines following this equation, with different profit values (c). Each contour line represents the relationship between cakes (x) and cookies (y) for a given profit level.
The slope is -5, meaning that for each additional cake sold, we would need to sell 5 fewer cookies to maintain the same profit.
To maximize profit, we can start with the contour line at c = 0, then shift it to the right as far as possible while having the line touch the region that meets our constraints. The furthest valid contour line has the maximum profit as its c value, and the point where it touches the feasible region gives the relevant x (cakes) and y (cookies) values.
A few contour lines are drawn in the graph above. The minimum profit value of 0 is represented by the green line, where sales are at 0. The purple line's profit is 500, the orange line's is 1000, and the yellow line has the maximum profit value of 1300.