Constraints Examples: 43 Problems with Answers

Worked examples of Constraints to try before you open each solution, then practice problems with answers.

Worked Examples

Example 1

medium
You have $50 to spend on notebooks ($3 each) and pens ($2 each). Write the constraint inequality and find a valid combination.
Show solution

Answer

Constraint: 3n+2p≤50; example: 10 notebooks and 10 pens

First step

1.
Let n = notebooks, p = pens.

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Free: full solutions on 3 topics a day. No card.

Every topic, every day: the Family plan

Example 2

hard
A farmer plants corn ($200/acre profit) and soybeans ($150/acre profit) on at most 100 acres, with at least 20 acres of corn. Write the constraints and find the profit-maximizing allocation.

Example 3

medium
You have $80 to buy books at $12 each. Write the constraint on number of books n and find the maximum.

Example 4

medium
A ride requires riders to be at least 40 inches tall AND no more than 80 inches. Write and use the compound constraint.

Example 5

hard
A box must weigh between 5 kg and 20 kg, inclusive. Inside are x books at 0.5 kg each. Find the integer range of x.

Example 6

challenge
A pen needs 30 m of fencing along three sides (the fourth is a wall). Each fenced side must be at least 5 m. Find the maximum area.

Practice Problems

Try each one, then open the solution to compare your method.

Example 1

medium
A box must hold at least 10 items but no more than 25 items. Write this as a compound inequality and list two valid values.

Example 2

hard
A recipe needs at least 2 cups of flour and no more than 5 cups total of flour and sugar combined. If you use 3 cups of flour, what is the range of sugar cups?

Example 3

easy
A problem says 'the number of apples x must be a whole number ≥0.' Can x=−2?

Example 4

easy
List the integer values of x allowed by the constraint 1≤x≤4.

Example 5

easy
A solution to an equation is x=−3, but the problem needs a positive length. Is x=−3 valid?

Example 6

easy
Write the constraint 'the total cost cannot exceed $100' as an inequality (cost =c).

Example 7

easy
Does x=5 satisfy the constraint x>5?

Example 8

easy
A recipe needs a whole number of eggs and you compute x=2.5. What does the integer constraint tell you?

Example 9

easy
Which values does x≤7 allow?

Example 10

easy
A problem says 0<x<10. Is x=0 allowed?

Example 11

medium
Solve 2x+1=7, but the problem requires x to be a positive even integer. Is the solution acceptable?

Example 12

medium
You have $50 and items cost $8 each. Write and use a constraint for the number n you can buy.

Example 13

medium
A seating chart needs the number of tables t to satisfy 5t≥38 (each seats 5). What is the smallest valid whole number t?

Example 14

medium
A number x must satisfy both x>0 and x2=9. Which solution is valid?

Example 15

medium
A rectangle has perimeter 20 and integer side lengths. What constraint does each side s satisfy?

Example 16

medium
Translate: 'at least 3 but fewer than 8' into a single constraint on x.

Example 17

medium
A number x satisfies x>4 and x<10. List the integers possible.

Example 18

medium
To ride a coaster you must be at least 48 inches. Express the constraint and decide if h=47.5 qualifies.

Example 19

medium
Two constraints: x≥2 and x≤2. What values satisfy both?

Example 20

challenge
Find all integers x with x2<30 and x>0.

Example 21

challenge
How many ordered pairs of positive integers (x,y) satisfy x+y≤4?

Example 22

challenge
A farmer has 24 m of fencing for a rectangular pen against a wall (one side needs no fence). The width w satisfies what constraint, and what is the max area?

Example 23

easy
List integers x with −2≤x≤3.

Example 24

easy
A truck holds at most 1,500 kg. Write the constraint.

Example 25

easy
A coach allows no more than 4 misses. Write the constraint on misses m.

Example 26

medium
A baker needs at least 4 cups but at most 9 cups of flour. Write the compound inequality.

Example 27

medium
Determine which values of x∈{−3,0,4,8,12} satisfy ∣x−5∣<4.

Example 28

medium
Solve 3x−1≤11 and state the constraint on x.

Example 29

medium
A test has 50 questions and you must answer at least 35 correctly to pass. Write the constraint on correct answers c.

Example 30

medium
Translate 'no more than 250 but at least 100' to an inequality on x.

Example 31

medium
Solve −2x+5>1 for x and write the constraint.

Example 32

hard
You need to buy snacks: chips at $2 and drinks at $3, with $24 to spend. Write the constraint and find the maximum total items.

Example 33

hard
How many integers satisfy ∣2x−7∣≤5?

Example 34

hard
Solve x+23≥4 for x.

Example 35

hard
A baker uses 1 cup flour per loaf and has 20 cups. Also each loaf takes 30 min and the shift is 5 hr. Max loaves?

Example 36

challenge
How many ordered pairs of positive integers (x,y) satisfy x+y≤6?

Example 37

challenge
Find all integers x with x2≤49 and x>−4.

What to focus on

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

Common stuck point: The procedure for constraints is the easy part; the trap is replacing an inequality constraint with an equation and giving one value. Asking "Does the condition limit or forbid certain values rather than compute one?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

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

Concept recap

Conditions or restrictions that limit which values are allowed in a problem. Constraints narrow the set of possible solutions, such as 'x must be positive' or 'the total cannot exceed 100.'

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.

Read the full lesson on Constraints

Background knowledge

These ideas may be useful before you work through the harder examples.

inequalities