Practice: Driving a Linear Programming Solver
Question
Construction · Direct application · Explanation
A workshop makes two products. Each unit of A takes 2 machine-hours and 1 labour-hour and contributes £30; each unit of B takes 1 machine-hour and 1 labour-hour and contributes £20. There are 100 machine-hours and 80 labour-hours available, and at most 40 units of A can be sold.
Using Excel Solver, or by hand against its documented behaviour if you do not have Excel:
(a) Describe the sheet: which cells hold the decision variables, which cell holds the objective, and how each constraint is expressed. State what each cell means.
(b) Two settings in the Solver dialog materially affect whether the answer is trustworthy. Name them, say what each should be for this model, and say what goes wrong if each is left at a value that does not suit a linear program.
(c) Report the plan and contribution Solver returns, and confirm which constraints bind.
(d) A colleague's sheet gives a different, higher contribution for the same data. Name two errors in a spreadsheet model that would produce a larger answer while still solving cleanly, and say how you would find each.
(e) Compare this entry route with passing arrays to a routine such as linprog. Name one error each form makes easier, and one it makes harder.
Write your answer, then compare it with the worked solution.
3 hints available, least help first.
Hint 1: Retrieval cue
The objective and every constraint left-hand side must be formulas referring to the changing cells, never typed values.
Hint 2: Concept cue
Two defaults in the dialog do not suit a linear program. One concerns the method, the other concerns the sign of the variables.
Hint 3: Strategy cue
For part (d), ask what a model would have to believe in order to report a contribution above £1,800.
Compare with the worked solution
Comparing does not record a result. Judging your own written answer cannot show that you can do this without help.
(a) The sheet. Two changing cells hold the decision variables: one for
- Labour-hours:
- Sales limit:
- Objective:
A complete answer does each of these:
- converts to solver form
- states the correspondence
- reverses the conversion
- scopes the status
Construction · Direct application · Explanation
A dairy blends two feeds. Each tonne of feed X costs £180 and supplies 40 kg protein and 20 kg fibre; each tonne of feed Y costs £240 and supplies 30 kg protein and 60 kg fibre. A batch must supply at least 240 kg protein and at least 240 kg fibre. No more than 8 tonnes of X is available.
Using MATLAB's linprog, or by hand against its documented argument form if you do not have MATLAB:
(a) Write the model, then state which of linprog's arrays each part belongs in, consulting its documentation for the form it expects.
(b) Give the arrays you would pass, including bounds, and state what each column index means. Say which constraints needed rewriting to fit the expected form, and why.
(c) Report the status, the point and the objective value you obtain, then reverse every conversion you applied and state the answer in the dairy's terms.
(d) Verify the reported point against the model as you first wrote it, and say which constraints bind.
(e) Name one thing the exit flag establishes and one thing it does not.
Write your answer, then compare it with the worked solution.
3 hints available, least help first.
Hint 1: Retrieval cue
Check the documented form before converting anything: which direction does it optimise, and how are inequality directions expressed?
Hint 2: Concept cue
Multiplying an inequality by
Hint 3: Strategy cue
Before reporting, list every conversion you made and check that each has been reversed or shown not to need reversing.
Compare with the worked solution
Comparing does not record a result. Judging your own written answer cannot show that you can do this without help.
(a) The model, and where each part goes. Let
linprog solves a minimisation with inequalities as
with bounds
- Fibre:
- Availability:
- Nonnegativity: both positive ✓
- Objective:
A complete answer does each of these:
- converts to solver form
- states the correspondence
- reverses the conversion
- scopes the status
Recognition · Interpretation
A colleague enters a production model into a solver. It returns status optimal, a point, and an objective value. What has been established?
2 hints available, least help first.
Hint 1: Retrieval cue
What information does the solver have about what you meant to write?
Hint 2: Concept cue
Consider a model entered with one coefficient mistyped. What status would the solver report?
Direct application
A solver accepts inequality constraints only in the form
Rewritten for that interface, the row's coefficients become
What is the corresponding entry of
Enter the value. It is checked against the answer and the precision this task asks for.
2 hints available, least help first.
Hint 1: Retrieval cue
What must be done to an inequality to reverse its direction, and to which parts of it?
Hint 2: Concept cue
Test your rewritten row at
Direct application
A maximisation of weekly contribution is entered into a minimising solver by negating the objective coefficients. The solver reports an optimal point and an objective value of
What is the weekly contribution of the reported plan, in pounds?
Enter the value. It is checked against the answer and the precision this task asks for.
2 hints available, least help first.
Hint 1: Retrieval cue
What conversion was applied to the objective before the program was entered?
Hint 2: Concept cue
The point is unchanged by the negation; only the sign of the objective value differs.
Recognition · Error diagnosis
A solver minimises
A profit model is to maximise
A learner enters
Which response identifies the error?
2 hints available, least help first.
Hint 1: Retrieval cue
In which direction does this solver optimise, whatever the model intended?
Hint 2: Concept cue
Maximising
Session complete
Every question in this set has been through once. What you can do now depends on how it went — practising again is worth more than moving on if any of it was uncertain.
Practice data
Your practice record is stored in this browser only. Clearing it removes every answer and every scheduled review, and cannot be undone.