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 | x_{1} | x_{2} | x_{3} | ≤ 100 |
Cost (per acre) | 400 | 160 | 280 | ≤ 20000 |
Profit (per acre) | 120 | 40 | 60 |
x_{1} + x_{2} + x_{3} ≤ 100
Since we may not use all the acres, we can introduce a slack variable (say s_{1}), which stands for the unused portion. Then we can create an actual equation instead of an inequality.x_{1} + x_{2} + x_{3} + s_{1} = 100
We can also create an inequality for the cost per acre:400x_{1} + 160x_{2} + 280x_{3} ≤ 20000
Dividing everything by 40 gives us:10x_{1} + 4x_{2} + 7x_{3} ≤ 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.10x_{1} + 4x_{2} + 7x_{3} + s_{2} = 500
We have a third function we can look at: The profit which we want to optimize:z = 120x_{1} + 40x_{2} + 60x_{3}
This gives us the following: Maximize: z = 120x_{1} + 40x_{2} + 60x_{3} → 0 = z − 120x_{1} − 40x_{2} − 60x_{3} Subject to: x_{1} + x_{2} + x_{3} + s_{1} = 100Maximise: | z = 120x_{1} + 40x_{2} + 60x_{3} → 0 = z − 120x_{1} − 40x_{2} − 60x_{3} |
Subject to: | x_{1} + x_{2} + x_{3} + s_{1} = 100 |
With | x_{1} ≥ 0, x_{2} ≥ 0, x_{3} ≥ 0, s_{1} ≥ 0 and s_{2} ≥ 0 |
x_{1} | x_{2} | x_{3} | s_{1} | s_{2} | 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.