Slack variables turn inequalities into equalities

Intermediate Simplex algorithm, StatQuest
Created by Best · 15.07.2026 at 20:54 UTC

The next step converts each less-than-or-equal constraint into an exact equality by adding a slack variable that soaks up whatever amount of the resource goes unused. For flour the equation becomes $0.4c + 0.5d + s_F = 10$, where $s_F$ is the flour slack.

Here is the intuition with numbers. Suppose you make 10 kg of cookie mix and 8 kg of donut mix and that together they use only part of the flour available. Since usage is below the 10 kg cap, the flour slack absorbs the leftover amount. Each constraint gets its own slack variable, and in any one equation the other slacks are multiplied by zero, so they drop out. Sugar has its slack $s_S$, chocolate has $s_C$, and so on.

Slack variables are even added to the objective function, though with coefficient zero, so they contribute nothing to revenue. That is purely a formality: it makes every equation, objective included, carry the same list of variables in the same format. Uniform equations are exactly what you need before packing everything into a matrix.

University approvals: 0
Related cards
Builds on Standard form: making every constraint a less-than-or-equal · Simplex algorithm, StatQuest
Next Building the simplex tableau · Simplex algorithm, StatQuest
Video Content
Tasks
Question 1

What does a slack variable do?

Question 2

If a recipe uses 8 kg of flour out of 10 kg available, what is the flour slack?

Question 3

How many slack variables are needed for three constraints?

Question 4

Why add slack variables to the objective function with coefficient zero?

Card Info
  • Topic: Simplex algorithm, StatQuest
  • Difficulty: Intermediate
  • Completed: 0 users
Creator
Best
Best
BestBuddy