Back to the on-screen lesson ·

What a linear program decides

Decision variables, a linear objective, one constraint per limit, and non-negativity.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to name the decision variables of a described problem with their units, write its objective as a linear combination of them, write one linear constraint for each resource or requirement, and say which quantities the linear language can hold and which it cannot.

2. What you already have

You can read a system of linear inequalities in two or more unknowns, and you can solve a pair of linear equations. Everything here is built from those two abilities; what is new is deciding which inequalities to write down in the first place.

3. The four words this course keeps using

A decision variable is a number the plan gets to choose. The objective is the single linear quantity to be made as large or as small as possible. A constraint is a linear inequality or equation the plan must satisfy. A plan satisfying all of them is feasible; the best feasible plan is optimal.

4. Formulating a linear program

A linear program chooses $x \ge 0$ to maximise or minimise $c^{T}x$ subject to $Ax \le b$. Formulating one is four questions asked in order. What is decided? Name each choice and give it a unit — chairs per week, litres of blend A, hours assigned to shift 3. What is being judged? Write it as a linear combination of the decisions. What limits the choice? One constraint per resource, per requirement and per balance, each with both sides in the same units. What is impossible? Non-negativity, because a plan cannot make minus four chairs.

The order matters. Writing the objective before naming the decisions is how a model ends up with a variable for something nobody chooses, and checking units in every constraint is what catches the row that compares kilograms with hours.

Another way: steps

  1. Name the decisions, with units.
  2. Write the objective as profit or cost per unit times the decisions.
  3. Write one constraint per resource, requirement or balance.
  4. Add $x \ge 0$.

Another way: example

A workshop makes chairs $x_1$ and tables $x_2$: profit $30x_1 + 50x_2$; wood $2x_1 + 5x_2 \le 100$; labour $3x_1 + 2x_2 \le 60$; $x \ge 0$. Four lines, and every number in them came from one sentence of the description.

5. Where this usually goes wrong

The commonest error is making a variable out of something nobody decides — the flour in the store, the profit at the end of the week. Data belongs in coefficients and right-hand sides; consequences belong in the objective. The second commonest is a constraint whose two sides are in different units, which no solver will ever complain about and which makes every answer meaningless.

6. A diet problem

  1. Two foods $x_1, x_2$ cost $2$ and $3$ a unit. The decisions are the two quantities, in units of food, and the objective is the cost $2x_1 + 3x_2$ to be minimised.

    Decisions first, then the objective.

  2. At least $8$ units of protein: $x_1 + 2x_2 \ge 8$. At least $10$ of energy: $3x_1 + x_2 \ge 10$.

    A requirement is a $\ge$ constraint.

  3. Add $x_1, x_2 \ge 0$ and the model is complete: two variables, two requirements, one objective.

    Nothing is negative.

7. Your turn: a haulier has $40$ hours of driving and earns $6$ a trip on route A and $9$ on route B, which take $2$ and $5$ hours

  1. The decisions are $x$ trips on A and $y$ trips on B, and the objective is $6x + 9y$ to be maximised.

    Decisions, then objective.

  2. Your turn: work this step out. Its working is at the end of the packet.

    The one resource is time: $2x + 5y \le 40$, with $x, y \ge 0$.

8. Guided practice

A workshop makes $x$ chairs and $y$ tables. A chair takes $2$ units of wood and $4$ hours of labour; a table takes $5$ units of wood and $4$ hours. There are $22$ units of wood and $32$ hours available. Write the two constraint rows.

Used per chairUsed per tableAvailable
Wood
Labour

9. Guided practice

Each chair earns $9$ and each table earns $2$. The plan makes $2$ chairs and $10$ tables. What is the profit?

Answer:

10. Guided practice

Select every quantity a linear program can hold as written.

This task has no paper form; do it on a device.

11. Practice

A bakery decides how many loaves and how many cakes to bake tomorrow. A loaf earns $4$ and a cake earns $3$. Which of these is a decision variable?

12. Practice

A factory chooses quantities for $3$ products, limited by $5$ resources. Complete the count.

The model has v decision variables and c resource constraints, and its objective adds t terms.

13. Somewhere new

Opening the line at all costs a setup fee of $245$; after that each unit costs $5$. Producing nothing costs nothing. Fill in the total cost of each plan.

Total cost
Make nothing
Make one unit
Make $5$ units

14. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

15. Test question

A workshop makes $x$ chairs and $y$ tables. A chair takes $5$ units of wood and $1$ hours of labour; a table takes $4$ units of wood and $2$ hours. There are $49$ units of wood and $28$ hours available. Write the two constraint rows.

Used per chairUsed per tableAvailable
Wood
Labour

16. What you can do now

You can turn a described decision into decision variables, a linear objective and one constraint per limit. Say in your own words why a cost that jumps cannot be written as a linear function of the quantity produced.

Working for the steps left to you

7. Your turn: a haulier has $40$ hours of driving and earns $6$ a trip on route A and $9$ on route B, which take $2$ and $5$ hours, step 2