Definition · Binary variableA binary variable is a variable restricted to the set {0, 1}. It carries a decision: 1 for the thing happening and 0 for it not happening. A model with binaries and nothing else is a binary or 0/1 programme; a model with binaries and continuous variables together is a mixed integer programme.
Definition · Encoding of a conditionA linear inequality on binaries encodes a condition when, for every assignment of 0 and 1 to the variables, the inequality holds exactly when the condition holds. One assignment on which the two disagree refutes the encoding, and one is all it takes.
That definition is why the lab evaluates your inequality on every assignment beside the truth table of the condition. Discrete Mathematics builds those tables in “Logical Connectives” and “Truth Tables”, and the check here is the same object with one extra column: what the inequality evaluates to, and whether it holds.
Example · If A then B, and the row that refutes the converseThe condition forbids one combination and permits the other three: y_A = 1, y_B = 0 is out, and (0,0), (0,1), (1,1) are in. The inequality y_A − y_B ≤ 0 agrees on all eight assignments of three binaries. The converse y_B − y_A ≤ 0 disagrees on four of them, and the first the lab reports is y_A y_B y_C = 1 0 1: the condition fails there and the inequality holds, so the converse permits exactly the case the condition was written to forbid.
Five conditions and the inequality each one is
- If A then B. y_A − y_B ≤ 0. Equivalently y_A ≤ y_B: choosing A forces B, and B alone is allowed.
- At least one of A and B. y_A + y_B ≥ 1. Both is allowed, because “or” here is the inclusive one.
- At most k of them. y_A + y_B + y_C ≤ k. With three projects and k = 2 the only excluded assignment is all three.
- Exactly one. y_A + y_B + y_C = 1. An equality, and the ≤ 1 version is a different condition.
- Both A and B. y_A + y_B ≥ 2, or simply the two assignments y_A = 1 and y_B = 1 if one row is not required.
The ≤ 1 against = 1 pair is worth one more sentence, because the two conditions differ on a single assignment and it is the empty one. “At most one” permits choosing nothing; “exactly one” does not. The lab refutes y_A + y_B + y_C ≤ 1 as an encoding of “exactly one” on the row 0 0 0, and on that row alone.
Example · Both is not a productThe condition “both A and B” describes one assignment, and the expression y_A · y_B is not linear, so it has no place in a linear model at all. Nothing is lost: y_A + y_B ≥ 2 holds on 1 1 and fails on the other three combinations, which is exactly the condition. y_A + y_B ≥ 1 is the encoding readers reach for instead, and it is refuted on four rows — the first being 1 0 1, where one project is chosen and the inequality is satisfied.
Checking costs 2ⁿ rows, so it is affordable for a handful of binaries and not for fifty. That is not a limitation of the method: the encodings being checked are local — two or three variables at a time — and a model with fifty binaries is built from rows that each involve a few. Verify the row, then use it.
The habit generalises past the point where a truth table fits. In the two lessons after next, the condition is about continuous quantities and the check is a pair of re-solves rather than eight rows, but the discipline is identical: fix the binary at each value, look at what the model then says, and confirm it is what you meant.