Constraint System Math Example 2

Follow the full solution, then compare it with the other examples linked below.

Example 2

hard
A shop sells notebooks for \3 and pens for \1. You have \$12 and want at least 2 notebooks. How many pens can you buy?

Solution

  1. 1
    Let nn = notebooks, pp = pens. Constraints: 3n+p123n + p \leq 12, n2n \geq 2, p0p \geq 0.
  2. 2
    With n=2n = 2: 6+p126 + p \leq 12, so p6p \leq 6.
  3. 3
    With n=3n = 3: 9+p129 + p \leq 12, so p3p \leq 3.
  4. 4
    With n=4n = 4: 12+p1212 + p \leq 12, so p=0p = 0.
  5. 5
    Maximum pens: 6 (buying exactly 2 notebooks).

Answer

Up to 6 pens (with 2 notebooks).
Real-world problems often involve multiple constraints that must be satisfied simultaneously. Listing cases for the integer variable helps find all feasible solutions.

About Constraint System

A collection of equations and inequalities that must ALL be satisfied simultaneously by the same set of variable values.

Learn more about Constraint System →

More Constraint System Examples