How do you formulate a linear programming problem?
Answer in short
Name the decision variables x and y (the quantities you choose), write every limit in the problem as a linear inequality in x and y, add x ≥ 0 and y ≥ 0, and write the quantity to optimise as Z = ax + by. The LPP is then: maximise (or minimise) Z subject to those constraints.
Stuck on a question? Take a photo and Lagnever AI explains it step by step. Try it for 7 days for ₹2. Get it on Google Play
The three parts of every LPP
A linear programming problem always has the same shape:
Maximise (or minimise) Z = ax + by subject to linear constraints on x and y, and x ≥ 0, y ≥ 0.
- Decision variables x and y are the quantities you choose.
- The objective function Z = ax + by measures what you want to make as large as possible (profit, output) or as small as possible (cost, time). a and b are constants.
- The constraints are the limits of the situation: money, space, hours, raw material, nutrients. Each one is a linear inequality. The conditions x ≥ 0 and y ≥ 0 are called non-negative restrictions.
A problem of finding a maximum or minimum under conditions is an optimisation problem; an LPP is the special kind where everything is linear.
Worked example 1: the furniture dealer (Section 12.2)
The book’s dealer buys only tables and chairs. A table costs ₹2500 and a chair ₹500, he has ₹50,000 to spend, and he can store at most 60 pieces. He makes ₹250 on each table and ₹75 on each chair, and he can sell everything he buys.
Before any algebra, try a few plans (these are the book’s own trials):
| Plan | Pieces | Money spent (₹) | Profit (₹) |
|---|---|---|---|
| 20 tables only | 20 | 50,000 | 5000 |
| 60 chairs only (100 would cost the full ₹50,000, but only 60 fit) | 60 | 30,000 | 4500 |
| 10 tables and 50 chairs | 60 | 50,000 | 6250 |
Different plans give different profits, so we need a method that finds the largest one.
Formulation.
- Let x = number of tables and y = number of chairs. Then x ≥ 0 and y ≥ 0.
- Money: 2500x + 500y ≤ 50000. Dividing by 500 gives 5x + y ≤ 100.
- Storage: x + y ≤ 60.
- Profit: Z = 250x + 75y.
So the LPP is: maximise Z = 250x + 75y subject to 5x + y ≤ 100, x + y ≤ 60, x ≥ 0, y ≥ 0. Solving it on a graph (see the next topic) gives a maximum profit of ₹6250 at x = 10, y = 50.
Worked example 2: a workshop (our own example)
A small workshop makes chairs and stools. A chair needs 3 hours of carpentry and 1 hour of polishing; a stool needs 1 hour of each. In a week there are 30 hours of carpentry and 14 hours of polishing. The profit is ₹60 on a chair and ₹40 on a stool. How many of each should be made for the largest profit?
Formulation. Let x = chairs and y = stools made in a week.
- Carpentry hours: 3x + y ≤ 30
- Polishing hours: x + y ≤ 14
- x ≥ 0, y ≥ 0
- Maximise Z = 60x + 40y
Solving it (preview of the next topic). The corners of the feasible region are (0, 0), (10, 0), (8, 6) and (0, 14); (8, 6) comes from solving 3x + y = 30 and x + y = 14 (subtract: 2x = 16). Z there is 0, 600, 720 and 560, so the workshop should make 8 chairs and 6 stools, for a profit of ₹720.
Turning words into inequalities
| Words in the problem | Inequality |
|---|---|
| “at most 60 pieces”, “cannot exceed 60”, “a maximum of 60” | x + y ≤ 60 |
| “at least 12 units”, “not less than 12”, “a minimum of 12” | … ≥ 12 |
| “the number of chairs is at least twice the number of tables” | y ≥ 2x |
| “all the money must be spent” | an equation, such as 2500x + 500y = 50000 |
Always check each inequality with a simple plan, such as x = 0, y = 0, to make sure it points the right way.
A checklist for formulation
- Read the question twice and decide what you are choosing. Those are x and y; write their meaning and units.
- List every limit: money, time, space, raw material, nutrient. Write one inequality for each, in a single unit.
- Add x ≥ 0 and y ≥ 0.
- Write Z for the quantity to optimise and say whether it is to be maximised or minimised.
- Simplify the inequalities (divide by common factors) before you draw them.
Read next: the graphical (corner point) method, the Chapter 12 notes and the NCERT solutions for Exercise 12.1.
Practice
-
A shop can store at most 40 items: x fans and y heaters. The storage constraint is:
Show answer
Answer: (b) x + y ≤ 40
-
A mixture must contain at least 12 units of vitamin. Food P gives 3 units per kg and food Q gives 2 units per kg. With x kg of P and y kg of Q, the constraint is:
Show answer
Answer: (c) 3x + 2y ≥ 12
-
A dealer earns ₹30 on each bicycle (x) and ₹50 on each scooter toy (y). Write the objective function.
Show answer
Answer: The total profit is Z = 30x + 50y, and the dealer wants to maximise it.
-
A tailor has 16 m of cloth. A shirt needs 2 m and a pair of trousers needs 4 m. Write the constraint on x shirts and y pairs of trousers, and the non-negative restrictions.
Show answer
Answer: Cloth used = 2x + 4y metres, and it cannot be more than 16, so 2x + 4y ≤ 16, that is x + 2y ≤ 8. Also x ≥ 0 and y ≥ 0.
Questions students ask
What makes a problem a linear programming problem?
Three things: the quantity to optimise is a linear function of the variables, every condition on the variables is a linear inequality or equation, and the variables are non-negative. If Z or any constraint has terms like x², xy or √x, it is not linear.
Why are they called decision variables?
Because their values are the decision you have to make: how many tables, how many chairs, how many kilograms of each food. Solving the LPP tells you which values to choose.
What does the word “programming” mean here?
It has nothing to do with computer code. It means planning: choosing a programme or plan of action. The word “linear” says that all the relations in the problem are of the first degree.
Is every optimisation problem a linear programming problem?
No. An optimisation problem is any problem of finding a maximum or minimum under some conditions. A linear programming problem is a special kind of optimisation problem in which the function and the conditions are all linear.
Stuck on a question?
Take a photo and Lagnever AI explains it step by step. Try it for 7 days for ₹2.
Get it on Google Play Open in browser
For parents: after the trial, the plan renews monthly by UPI or card autopay. You can cancel anytime in the app.