Binary Variable definition
A binary decision variable takes only the values 0 and 1.
Binary Variable in a picture
How it works
Use 1 to mark that an option is selected and 0 to mark that it is omitted. A constraint such as x + y ≤ 1 allows at most one of two options. Requiring x + y = 1 forces exactly one.
Worked examples
What does x + y = 1 allow for binary x and y?
It allows (1, 0) or (0, 1).
How do you require at most two out of three options?
Use x + y + z ≤ 2.
How can you require that choosing x also chooses y?
Use x ≤ y. If x is 1, y must be 1.
Common mistake
Specify x ∈ {0, 1}. The bounds 0 ≤ x ≤ 1 alone also permit fractions.
Quick check
Can both options be omitted under x + y ≤ 1?
Show answer
Yes.
What does x + y count?
Show answer
The number of selected options.
Sources
Flashcard
Binary Variable
Reveal the definition
A binary decision variable takes only the values 0 and 1.
Effortless Math. “Binary Variable.” Math Dictionary.



