Plotting Linear Inequalities
A linear inequality is drawn in two moves: draw its boundary line, then decide which of the two sides it allows. The first is arithmetic and rarely goes wrong. The second has a failure mode of its own, the wrong side chosen, which survives a perfectly accurate drawing and quietly produces a region that is not the feasible one.
Definition
To plot
The boundary line is the equation
The allowed side is found by testing any point not on the line. If the test point satisfies the inequality, the allowed side is the one containing it; otherwise it is the other side. The origin is the usual choice because
A strict inequality excludes the boundary and is drawn as a dashed line; the inequalities in a linear program are non-strict, so the boundary belongs to the allowed set.
Assumptions and scope
The origin is a valid test point only when the boundary does not pass through it. When
the line runs through the origin and the test is vacuous; choose any other point not on the line.Dividing an inequality by a negative number reverses its direction. This is where a correct line is most often paired with the wrong side.
A constraint with one variable absent, such as
, still has a boundary line (vertical or horizontal) and two sides. It is not a special case requiring different treatment.Non-strict inequalities include their boundary, so the boundary points are feasible. This matters because optima in linear programming occur precisely on boundaries.
Sign restrictions are constraints like any other. Omitting
and from the drawing produces a region extending outside the first quadrant, which is a different problem.
Forms this is expressed in
The same content in several forms. Each makes something visible that the others leave implicit, so moving between them is part of understanding the topic rather than a presentation choice.
geometric
Two slanted constraints and the two sign restrictions, plotted together. Each boundary is drawn from its intercepts, the allowed side is settled by testing the origin, and the region is what remains after all four cuts.
The corner where the two slanted boundaries meet is not read off the drawing: it is found by solving the two boundary equations simultaneously. The plot shows which pair to solve; the arithmetic supplies the coordinates.
Worked material
Example
Four constraints, one region
Plot the region defined by
First boundary.
Second boundary.
Sign restrictions.
The intersection. The surviving region is a quadrilateral with corners
Verification. Take the interior point
Non-example
Ways the side goes wrong
Not a rule: 'less than shades below'. For
Not a valid test point: the origin on the boundary. For
Not the intersection: shading each constraint separately and taking whatever is covered. A point satisfying one constraint but not another is infeasible. The region is where all of the shadings overlap, not where any of them reaches.
Not optional: the sign restrictions. Omitting
Not a special case: a missing variable.
Contrast
Correct boundary, incorrect half-plane
Two errors are possible when plotting a constraint, and they are not equally visible.
A misplaced boundary is usually visible. Compute an intercept wrongly and the line sits somewhere the constraint cannot justify, cutting an axis beyond the bound it came from, or crossing another boundary far outside the quadrant. The drawing contradicts the arithmetic that produced it.
A wrong side does not. Consider
The consequence propagates silently. That triangle has corners, those corners get evaluated, one of them wins, and a specific optimum with a specific value is reported. Every step after the shading is performed correctly on incorrect input. Nothing downstream can detect it, because nothing downstream ever sees the original inequality again.
The safeguard is cheap and must be habitual. Test a point and write the verdict down, for every constraint, before shading. Then verify the finished region with one interior point checked against all the original inequalities. Two arithmetic checks, and together they close the only failure mode in this procedure that the picture cannot reveal.
Common errors
Common misconception
The side of a boundary line allowed by an inequality can be decided by looking at the inequality sign, so a less-than constraint always shades below or towards the origin.
Related units
Requires
Connected
- The Feasible Region of a Linear Program (used by)
- Solving a Two-Variable Linear Program Graphically (used by)
- Contour Lines and the Direction of Improvement (contrasts with)