Putting It Together
A farmer has 100 acres of available land where he wants to plant a mixture of corn, wheat and spinach. It costs him $400 to produce an acre of corn, $160 to produce an acre of wheat, and $280 to produce an acre of spinach. He has a maximum of $20,000 to spend. He makes a profit of $120 per acre on corn, $40 per acre on wheat and $60 per acre on spinach. How many acres of each crop should he plant? We first start by making a table for the various crops:Profits and Constraints for Crops | ||||
Corn | Wheat | Spinach | Total | |
Number of Acres | x1 | x2 | x3 | ≤ 100 |
Cost (per acre) | 400 | 160 | 280 | ≤ 20000 |
Profit (per acre) | 120 | 40 | 60 |
x1 + x2 + x3 ≤ 100
Since we may not use all the acres, we can introduce a slack variable (say s1), which stands for the unused portion. Then we can create an actual equation instead of an inequality.x1 + x2 + x3 + s1 = 100
We can also create an inequality for the cost per acre:400x1 + 160x2 + 280x3 ≤ 20000
Dividing everything by 40 gives us:10x1 + 4x2 + 7x3 ≤ 500
Since we may not use all the money, we can introduce a slack variable (say s2), which stands for the unused portion and then we can create an actual equation instead of an inequality.10x1 + 4x2 + 7x3 + s2 = 500
We have a third function we can look at: The profit which we want to optimize:z = 120x1 + 40x2 + 60x3
This gives us the following: Maximize: z = 120x1 + 40x2 + 60x3 → 0 = z − 120x1 − 40x2 − 60x3 Subject to: x1 + x2 + x3 + s1 = 100Maximise: | z = 120x1 + 40x2 + 60x3 → 0 = z − 120x1 − 40x2 − 60x3 |
Subject to: | x1 + x2 + x3 + s1 = 100 |
With | x1 ≥ 0, x2 ≥ 0, x3 ≥ 0, s1 ≥ 0 and s2 ≥ 0 |
x1 | x2 | x3 | s1 | s2 | Z | |||
1 | 1 | 1 | 1 | 0 | 0 | 100 | ||
10 | 4 | 7 | 0 | 1 | 0 | 500 | ||
-120 | -40 | -60 | 0 | 0 | 1 | 0 |
Licenses & Attributions
CC licensed content, Original
- Authored by: Paul Jones and Lumen Learning. License: CC BY: Attribution.