Practice: Modelling with Binary Variables
Question
Recognition · Interpretation
With binaries
2 hints available, least help first.
Hint 1: Retrieval cue
Which single combination should the constraint forbid?
Hint 2: Concept cue
Test each option against
Comparison · Method selection
"We may run the second line only if the first is commissioned, and we need not run it even then." Which constraint set is correct?
2 hints available, least help first.
Hint 1: Retrieval cue
The second clause is telling you which constraint NOT to add.
Hint 2: Concept cue
Is the intended relation one-way or two-way?
Construction · Direct application · Explanation
A utility may build wind, solar or gas capacity. Building wind costs £3m fixed and yields up to 40 MW; solar costs £2m fixed and yields up to 25 MW; gas costs £5m fixed and yields up to 90 MW. It must build at least two of the three. Gas may only be built if wind is also built. Total capacity must reach at least 60 MW. Any built source must supply at least 10 MW.
Define the variables and write every constraint, saying for each what it forbids.
Write your answer, then compare it with the worked solution.
2 hints available, least help first.
Hint 1: Retrieval cue
Take the conditions one sentence at a time and name the pattern before writing algebra.
Hint 2: Strategy cue
Each source needs two linking constraints: one capping output, one imposing the minimum.
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.
Variables.
At least two of the three.
Forbids: building none or exactly one.
Gas only if wind.
Forbids:
Capacity links, upper.
Forbids: supplying from an unbuilt source, and exceeding a built source's rating. Each
Minimum output when built.
Forbids: building a source and running it below 10 MW. When the binary is
Total capacity.
Forbids: any plan supplying under 60 MW.
Objective, if minimising cost.
The fixed charges sit with their binaries, and the capacity links make them payable, without
A check.
A complete answer does each of these:
- defines variables
- writes logical constraints
- links decision to quantity
- verifies constraint binds
Error diagnosis · Explanation · Evaluation
A modeller writes, for a depot with capacity 500 tonnes and a £2,000 opening cost:
Variables:
for opening the depot, tonnes shipped.
Objective: minimise.
Constraints:(capacity), (nothing negative), (binary).
"Every constraint is a true statement about the depot, so the model is correct."
Identify what the model permits that it should not, and say what is wrong with the justification.
Write your answer, then compare it with the worked solution.
2 hints available, least help first.
Hint 1: Retrieval cue
Try setting
Hint 2: Concept cue
For each constraint, what assignment does it actually forbid?
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.
What the model permits.
The missing constraint. Nothing connects
With
Reviewing the constraints that are present.
: true, and forbids . Genuine work, though subsumed once the link is added. : forbids nothing. The variable was already declared nonnegative. : forbids nothing. The variable was already declared binary.
Two of the three constraints are true statements that restrict nothing the model could otherwise have done.
What is wrong with the justification. "Every constraint is true" cannot detect this fault, because the fault is not a false statement. It is a missing one. A review that reads each constraint and confirms it is true will pass this model every time.
The review that works. Two passes. First, for each constraint, name an assignment it forbids that the rest of the model would permit; a constraint with no such assignment is doing nothing. Second, for each condition in the description, name the constraint that enforces it. "Nothing ships from a closed depot" has no answer in this model, and that second pass is what exposes it.
Why fixed charges are where this bites hardest. A cost in the objective with no linking constraint is always declined by an optimiser. The binary becomes pure cost with no consequence, so the charge is never incurred and the activity runs free.
A complete answer does each of these:
- defines variables
- writes logical constraints
- links decision to quantity
- verifies constraint binds
Transfer · Construction · Evaluation
A research council must choose among six proposals. Each has a cost
Formulate the selection as a binary program. Then say what changes structurally if the council may instead fund any fraction of each proposal, and why that version is far easier to solve.
Write your answer, then compare it with the worked solution.
2 hints available, least help first.
Hint 1: Retrieval cue
Each condition matches one of the patterns: a count, an implication, a resource limit.
Hint 2: Strategy cue
For the second part, ask what the feasible set becomes when the variables are allowed to be fractional.
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.
Variables.
Objective.
Budget.
Forbids: any selection costing more than the budget.
Duplication.
Forbids: funding both, while permitting either alone or neither.
Precursor.
Forbids: funding proposal 6 without proposal 2. It leaves 2 fundable alone, which is correct. A precursor need not lead anywhere.
What this is. A knapsack problem with two side conditions: maximise value subject to a single capacity constraint, with items indivisible.
The fractional version. Replace
Why the fractional version is far easier. Its feasible set is a polyhedron, so the optimum sits at a vertex and the geometry does the work. Restoring integrality removes that: the feasible set becomes the
The consequence. The greedy value-per-pound rule is optimal for the fractional problem and can be arbitrarily bad for the integer one. A proposal with the best ratio may consume so much budget that two lesser proposals would have scored higher together, and no amount of care in applying the ratio rule finds that, because it requires declining the item the rule ranks first.
Why this is the transfer. The patterns here are the ones already met, a selection count, an implication, a budget, arriving in a named problem family under different vocabulary, with the integrality question carrying real consequence.
A complete answer does each of these:
- defines variables
- writes logical constraints
- links decision to quantity
- verifies constraint binds
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.