Algebra

Slack Variable

A student points to the supplies left in a tray after a batch of crafts.

Slack Variable definition

A slack variable is a nonnegative variable that measures the unused amount in an upper-bound inequality.

In Spanish
variable de holgura
Topic
Optimization and constraints

Slack Variable in a picture

Slack Variable diagramFor x + y ≤ 10 at (3, 4), the slack variable is 10 − 7 = 3.Start with x + y ≤ 10The total cannot exceed 10Write x + y + s = 10Require s ≥ 0At (3, 4), slack s = 3There are three unused units
For x + y ≤ 10 at (3, 4), the slack variable is 10 − 7 = 3.

How it works

Replace a ≤ b with a + s = b and s ≥ 0. The value s = b − a records how much room is left. Introducing s preserves the allowed original choices because every feasible a gives exactly one nonnegative slack.

Worked examples

Find slack for 2x ≤ 12 at x = 5.

12 − 2(5) = 2.

Find slack when x = 6 for the same bound.

0. The constraint is binding.

Can negative slack be feasible for a ≤ b?

No. It means a exceeds b.

Common mistake

For an upper bound, add a nonnegative slack to the left-hand side. Rewriting the inequality as an equation also requires keeping the sign restriction.

Quick check

Which equality represents x ≤ 8 with a nonnegative slack s?

What does s = 0 say about the constraint?

Show answer

It is binding.

What is the slack at x = 3 under x ≤ 8?

Show answer

5.

Sources

Flashcard

Slack Variable

Reveal the definition

A slack variable is a nonnegative variable that measures the unused amount in an upper-bound inequality.

Effortless Math. “Slack Variable.” Math Dictionary.