Skip to content

Constraints: inequalities in two variables

Constraints: inequalities in two variables

A workshop: two products

A carpentry workshop makes tables and chairs.
A table takes 3 hours of work, and a chair – one hour.
The workshop’s carpenters have 60 hours of work a week.

How many tables and how many chairs should it make a week? To answer, each quantity to be decided gets a name:

  • x\displaystyle x – the number of tables a week;
  • y\displaystyle y – the number of chairs a week.

x\displaystyle x and y\displaystyle y are the problem’s variables. Each pair (x,y)\displaystyle (x,y) is a production plan: (10,20)\displaystyle (10,20) – 10 tables and 20 chairs. The branch of mathematics that looks for the best plan within limits like these is called linear programming.

A constraint: a limit as an inequality

In the plan (x,y)\displaystyle (x,y) the work takes 3x+y\displaystyle 3x+y hours: 3 hours for each table and an hour for each chair.
The carpenters cannot work more than 60 hours, so

3x+y≤603x+y\le60

A condition like this is called a constraint: a limit every plan must keep, written as an inequality in the two variables.

  • “At most”, “no more than” – the sign ≤\displaystyle \le.
  • “At least”, “no fewer than” – the sign ≥\displaystyle \ge.
  • The number of products is not negative: x≥0\displaystyle x\ge0 and y≥0\displaystyle y\ge0. These are constraints too, in every problem of this kind.
A plan that keeps the constraint

To check a plan, substitute it in the constraint:

PlanHours of work≤60\displaystyle \le60?
(10,20)\displaystyle (10,20)3⋅10+20=50\displaystyle {3\cdot10+20}={50}yes
(20,0)\displaystyle (20,0)3⋅20+0=60\displaystyle {3\cdot20+0}={60}yes – exactly all the hours
(15,20)\displaystyle (15,20)3⋅15+20=65\displaystyle {3\cdot15+20}={65}no – 5 hours short
The solutions: a half-plane

On the graph board all the points that satisfy 3x+y≤60\displaystyle 3x+y\le60 are shaded.

3x+y≤60\displaystyle 3x+y\le 60
A=(10,20)\displaystyle A=(10,20)
B=(15,20)\displaystyle B=(15,20)
  • The line 3x+y=60\displaystyle {3x+y}={60} is the boundary line: the plans that use all 60 hours. It passes through (0,60)\displaystyle (0,60) and (20,0)\displaystyle (20,0).
  • Below the line – plans that leave hours free, like A=(10,20)\displaystyle {A}={(10,20)}.
  • Above the line – plans that need more than 60 hours, like B=(15,20)\displaystyle {B}={(15,20)}.

The reason: the constraint is y≤60−3x\displaystyle y\le60-3x. For each number of tables x\displaystyle x, the point on the line is the greatest number of chairs that can be added, and every smaller y\displaystyle y fits too. The part of the plane on one side of a line is called a half-plane.

Drawing a constraint

This is how to draw a constraint like 2x+5y≤100\displaystyle 2x+5y\le100:

  • The boundary line, 2x+5y=100\displaystyle {2x+5y}={100}, passes through two points on the axes: when x=0\displaystyle {x}={0}, y=20\displaystyle {y}={20}; when y=0\displaystyle {y}={0}, x=50\displaystyle {x}={50}.
  • Choose a point not on the line, usually (0,0)\displaystyle (0,0), and substitute: 2⋅0+5⋅0=0≤100\displaystyle {2\cdot0+5\cdot0}={0\le100} – true.
  • So shade the side of the line where (0,0)\displaystyle (0,0) is.

In an inequality with <\displaystyle < or >\displaystyle > the points on the boundary line are not solutions, so the line is dashed.

Exercise 1

A bakery bakes cakes and pies.
A cake takes the oven for 2 hours, and a pie for one hour.
The oven is free for 24 hours a week.
x\displaystyle x is the number of cakes a week, and y\displaystyle y the number of pies.

a

Write the constraint of the oven’s hours on the graph board.

b

Can the bakery bake 8 cakes and 10 pies in a week?
Work out how many oven hours they need, and write the answer.

    / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

    / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

    Exercise 2

    A half-plane is shaded on the graph board, and the points A\displaystyle A and B\displaystyle B are on its boundary line.
    Write the inequality of the half-plane.

    ?\displaystyle ?
    A=(0,15)\displaystyle A=(0,15)
    B=(30,0)\displaystyle B=(30,0)

    Exercise 3

    A clothes shop orders shirts and trousers.
    A shirt costs the shop 50 ₪, and a pair of trousers 100 ₪.
    The budget for the order is at most 3,000 ₪.
    The supplier sends an order of at least 20 items.
    x\displaystyle x is the number of shirts, and y\displaystyle y the number of pairs of trousers.

    a

    Write the two constraints on the graph board.

    b

    Check the plans (10,15)\displaystyle (10,15) and (30,20)\displaystyle (30,20): which of them keeps both constraints?