On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Arithmetic Operations · Grade 9-12

Constraints

A constraint is a restriction, usually an inequality or a not-equal condition, that limits the values a variable may take.

x+y≤100,t≥0,x≠0

Quick Answer

A constraint is a restriction, usually an inequality or a not-equal condition, that limits the values a variable may take. Use constraints when a problem sets limits instead of exact targets: a budget you cannot exceed, a minimum order, a time that cannot be negative, a count that must be a whole number. Each one cuts away impossible values, and the answer is whatever survives all of them, often a range or a largest or smallest allowed value rather than one solution.

Why This Matters

Constraints make an algebra answer usable. 4n≤50 gives n≤12.5, but nobody buys half a notebook, so the answer is 12. A bridge's load limit, a medicine's maximum dose and a factory's machine hours are all constraints, and optimization chooses the best plan inside them. Forgetting a hidden one, like n≥0, produces answers that solve the algebra and fail the situation.

Intuitive Explanation

Picture an airline's carry-on rule: at most 7 kg and no longer than 55 cm. The rule doesn't tell you what to pack. It rules out some choices and leaves many allowed. Constraints in mathematics work the same way: w≤7 and L≤55 describe a set of acceptable values, not a single answer.

Some constraints are stated and others come from the situation. With $50 and notebooks at $4, the stated constraint is 4n≤50, so n≤12.5. The hidden ones are that n is a whole number and n≥0. Together they allow n=0,1,2,…,12, so the most you can buy is 12. Each new constraint shrinks the allowed set, and sometimes nothing is left: no number satisfies both x>5 and x<3.

With two variables, a constraint such as x+y≤100 shades a region of the plane: every point on or below the line x+y=100. Several constraints overlap to form a feasible region, and optimization looks for the best point in it, usually on its edge.

An equation does a different job. Spending exactly $48 on $4 notebooks gives 4n=48, which pins down one value, n=12. A constraint says "at most" or "at least"; an equation says "exactly". Replacing ≤ with = throws away every other allowed answer.

Think of it like this. Constraints work like fences around a field: they never say where the sheep must stand, only where it may not go. Each new fence shrinks the field, and badly placed fences can leave no field at all. Unlike a fence, a constraint such as x≠0 can remove a single point.

Core idea. A constraint is a condition that fences off which values a variable is permitted to take.


When to Use

Write constraints when a problem says at most, at least or cannot exceed, or when a quantity like time, length or a count of objects cannot be negative or fractional. Turn each limit into an inequality, solve it, and keep every allowed value instead of one. If the wording says exactly or gives a total that must be hit, write an equation. If a quantity is to be made as large or small as possible, it is the objective, and the constraints are its limits.

Tip. Ask: Does the condition limit or forbid certain values rather than compute one?

How to Recognize It

Before you solve, list every limit the situation puts on each variable, including the ones nobody wrote down, such as counts that must be whole numbers.

  1. Does the variable count whole objects, like tickets, buses or people?

    Then add the hidden constraint that it is a whole number and at least 0. Solving 25x≤160 gives x≤6.4, but the answer is at most 6 tickets. Lengths and times can be fractions, so they need only ≥0.

  2. Is one quantity something to make as large or as small as possible, like profit or cost?

    That quantity is the objective, not a constraint; the constraints are the limits it must work within. A problem with both is an optimization problem, and its best value usually sits on the edge of the allowed region.

  3. When you put all the limits together, is any value left over?

    If x≥10 and x≤7 are both required, nothing satisfies them, and the honest answer is that the plan is impossible. Check that the allowed region, often called the feasible region, is not empty before searching it for a best value.

  4. Does a restriction come from the math itself, like a square root or a denominator, rather than from the story?

    Then it belongs to the domain of the expression: x−3 needs x≥3, and 1x needs x≠0. Story constraints, such as a budget, are added on top of the domain, never instead of it.

Constraints compared with Equation, Objective function (optimization), and Domain of a function

Constraints, equations, objectives and domains can all appear in one word problem, written in the same variables. Ask what each statement does: fences off allowed values (constraint or domain), pins down an exact value (equation), or names what to make best (objective).

Constraints

Meaning
Use this when a problem restricts which values a variable may take, such as a maximum, minimum, or forbidden value.
Key test
Does the condition limit or forbid certain values rather than compute one?
Formula
x+y≤100,t≥0,x≠0
Example
You have $50 and notebooks cost $4 each. Write the constraint and find the most you can buy.

Equation

Meaning
States two expressions are equal to pin down exact values.
Key test
Use when the relationship is exact, not a range.
Formula
ax+b=c
Example
2x+3=11 gives x=4

Objective function (optimization)

Meaning
The quantity you maximize or minimize, not the limit on it.
Key test
Use when you're choosing the best value within the constraints.
Formula
maximize P
Example
Maximize profit subject to the constraints

Domain of a function

Meaning
The naturally allowed inputs from the function's own definition.
Key test
Use when restrictions come from the math itself, not the scenario.
Formula
x≠0 for 1x
Example
Denominator can't be zero

Formula & Notation

x+y≤100,t≥0,x≠0
Feasible set S={x∈D:gi(x)≤0,  hj(x)=0  ∀i,j}

How to read it: Constraints are expressed as inequalities (≤, ≥, <, >) or restrictions (≠)

Worked Examples

Example 1 — Budget limit

Easy

You have $50 and notebooks cost $4 each. Write the constraint and find the most you can buy.
Show the steps and the answer
  1. Write the budget as a constraint: 4n≤50.

    The amount spent may be less than $50 but not more, so the sign is ≤, not =.

  2. Divide both sides by 4: n≤12.5.

    Dividing by a positive number keeps the direction of the inequality.

  3. Add the hidden constraints: n is a whole number and n≥0.

    Notebooks come whole, and you can't buy a negative number of them.

  4. Take the largest whole number allowed: n=12, costing 4×12=48 dollars.

    13 notebooks would cost $52, over the limit; 12 leaves $2 unspent.

Answer: At most 12 notebooks

Takeaway: Write the limit as an inequality, add the limits the situation implies, then pick the largest value that satisfies all of them.

Example 2 — Exact-cost question

Standard

Notebooks cost $4 each and you spent exactly $48. How many did you buy?
Show the steps and the answer
  1. Notice the word "exactly": the spending is fixed at $48, not capped.

    A required total gives an equation, so there is no range of answers.

  2. Write 4n=48.

    Price per notebook times the number bought must equal the amount spent.

  3. Divide by 4: n=12.

    Only one number makes this equation true.

  4. Compare with the budget version, 4n≤50, which allowed any whole number from 0 to 12.

    Changing "at most" to "exactly" turns 13 possible answers into one.

Answer: n=12 exactly

Takeaway: "Exactly" calls for an equation with one answer; "at most" calls for a constraint with a range of answers.

Example 3 — Find the mistake: the sign and the hidden limit

Application

A tank holds 200 litres and drains at 15 litres per minute. For which times t (in minutes) does it still hold at least 50 litres? Raj writes: "200−15t≥50, so −15t≥−150, so t≥10." Find the mistake and correct it.
Show the steps and the answer
  1. Test Raj's answer with t=12: 200−15(12)=20 litres, less than 50.

    A time his answer allows breaks the condition, so a step went wrong.

  2. Find the slip: dividing −15t≥−150 by −15 must reverse the sign, giving t≤10.

    Dividing by a negative reverses order: −30>−45, but after dividing by −15, 2<3.

  3. Add the hidden constraint t≥0.

    Time is counted from when draining starts, so negative times are not part of the story.

  4. Check the edge: at t=10, 200−150=50 litres, exactly the minimum.

    The boundary is included because the condition says "at least" 50.

Answer: 0≤t≤10 minutes

Takeaway: Reverse the inequality when you divide by a negative, and add the limits the story implies, such as t≥0.

Where You'll See It

  • Elevator weight limits

    An elevator rated for 1,000 kg, carrying people who average 80 kg, must satisfy 80p≤1000. That gives p≤12.5, and because people come whole, at most 12 can ride. The capacity sign shows a whole number for this reason.

  • Sharing oven time at a bake sale

    Cookies need 10 minutes of oven time per tray and brownies 30 minutes per pan, with 180 minutes available: 10c+30b≤180. Six pans of brownies use all 180 minutes; 3 pans leave room for 9 trays of cookies. Every workable plan lies inside this constraint.

  • A monthly phone data cap

    A plan includes 5 GB a month. Having used 3.2 GB by day 20, you need 3.2+d≤5, so d≤1.8 GB for the last 10 days, about 0.18 GB a day.

Common Mistakes

  1. The slip: Replacing an inequality constraint with an equation and giving one value

    Instead: the constraint allows a range, so keep the ≤ or ≥.

  2. The slip: Ignoring hidden real-world constraints

    Instead: quantities like time or count must be ≥0 even if unstated.

  3. The slip: Flipping the inequality when multiplying or dividing by a negative incorrectly

    Instead: reverse the sign only for negatives, and remember it applies to the whole constraint.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Movie tickets cost $12 each and you have $75. Write a constraint for the number of tickets t and find the greatest possible t.

    Hint: The total cost cannot go over the money you have.

  2. A rectangle's perimeter can be at most 40 m, and its length is 12 m. What widths w are allowed?

    Hint: Write the perimeter in terms of w, then remember a width must be positive.

  3. A van holds at most 9 people. Adults a and children c ride together. Write the constraint and check whether a=4, c=6 is allowed.

    Hint: Add the riders and compare with the limit.

  4. Solve the constraint −3x+5≥−7.

    Hint: Dividing by a negative number changes the direction of the sign.

  5. A bakery must bake at least 50 loaves a day and wants as much profit as possible. Which part is a constraint, and which is the objective?

    Hint: Which part limits what is allowed, and which is a goal to maximize?

  6. Pens cost $3 and you can spend no more than $20. Kai writes 3p=20 and says p=6.67. Correct his work.

    Hint: Is the budget an exact total or a limit? Can you buy part of a pen?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Why does the best answer in a linear programming problem sit at a corner?

When the constraints are straight-line inequalities, the allowed region is a polygon, and a linear objective such as profit =3x+5y= 3x + 5y increases steadily in one direction across it. Slide a line of equal profit in that direction: the last point it touches before leaving the region is a corner, or a whole edge if the line runs parallel to it. So testing the corners is enough.

Does a constraint have to be an inequality?

No. A constraint can be any rule that some values pass and others fail. Each team has an even number of players; all the digits are different; the three lengths can form a triangle: these are all constraints. Sudoku is made entirely of constraints: each row, column and box must use each digit once, and the solution is the one grid that satisfies all of them.

What happens if a problem has too few constraints?

Then many answers are allowed, and you may be asked for the whole range instead of one value. If the problem asks for the most of something, too few constraints can mean there is no maximum at all: with only x≥0x \ge 0, a profit of 4x4x grows without limit. In real planning that usually means a limit was forgotten, such as storage space or working hours.

Learning Path

← Before

Inequalities
Constraints

You are here

You need Inequalities (reading and solving <, ≤, >, ≥) first. Constraints add the habit of turning a story's limits, stated and hidden, into inequalities and combining them into one allowed set. Next, Optimization finds the best value inside those limits, and Systems of Equations handle several conditions on several variables at once.

See Also