Practice: Formulating a Linear Program
Question
Recognition · Classification
A bakery decides how many loaves and how many cakes to bake. Flour is limited to 50 kg, each loaf uses 0.5 kg and each cake 0.2 kg. A loaf sells for £3 and a cake for £5. Which quantity should be a decision variable?
1 hint available, least help first.
Hint 1: Retrieval cue
Which of these can the bakery set directly, without first setting something else?
Construction · Direct application
A feed supplier blends two ingredients, barley and soy, into a batch of animal feed. Each kilogram of barley costs £0.40 and supplies 8 g of protein and 2 g of fat. Each kilogram of soy costs £0.90 and supplies 35 g of protein and 6 g of fat. A batch must weigh exactly 100 kg, must supply at least 1500 g of protein, and must supply no more than 400 g of fat. The supplier has used the same two ingredients for years. Formulate the problem of producing a batch at least cost as a linear program.
Define your variables with units, write the objective, write one constraint per restriction, and state the sign restrictions.
Write your answer, then compare it with the worked solution.
3 hints available, least help first.
Hint 1: Retrieval cue
What is the supplier actually choosing, and in what units?
Hint 2: Concept cue
Three sentences state restrictions: the batch weight, the protein minimum, and the fat maximum. One sentence states none.
Hint 3: Next step
"Exactly 100 kg" is an equality constraint; "at least" points one way and "no more than" the other.
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.
Let
A complete answer does each of these:
- constraints complete and linear
- objective matches goal
- sign restrictions stated
- units consistent
- variables defined with units
Error diagnosis · Explanation
A workshop makes chairs and desks. Each chair needs 3 hours of carpentry, each desk 5 hours, and 120 carpentry hours are available. A chair yields £40 profit and a desk £60.
A student formulates:
"Let
maximise
subject to
Identify which of the student's variables are not decisions. Explain what the constraint
Write your answer, then compare it with the worked solution.
2 hints available, least help first.
Hint 1: Retrieval cue
Which of the four symbols can the workshop set directly?
Hint 2: Concept cue
Ask what the description says about profit being nonnegative. Does any sentence require it?
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 complete answer does each of these:
- variables defined with units
- constraints complete and linear
- objective matches goal
Method selection · Evaluation · Transfer
Four planning situations are described below. For each one, decide whether a linear program is an appropriate model as stated. If it is not, name the specific feature that rules it out and say what class of model the situation calls for instead. Do not formulate the programs.
(a) A refinery blends three crude streams into petrol, choosing how many barrels of each to use, subject to octane and sulphur limits expressed as averages weighted by volume.
(b) A haulier assigns whole lorries to six routes; a route either gets a lorry or it does not, and a lorry cannot be split.
(c) A shop sets the price of a single product and the quantity it stocks, seeking to maximize revenue, which is price multiplied by quantity sold.
(d) A supplier buys a raw material at £2 per kilogram for the first 500 kg and £1.60 per kilogram beyond that, choosing how much to buy and how to allocate it across two processes.
Write your answer, then compare it with the worked solution.
2 hints available, least help first.
Hint 1: Retrieval cue
A linear program needs linear expressions and divisible decisions. Which of these four descriptions breaks one of those?
Hint 2: Strategy cue
Try writing just the objective for each situation. The one whose objective multiplies two decisions together is disqualified immediately.
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) A linear program is appropriate. A volume-weighted average constraint such as the octane limit clears its denominator into a linear inequality, so the apparent ratio is not a genuine nonlinearity. (b) Not a linear program as stated. The decisions are indivisible and the all-or-nothing assignment requires binary variables; this calls for an integer or binary program. (c) Not a linear program. The objective is price multiplied by quantity, a product of two decision variables, which is nonlinear; it calls for a nonlinear programming method. (d) Not a linear program as stated. The price break creates a piecewise cost that is not a single linear expression; it can be modelled with additional variables and binary indicators, giving a mixed-integer program, or approximated linearly if the break is known always to be crossed.
A complete answer does each of these:
- classifies each situation
- names the disqualifying feature
- identifies alternative model class
- recognises apparent nonlinearity
Method selection · Classification · Evaluation
Three situations are described below. For each, say whether a linear program models it as stated. Where it does not, name the specific feature that rules it out and the class of model the situation calls for instead. Do not write any formulations.
(a) A dairy splits its milk supply between cheese and butter production. Each tonne of cheese needs 9 tonnes of milk and 3 hours of vat time; each tonne of butter needs 22 tonnes of milk and 1 hour. Milk and vat time are both limited, and the dairy maximizes contribution per tonne.
(b) A council must decide which four of eleven proposed bus shelters to build, within a fixed capital budget, maximizing the total number of passengers served.
(c) A mill blends two grades of flour so that the protein content of the mixture is at least 12 per cent, where the protein content is the mass-weighted average of the two grades' protein percentages.
Write your answer, then compare it with the worked solution.
3 hints available, least help first.
Hint 1: Retrieval cue
A linear program needs divisible decisions, linear expressions, and data that does not depend on the choices.
Hint 2: Concept cue
For each situation, test those three requirements in turn. Which one, if any, actually fails?
Hint 3: Strategy cue
Where a constraint contains a fraction, try multiplying through by the denominator before deciding it is nonlinear.
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) A linear program is appropriate. The decisions are continuous tonnages, every restriction is a sum of constant-times-variable terms, and the objective is linear. (b) Not a linear program as stated. A shelter is built or it is not, so the decisions are indivisible, and the requirement to choose exactly four is a count of binary choices. This calls for a binary or integer program; a fractional solution such as building 0.6 of a shelter has no meaning, and rounding it may break the budget or the count. (c) A linear program is appropriate. The mass-weighted average looks like a ratio of decision variables, but the constraint
A complete answer does each of these:
- classifies each situation
- identifies alternative model class
- names the disqualifying feature
- recognises apparent nonlinearity
Error diagnosis · Comparison
A student is asked whether a linear program can model this situation:
A cooperative blends two feed grades so that the mixture's protein content, the mass-weighted average of the two grades' protein percentages, is at least 14 per cent. It chooses how many tonnes of each grade to buy, minimizing cost.
The student answers:
"No. The protein constraint is an average, so it divides one decision variable by another. Division makes it nonlinear, so this needs nonlinear programming."
The student's answer is wrong. Identify the error in the reasoning, show what the constraint becomes when handled correctly, and state the general test they should have applied instead.
Write your answer, then compare it with the worked solution.
2 hints available, least help first.
Hint 1: Retrieval cue
Is the denominator ever zero or negative here?
Hint 2: Concept cue
An inequality may be multiplied through by a strictly positive quantity without changing its solution set.
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.
The error is treating the appearance of a ratio as proof of nonlinearity. The constraint is
and the denominator
That is linear in
A complete answer does each of these:
- names the disqualifying feature
- recognises apparent nonlinearity
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.