For Linear Programming there are some excellent ways of using technology to help your learning. This post will look at online utilities from zweigmedia and the use of the Excel Solver.
This example from MEI (MEI Decision 1 Legacy Specimen Paper) will be used to illustrate the use of these tools.
A vet is treating a farm animal. He must provide minimum daily requirements of an antibiotic, a vitamin and a nutrient. He has two types of medicine available, tablets and liquid. The table summarises what the medicines contain and the requirements.
The tablets cost £0.38 each and liquid medicine costs £1 per dose.
The vet wants to find the cheapest way to treat the animal.
We have x as the number of tablets which the vet prescribes per day, and y is the number of doses of liquid medicine, giving us the linear programming problem:
Minimise 0.38x + y
3x + 2y ≥ 18
2x + 4y ≥ 16
10x + 50y ≥ 100
Firstly we will look at zweigmedia’s Linear Programming Grapher. This is intuitive to use. Note the option to see examples. Fraction mode is selected here.
Selecting Solve gives a clear solution illustrated graphically.
We see that the optimal solution, if x and y can take any values, is a cost of £3.20,
with x = 20/3 and y = 2/3.
We could also solve the problem using the Simplex Tool. As well as a solution it is possible to see the simplex tableaus. The Simplex Tool is needed for any problems with more than two variables.
If we wish to restrict x and y to integers, we can turn to Excel and use Solver. This allows a choice of making x and y integer or not.
Using the same example, we can set up the problem in Excel.
Vet Problem with Excel Solver is the Excel spreadsheet with annotation to explain the answer report and for full instructions on setting up the spreadsheet, use this file:
Solver Excel to solve LP problems – Colleen Young
and use Solver..
We could choose to restrict x and y to integers with Solver.
giving us the solution:
For a further example, this time a maximisation problem from Edexcel have a look at this Excel file, Badges LP Edexcel. Each sheet in the workbook is fully annotated to explain the method.