A small bakery in Bhaktapur has 16 kg of flour and 10 hours of oven time for tomorrow. A batch of cakes takes 2 kg of flour and an hour in the oven and makes Rs 600 profit; a batch of bread takes 1 kg and an hour and makes Rs 400. Cakes earn more, so should the baker make only cakes? Eight batches would use all the flour and earn Rs 4,800. Is there a better plan?
Every limit here is an inequality: the flour used must be at most 16 kg. This unit draws each limit as a line on a graph, shades the plans that keep every limit, and shows that the best plan is always at a corner of that shape. The bakery is solved at the end of 3.4.
3.1 Introduction
Finding the most profit, or the least cost, when time, money and material are limited is an everyday problem for a shop, a farm or a factory. Linear programming is a method for it. “Programming” here is an old word for planning, not computer programs: in the 1940s the United States Air Force called its plans for training, supplies and moving people “programs”. “Linear” means that every quantity involved is built from the variables like 2x + y: no squares, no products of variables.
A linear programming problem has three parts:
- the variables (the unknowns), the numbers we may choose (how many batches of cakes, x, and of bread, y);
- the limits, written as linear inequalities (2x + y ≤ 16 for the flour);
- the quantity to make as large or as small as possible, also linear (the profit, 600x + 400y).
The method was found twice, on two sides of the world. It is now used wherever many limits must be kept at once: in transport, factories, energy and farming.
What does “programming” mean in “linear programming”?
Pick an answer to see why.
3.2 Linear Inequalities
An equation says two things are equal; an inequality says one is smaller or bigger. Four signs are used:
| Sign | Read as | Says, in words |
|---|---|---|
| < | is less than | below, fewer than |
| ≤ | is less than or equal to | at most, not more than |
| > | is greater than | above, more than |
| ≥ | is greater than or equal to | at least, not less than |
An inequality whose variables appear only to the first power, like x ≤ 2 or 15x + 25y ≤ 750, is a linear inequality.
A linear inequality in one variable, like x ≤ 2, allows every point on one side of the upright line x = 2. A linear inequality in two variables, like 15x + 25y ≤ 750, is true for a whole half of the plane, all on one side of the line 15x + 25y = 750: that line is its boundary line, and the half it allows is its solution region.
Why a whole half? Along any upright line, x stays the same and y grows. For 15x + 25y, going up always makes the value bigger. So once you cross the boundary, where 15x + 25y is exactly 750, you are above 750 and stay above it. Every point on one side is below 750, every point on the other side above it.
That is why one point is enough to decide. Pick any point not on the line, a test point, and put its coordinates into the inequality. If the statement comes out true, the point is on the allowed side, and so is the whole of that side. If it comes out false, the allowed side is the other one. O(0, 0) is the easiest test point, because every term with x or y becomes 0.
Steps for showing a linear inequality on a graph
- The boundary line. Change the sign to “=” to get the boundary line’s equation.
- Draw it. Find two points on it (putting x = 0, then y = 0, is usually quickest) and draw the line through them: a solid line for ≤ or ≥, because the points on the line are allowed; a dashed line for < or >, because they are not.
- A test point. Choose a point not on the line, usually O(0, 0), and put it into the inequality. For example, (0, 0) in 2x + y ≤ 5 gives 0 ≤ 5: true.
- Decide the side. True: the solution region is the side with the test point. False: it is the other side.
- Shade the solution region.
Which point is in the solution region of 3x − 2y > 6?
Pick an answer to see why.
The boundary of a region is drawn as a dashed line, and the region does not contain O. Which inequality could it be?
Pick an answer to see why.
Worked examples
3.3 System of Linear Inequalities
A real plan has to keep several limits at once: the bakery must not use more than 16 kg of flour and not more than 10 oven hours, and it can’t make a negative number of batches. Two or more linear inequalities taken together are a system of linear inequalities.
Each inequality allows one side of its line. The points that satisfy every inequality of the system are where all those sides overlap: the common solution region, called the feasible region (feasible means possible). Every point inside it is a plan that keeps every limit.
When the feasible region is closed in on all sides, it is a convex polygon: a shape with straight sides and no dents, in which the straight path between any two of its points stays inside. Its corners are its vertices (corner points). Each vertex is where two boundary lines cross, so its coordinates are found by solving those two equations together, and a vertex satisfies every inequality of the system. In 3.4 the corners turn out to be where the best plans are.
Worked examples
Going the other way, from a shaded graph back to its inequalities, needs the equation of each boundary line. When a line meets the axes at (a, 0) and (0, b), its equation in double-intercept form is
Then a test point inside the region gives the sign.
A vertex of a feasible region is found by …
Pick an answer to see why.
3.4 Solution of Linear Programming Problems
Linear programming is used in business and industry to make the best use of resources, time and money: the least cost of production, the most production or profit. In every such problem:
- the linear quantity to be made as large (maximized) or as small (minimized) as possible, such as Z = 600x + 400y, is the objective function;
- the conditions written as linear inequalities, such as 2x + y ≤ 16, are the constraints. Most problems also have x ≥ 0 and y ≥ 0, because you can’t make a negative number of anything.
A plan in the feasible region is a feasible solution; the feasible solution that gives the best value of the objective function is the optimal solution. Problems with two variables are solved by the graphical method of this unit; problems with hundreds or millions of variables are solved by computers with Dantzig’s simplex method and newer methods, which you will not need here.
Why the best plan is at a corner
Take the bakery. A profit of, say, Rs 2,400 comes from every plan on the line 600x + 400y = 2400. A profit of Rs 4,000 comes from the line 600x + 400y = 4000: the same slope, a little further from O. So as the profit you ask for grows, its line slides across the feasible region parallel to itself. The largest profit you can still reach is where the line is about to leave the region, and a straight line leaves a convex polygon at a corner (or, if it is parallel to a side, along that whole side, corners included).
Corner-point rule: if the objective function Z = ax + by has a maximum or a minimum on a feasible region, that value occurs at a vertex of the region. So you never need to test the points inside: work out Z at each vertex and compare.
Steps for solving a linear programming problem by graph
- Draw every inequality (constraint) on the same graph.
- Find the common solution region, the feasible region.
- Find the coordinates of its vertices (from the graph, or by solving the two boundary equations that meet there), and put each into the objective function.
- The largest value of the objective function is its maximum, the smallest its minimum; say at which vertex each occurs.
For a problem given in words, start with a step 0: say what x and y stand for, and write the constraints and the objective function.
Worked examples
Back to the bakery
A computer can check this by brute force, trying every whole-number plan. Run it, then change a profit and run it again.
best = 0for x in range<span class="lm-pt">(0, 11)</span>: # batches of cakes for y in range<span class="lm-pt">(0, 17)</span>: # batches of bread if 2*x + y <= 16 and x + y <= 10: # enough flour and oven time profit = 600*x + 400*y if profit > best: best, plan = profit, (x, y)print("Best plan (cakes, bread):", plan, "profit Rs", best)Exercise 3
Question 1
A. Hari earns more than Rs 600 in a day. If his earning for one day is x rupees, which inequality is correct?
Pick an answer to see why.
B. In winter the temperature in Kathmandu is at least −3 °C. If the winter temperature is x °C, which inequality says this?
Pick an answer to see why.
C. Which point satisfies 2x − 3y > 5?
Pick an answer to see why.
D. The vertices of a feasible region are O(0, 0), A(9, 0), B(7, 3) and C(0, 8). At which one is Z = 3x + 4y largest?
Pick an answer to see why.
E. Which inequality does the graph beside show?
Pick an answer to see why.
Question 2
Draw the graph of each inequality.
x + y ≥ 3
Answer
x − y ≥ 0
Answer
2x + 3y ≤ 6
Answer
3x + 4y ≥ 12
Answer
x − 2y ≥ 3
Answer
3x − 2y ≥ 4
Answer
Question 3
Draw each system of inequalities and find its common solution region (feasible region).
x + 2y ≤ 6, x ≥ 0
Answer
2x − y ≥ 4, y ≥ 0
Answer
x + y ≤ 1, x − y ≥ 1
Answer
3x + 4y ≤ 12, 2x − y ≤ 0, x − y ≤ 2, x ≥ 0, y ≥ 0
Hint
Answer
2x + 3y ≤ 6, 3x − y ≤ 0, x ≥ 0, y ≥ 0
Answer
x + y ≤ 2, 2x − 3y ≤ 6, x ≥ 0, y ≤ 2
Answer
Question 4
Find the inequalities represented by each shaded region.
Answer
Hint
Answer
Answer
Answer
Question 5
Find the maximum and minimum values of each function under the given constraints.
Z = 3x + 2y; x + y ≤ 6, x − y ≤ 4, x ≥ 0, y ≥ 0
Answer
P(x, y) = 3x + 5y; x + y ≤ 6, x − y ≥ 2, x ≥ 0, y ≥ 0
Answer
Z = 3x + 5y; x − 2y ≤ 1, x + y ≤ 4, x ≥ 0, y ≥ 0
Answer
F = 3x + 2y; x − 2y ≤ 2, x + 2y ≤ 8, x ≥ 0, y ≥ 0
Answer
F(x, y) = 2x + y; x + 2y ≤ 10, x + y ≥ 1, y ≤ 4, y ≥ 0
Hint
Answer
Question 6
Find the four inequalities represented by the shaded region. Then find the maximum and minimum values of F(x, y) = 20x + 30y over it.
Answer
Practice every question in the book, and keep track of the ones you miss →
How the SEE asks it
In the SEE’s Optional Mathematics paper (75 marks, 3 hours), Linear Programming is one of the units of Algebra (Units 1 to 6 of this book). CDC’s specification grid gives Algebra 17 marks, in three kinds of question:
| Group | Kind of question | Algebra’s marks | Levels |
|---|---|---|---|
| A | multiple choice, 1 mark each | 2 | knowledge 1, application 1 |
| B | within the content area: questions on Algebra alone, each of 2 to 4 parts | 10 | knowledge 2, understanding 2, application 4, higher ability 2 |
| C | across content areas: one question joining Algebra with another area | 5 | understanding 2, application 2, higher ability 1 |
In CDC’s model paper, linear programming is the last part of a group B question that starts with matrices: a system of two constraints with x ≥ 0 and y ≥ 0, and “show the feasible region on a graph”, 2 marks at the application level. Its marking scheme gives 1 mark for the lines drawn correctly and 1 for finding and shading the right feasible region.
What each kind asks, and where its marks are:
- Writing an inequality: a sentence (“at least”, “more than”) or a shaded graph into an inequality. One mark each in group A.
- Showing a system on a graph: each boundary from two points, solid or dashed, a test point for each side, the common region shaded. A mark for the lines, a mark for the region.
- The inequalities of a shaded region: each line’s equation (double-intercept form, or the slope), and a test point for its sign.
- Maximum and minimum: the region, its vertices (one found by solving two equations), the objective function at each, and the answer with where it occurs.
Here is a question of the longer kind, written for this book, with how it is marked.
Where these facts come from
- Linear programming’s history: Kantorovich and Leontief in the late 1930s, Hitchcock’s transport problem (1941), Dantzig’s Air Force planning and simplex method (1947), and the 1975 Nobel Memorial Prize in Economic Sciences to Kantorovich and Koopmans; its uses in transport, energy, telecommunications and manufacturing (3.1): Wikipedia, “Linear programming”, read October 2026.
- Kantorovich (1912–1986), the plywood industry and his 1939 book, the Road of Life across Lake Ladoga (3.1): Wikipedia, “Leonid Kantorovich”, read October 2026.
- Dantzig (1914–2005), his Air Force work, the simplex method (1947), the National Medal of Science of 1975 “for inventing linear programming”, and the homework story of 1939 (3.1): Wikipedia, “George Dantzig”; “programming” as the military word for plans and schedules, the name proposed by Koopmans in 1948, and “the father of linear programming”: MacTutor, “George Bernard Dantzig”, read October 2026.
- The cheapest vegetarian diet from Kalimati prices, Rs 262.2 a person a day (3.1): S. P. Gupta and A. Gupta, “A linear programming approach for designing nutritionally adequate and cost-effective vegetarian diets in Nepal”, Kathmandu University Journal of Science, Engineering and Technology 20(1), 2026, read October 2026.
- Linear programming in the compound feed industry since the mid-1950s (3.1, 3.4): FAO, “Linear programming in fish diet formulation”, read October 2026.
- CDC’s specification grid and model paper for Optional Mathematics, 2082 (How the SEE asks it): the textbook folder,
Specification Grids/grid-Opt. Math-G10.
A companion to your textbook, not a replacement for it: study from the book your school uses, and where the two differ, follow your teacher. Found a mistake? Please tell us.
