On this concept: Formula

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

Math · Sets & Logic · Grade 9-12

Constraints (Meta)

Constraints are conditions or boundaries that restrict which values or solutions are allowed, cutting an infinite space down to a feasible set.

a+b>c (triangle inequality: a constraint that any valid triangle must satisfy)

Quick Answer

Constraints are conditions or boundaries that restrict which values or solutions are allowed, cutting an infinite space down to a feasible set. Use them when a problem limits what counts as a valid answer: a budget of at most $30, a box that holds 20 items, lengths that must form a triangle, a count that must be a whole number. Write each rule as an equation or inequality, find the candidates that satisfy all of them (the feasible set), and only then pick the best or the requested one.

Why This Matters

Real decisions are made under constraints: a factory has limited machine hours, a recipe a fixed amount of flour, a bridge a maximum load. Constraints turn 'anything goes' into a short list of real options, and in optimization they decide where the best answer sits. Ignoring one produces answers that look fine on paper and are impossible in practice, like 2.5 buses or a triangle with sides 2, 3 and 7.

Intuitive Explanation

You have $30 to spend on cupcakes at $2 each and cookies at $1 each, and the box holds at most 20 items. Without rules there are endless combinations. Each rule cuts some away: 2x+y≤30 removes the ones that cost too much, x+y≤20 removes the ones that don't fit, and 'x and y are whole numbers, at least 0' removes negative or fractional cakes. What survives every cut is the feasible set.

A candidate must pass every constraint, not most of them. 15 cupcakes and 4 cookies fit in the box (19 items) but cost $34, so they are out. 10 cupcakes and 10 cookies cost exactly $30 and fill exactly 20 places, so they are in. On a graph each inequality shades a half-plane, and the feasible set is where all the shaded regions overlap. Hidden constraints count too: a number of people must be a whole number, a length must be positive, and three lengths form a triangle only if each pair adds to more than the third.

A constraint is not the goal. 'Spend at most $30' is a constraint; 'buy as many items as possible' is the objective. Constraints fence in the allowed region, and the objective picks the best point inside it. Constraints also differ from assumptions: an assumption is accepted to start the reasoning, while a constraint is a test that every final answer must pass.

Think of it like this. Constraints work like the rules of a board game: they don't tell you which move to make, but they rule out the illegal ones. Each new rule shrinks the set of legal moves, and a move that breaks even one rule is not allowed, however good it looks. Picking the best legal move is a separate job, done by the objective.

Core idea. Constraints are conditions that shrink an infinite space of possibilities down to the feasible set of values the solution is allowed to take.


When to Use

Look for constraints in words like 'at most', 'at least', 'no more than', 'must', 'cannot exceed', 'whole number', 'positive'. Translate each into an inequality or equation, then test candidates against all of them, adding the unstated ones (counts are whole numbers, lengths are positive). If a phrase says what to maximize or minimize, it is the objective, not a constraint. If it is something accepted as true to start the reasoning, it is an assumption.

Tip. Ask: Is this a rule that disqualifies otherwise-valid answers, leaving only the ones that satisfy it?

How to Recognize It

Before treating a condition as a constraint, sort every sentence of the problem into what limits the answer, what you are trying to make best, and what you are simply told to accept as true.

  1. Could you write this condition as an equation or inequality that a candidate answer either passes or fails?

    If yes, as with x+y≤30 or n≥0, it is a constraint and joins your list of tests. If no, because it states a belief such as 'prices stay fixed', it is an assumption that sets up the model.

  2. Does the sentence describe a quantity to make as large or as small as possible, such as profit or area?

    If yes, that quantity is the objective function, not a constraint: it ranks the allowed answers instead of removing any. If no, and the sentence rules some answers out, keep it as a constraint.

  3. Is there an unstated limit hiding in what the quantities are, such as a number of people or a length?

    If yes, add it: counts are whole numbers and lengths are positive, so 2.5 buses or a side of −3 cm fails even when every written rule holds. Forgetting these implicit constraints is how impossible answers survive.

  4. Does the limit come from a formula itself, like a square root or a denominator, rather than from the situation?

    If yes, it is a domain restriction: x−2 needs x≥2 whatever the story says. If the limit comes from the story, such as a budget or a box size, it is a problem-wide constraint.

Constraints (Meta) compared with Assumptions, Objective function, and Domain restriction

All four rows shape what counts as an answer, which is why they blur. Ask what each does to a candidate answer: rejects it (constraint), ranks it (objective function), was granted before any candidate existed (assumption), or keeps a formula defined (domain restriction).

Constraints (Meta)

Meaning
Use this when the problem restricts which values are allowed and you must keep only solutions that satisfy every rule.
Key test
Is this a rule that disqualifies otherwise-valid answers, leaving only the ones that satisfy it?
Formula
a+b>c (triangle inequality: a constraint that any valid triangle must satisfy)
Example
Cupcakes cost $2 and cookies $1; you may buy at most 20 items and spend no more than $30. Can you buy 15 cupcakes and 4 cookies?

Assumptions

Meaning
Granted starting beliefs that feed the reasoning, not rules the answer must satisfy.
Key test
Use when a statement launches the argument rather than filtering its output.
Example
Suppose the gas is ideal

Objective function

Meaning
What you maximize or minimize, not the boundary on what is allowed.
Key test
Use when the question asks for the best value, not which values are permitted.
Formula
maximize P=3x+2y
Example
Maximize profit

Domain restriction

Meaning
Limits inputs to where a single function is defined, a narrower idea than a problem-wide rule.
Key test
Use when the limit comes from the function itself (no division by zero, no negative roots).
Formula
x≠0 in 1/x
Example
x≥0 inside x

Formula & Notation

a+b>c (triangle inequality: a constraint that any valid triangle must satisfy)
A constrained problem seeks x∈S satisfying gi(x)≤0 for i=1,…,m and hj(x)=0 for j=1,…,p; the feasible set is F={x∈S:gi(x)≤0, hj(x)=0}.

How to read it: ≤, ≥, <, > express constraints; the feasible set is all values satisfying every constraint

Worked Examples

Example 1 — Bake-sale planning

Easy

Cupcakes cost $2 and cookies $1; you may buy at most 20 items and spend no more than $30. Can you buy 15 cupcakes and 4 cookies?
Show the steps and the answer
  1. Translate the rules: with x cupcakes and y cookies, x+y≤20 and 2x+y≤30.

    Each limit in the problem becomes one inequality.

  2. Test the item limit: 15+4=19≤20, satisfied.

    Passing one constraint is not enough; the plan must pass both.

  3. Test the budget: 2(15)+4=34, and 34≤30 is false.

    The plan costs $34, which is $4 over the limit.

  4. Find a feasible fix: 13 cupcakes and 4 cookies cost 26+4=30 dollars and make 17 items.

    That satisfies both inequalities, so it lies in the feasible set.

Answer: No — it violates the budget constraint

Takeaway: Test a candidate against every constraint; failing a single one, here the $30 budget, makes it infeasible.

Example 2 — The goal, not a constraint

Standard

Same shop, but now: 'spend at most $30 and maximize the number of items.' Is 'maximize items' a constraint?
Show the steps and the answer
  1. Sort the phrases: 'spend at most $30' limits what is allowed, while 'maximize the number of items' says what to make large.

    A constraint rules plans in or out; an objective ranks the plans that remain.

  2. Write them separately: constraint 2x+y≤30; objective: make x+y as large as possible.

    Keeping them apart shows which is a boundary and which is a target.

  3. Compare two allowed plans: 10 cupcakes and 10 cookies ($30, 20 items) and 15 cupcakes ($30, 15 items).

    Both pass the constraint, so neither is ruled out; the objective is what prefers the first.

Answer: 'Maximize items' is the objective, not a constraint

Takeaway: Constraints fence in the allowed plans; the objective, such as 'maximize items', picks the best plan inside the fence.

Example 3 — Find the mistake: forgetting a hidden constraint

Application

A class of 58 students goes on a trip in buses that seat 24 each. Ana writes: "58÷24≈2.42, so we need 2.42 buses, which rounds to 2." Find the mistake and correct it.
Show the steps and the answer
  1. Write the stated constraint: the buses must seat everyone, 24b≥58.

    Every student needs a seat, so the total number of seats must be at least 58.

  2. Add the hidden constraint: b must be a whole number.

    Nobody can hire 0.42 of a bus, so fractional answers are not allowed.

  3. Test Ana's 2: 24×2=48<58, leaving 10 students without a seat.

    Rounding to the nearest whole number broke the seating constraint.

  4. Find the smallest whole number that works: b=3 gives 72≥58.

    With both constraints in force, the answer must be rounded up, not to the nearest whole number.

Answer: 3 buses (72 seats for 58 students).

Takeaway: Write down the unstated constraints, such as whole numbers, and check the final answer against every one of them.

Where You'll See It

  • Airline carry-on rules

    An airline allows a carry-on of at most 55 × 40 × 20 cm and at most 10 kg. A bag measuring 54 × 39 × 22 cm and weighing 7 kg passes three of the four checks but fails on depth, so it has to go in the hold. Every constraint must hold at once.

  • Planning hospital meals

    Dietitians plan menus under constraints such as at least 50 g of protein and at most 2,000 mg of sodium per day, then choose the cheapest menu that meets them all. This is linear programming: inequalities fence in the allowed menus, and cost is the objective.

Common Mistakes

  1. The slip: Solving freely and ignoring a stated limit

    Instead: check every candidate answer against all constraints, not just one.

  2. The slip: Treating a constraint as the thing to optimize

    Instead: constraints fence the region; the objective picks the best point in it.

  3. The slip: Forgetting implicit constraints like 'a count must be a non-negative whole number'

    Instead: real quantities carry boundaries even when unstated.


Mini Practice

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

  1. Can a triangle have sides of 3 cm, 4 cm and 8 cm? Use the triangle inequality to decide.

    Hint: Compare the sum of the two shorter sides with the longest side.

  2. Student tickets cost $6 and adult tickets $10. A club can spend at most $100 and must buy at least 4 adult tickets. What is the greatest number of student tickets it can buy?

    Hint: Buy only the adult tickets you are forced to, then see how much money is left.

  3. A rectangular pen uses exactly 24 m of fencing. Each side must be a whole number of metres and at least 3 m long. List every possible pair of side lengths.

    Hint: Half the perimeter gives length plus width. Which whole-number pairs fit both rules?

  4. Find every whole number x that satisfies both 2x+3≤15 and x>2.

    Hint: Solve each inequality on its own, then keep only the values that pass both.

  5. A farmer has at most 40 m of fence and wants a rectangular pen with the largest possible area. Is "largest area" a constraint or the objective, and what is the constraint?

    Hint: One condition fences in the allowed designs; the other picks the best design among them.

  6. A problem asks how many people n are in a group if n2−3n=40. Ari writes "n=8 or n=−5." Correct the answer.

    Hint: What kind of number can a count of people be?

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

What happens if no answer satisfies all the constraints?

Then the feasible set is empty and the problem has no solution as stated. For example, x+y≤10x + y \le 10, x≥6x \ge 6 and y≥6y \ge 6 cannot all hold, because the smallest possible sum is 12. In a real project this tells you a rule must be relaxed: a bigger budget, a smaller order or a later deadline. Reporting 'no solution' is a correct answer, not a failure.

Can a constraint be an equation instead of an inequality?

Yes. An equality constraint such as 2l+2w=402l + 2w = 40 pins the answer to a line or curve instead of a region, and it often lets you remove a variable: w=20−lw = 20 - l. Inequality constraints such as l≥0l \ge 0 fence off a region. Many problems mix both kinds, a fixed perimeter with positive sides. Each independent equality constraint usually removes one degree of freedom, the idea of the next lesson.

Why do linear programming answers land on a corner of the allowed region?

In linear programming the constraints and the objective are all straight-line expressions, so the allowed region is a polygon. A linear objective such as profit 3x+2y3x + 2y grows steadily in one direction, so you keep improving by sliding that way until you hit the boundary, and on a bounded polygon the best boundary point is a corner (or a whole edge ties). That is why you only need to test the vertices.

Can adding a constraint ever make the best answer better?

No. A new constraint can only remove candidates, so the best value stays the same or gets worse. If the old best answer still passes the new rule, nothing changes; if it fails, you settle for the best of what remains. Removing a constraint works the other way and can only help or leave things as they were. This gives a quick sense check on any optimization answer.

Learning Path

← Before

Assumptions
Constraints (Meta)

You are here

You need Assumptions, so you can tell what is granted from what is required. Constraints add the rules every answer must satisfy and the idea of a feasible set where all of them hold. Next, Degrees of Freedom counts how many quantities can still vary once the constraints are imposed, which tells you whether a problem has one answer, many, or none.

See Also