PYQ Vault

HSC Maths · Linear Programming

Formulating a Linear Programming Problem

Turning a word problem into an L.P.P.: name the decision variables, write the objective function to be maximized or minimized, and write every condition as a linear inequation, with x ≥ 0 and y ≥ 0.

Why this matters

23 questions, two of them from board papers: a diet problem (two foods, two vitamins) to be formulated and then solved for the minimum cost (2015), and a problem on two machines to be formulated and then solved for the maximum profit (2024). The textbook rows are Exercise 7.3 and its solved examples, which ask for the formulation only, and the word problems of Part II of the Miscellaneous Exercise, which ask for the formulation and then the graphical solution.

Concept 1 of 4: The parts of a linear programming problem

Every L.P.P. has the same three parts: the unknowns you choose (decision variables), the one quantity you want as large or as small as possible (objective function), and the limits on the unknowns (constraints). Name all three in your answer and the formulation marks are safe.

Definition

  • A linear programming problem is the problem of maximizing or minimizing a linear function subject to linear constraints.
  • Linear means every variable appears with index at most one: no x2x^2, no xyxy.
  • The textbook studies L.P.P.s with at most two variables and with non-negativity constraints.
  • Linear programming is used to make the best use of limited resources: raw materials, man-power, machine time, money.
PartWhat the textbook saysIn a profit problem
Decision variablesThe variables involved in the L.P.P.xx, yy = numbers of items A and B made
Objective functionA linear function of the variables which is to be maximized or minimizedz=30x+20yz = 30x + 20y, the total profit in RsQ
The Miscellaneous Exercise asks this as an MCQ: the objective function is the function to be maximized or minimized, not a constraint.
ConstraintsConditions under which the objective function is optimized, written as equations or inequationsMachine hours or raw material used, at most what is available
Non-negativity constraintsx≥0x \ge 0, y≥0y \ge 0Numbers of items made cannot be negative
Write all four in a formulation: 'Let x and y be ...', the objective function, the constraints, and x ≥ 0, y ≥ 0.
Practise this conceptself-check · 2 quick reps

The same idea in a textbook question:

Balbharati textbook · Misc I (3)Easy

Example 1 · Linear Programming · Formulation of a Linear Programming Problem

Objective function of L.P.P. is _______.

Calling a constraint the objective

The objective function is the one quantity to be maximized or minimized (profit, cost, distance). The inequations are the constraints, not the objective.

Not saying what x and y stand for

Start with 'Let x be the number of ... and y the number of ...'. Without this line the inequations have no meaning and the first mark is lost.

Concept 2 of 4: Maximum profit: limited resources give ≤ constraints

In a profit problem every resource (machine time, labour, raw material) is limited, so the amount used must be at most what is available. Each resource gives one '≤' constraint, and the profit is the objective to be maximized.

Definition

  • Step 1: let xx and yy be the numbers of the two items; write x≥0x \ge 0, y≥0y \ge 0.
  • Step 2: put the data in a table: one row for each resource, one column for each item, and a column for what is available.
  • Step 3: each resource row gives one constraint: amount used ≤\le amount available.
  • Step 4: the objective: Maximize zz = (profit on one A)xx + (profit on one B)yy.
  • Step 5: write the L.P.P. in full: 'Maximize z=…z = \ldots subject to ...'.
  • Use one unit on both sides of a constraint: if times are in minutes, change the hours available into minutes.

A maximum-profit L.P.P.

Maximize z=px+qy  subject to a1x+b1y≤c1, a2x+b2y≤c2, x≥0, y≥0\text{Maximize } z = px + qy \ \text{ subject to } a_1x + b_1y \le c_1,\ a_2x + b_2y \le c_2,\ x \ge 0,\ y \ge 0
  • p,qp, qprofit on one unit of each item
  • a1,b1a_1, b_1amount of the first resource used by one unit of each item
  • c1c_1amount of the first resource available

Worked example

A workshop makes chairs and stools. A chair needs 3 hours of carpentry and 1 hour of painting; a stool needs 1 hour of carpentry and 2 hours of painting. At most 30 hours of carpentry and 20 hours of painting are available in a week. The profit is Rs 80 on a chair and Rs 50 on a stool. Formulate the L.P.P. to maximize the profit.
Practise this conceptself-check · 2 quick reps

The same idea in a textbook question:

Balbharati textbook · 7.2 Ex.1Moderate

Example 2 · Linear Programming · Formulation of a Linear Programming Problem

A Toy manufacturer produces bicycles and tricycles, each of which must be processed through two machine A and B. Machine A has maximum of 120 hours available and machine B has a maximum of 180 hours available. Manufacturing a bicycle requires 4 hours on machine A and 10 hours on machine B. Manufacturing a tricycle required 6 hours on machine A and 3 hours on machine B. If profits are Rs.65 for a bicycle and Rs.45 for a tricycle, formulate L.P.P. to have maximum profit.

Mixing hours and minutes

If each item takes minutes and the machine is free for hours, change the hours into minutes first (3 hours = 180 minutes). A constraint with minutes on one side and hours on the other is wrong.

Reading the table the wrong way round

The coefficient of xx in every constraint comes from item A's column, the coefficient of yy from item B's. Write which letter stands for which item before reading off the numbers.

Concept 3 of 4: Minimum cost: requirements give ≥ constraints

In a diet or mixture problem the person or the product needs at least so much of each nutrient, so each nutrient gives a '≥' constraint, and the cost is the objective to be minimized.

Definition

  • Let xx and yy be the units of the two foods (fertilizers, fodders, compounds) mixed; x≥0x \ge 0, y≥0y \ge 0.
  • Table: one row for each nutrient, a column for each food, and a last column for the minimum requirement.
  • Each nutrient row gives: amount supplied ≥\ge minimum requirement.
  • 'At least' and 'minimum of' give ≥\ge; 'at most' and 'not more than' give ≤\le.
  • Objective: Minimize zz = (cost of one unit of the first food)xx + (cost of one unit of the second)yy.
  • A constraint may be divided by a common factor: 4x+2y≥164x + 2y \ge 16 is the same as 2x+y≥82x + y \ge 8.

A minimum-cost L.P.P.

Minimize z=px+qy  subject to a1x+b1y≥c1, a2x+b2y≥c2, x≥0, y≥0\text{Minimize } z = px + qy \ \text{ subject to } a_1x + b_1y \ge c_1,\ a_2x + b_2y \ge c_2,\ x \ge 0,\ y \ge 0
  • p,qp, qcost of one unit of each food
  • a1,b1a_1, b_1units of the first nutrient in one unit of each food
  • c1c_1minimum requirement of the first nutrient

Worked example

A farmer mixes two feeds P and Q. Each kg of P contains 2 units of protein and 3 units of fat; each kg of Q contains 4 units of protein and 1 unit of fat. The mixture must contain at least 20 units of protein and 12 units of fat. P costs Rs 30 per kg and Q costs Rs 25 per kg. Formulate the L.P.P. to minimize the cost.
Practise this conceptself-check · 2 quick reps

The same idea in a textbook question:

Balbharati textbook · 7.2 Exercise 7.3 Q.7Moderate

Example 3 · Linear Programming · Formulation of a Linear Programming Problem

A doctor has prescribed two different units of foods A and B to form a weekly diet for a sick person. The minimum requirements of fats, carbohydrates and proteins are 18, 28, 14 units respectively. One unit of food A has 4 units of fats, 14 units of carbohydrates and 8 units of protein. One unit of food B has 6 units of fat, 12 units of carbohydrates and 8 units of protein. The price of food A is 4.5 per unit and that of food B is 3.5 per unit. Form the L.P.P. so that the sick person's diet meets the requirements at a minimum cost.

Writing ≤ for 'at least'

'At least 14 units' means 14 or more, so the constraint is ≥14\ge 14. Read each phrase: 'at least' and 'minimum' give ≥\ge, 'at most' and 'not more than' give ≤\le.

Maximizing a cost

A cost is minimized and a profit is maximized. With all constraints of the '≥' kind, 'maximize the cost' has no finite answer, which is a sign the objective is the wrong way round.

Concept 4 of 4: Formulate and solve: the full board answer

When a word problem asks 'how many of each should be made' or 'find the minimum cost', the formulation is only the first half. You must then draw the feasible region, find its corners, compare zz at each and answer the question in words.

Definition

  • Formulation: let xx, yy be ...; the table; the constraints; the objective; the L.P.P. in full.
  • Graph: draw each boundary line from its intercepts, decide each side by the origin test, and shade the feasible region.
  • Corners: name each vertex; find a meeting point of two lines by solving their equations, and check it in the other constraints.
  • Table: the value of zz at every corner; choose the largest for a maximum, the smallest for a minimum.
  • Answer in words: how many of each item, and the maximum profit or minimum cost in Rs.

Order of a full answer

L.P.P.→feasible region→corner points→z at each corner→answer in words\text{L.P.P.} \to \text{feasible region} \to \text{corner points} \to z \text{ at each corner} \to \text{answer in words}

Worked example

A potter makes pots and vases. A pot takes 1 hour on the wheel and 2 hours in the kiln; a vase takes 1 hour on the wheel and 1 hour in the kiln. The wheel is free for at most 12 hours and the kiln for at most 16 hours a day. The profit is Rs 40 on a pot and Rs 30 on a vase. How many of each should be made for the maximum profit?
Practise this conceptself-check · 2 quick reps

The same idea in a real exam question:

Maharashtra HSC Class 12 · 2015 · Q. 3. (B) iii.Hard

Example 4 · Linear Programming · Formulation of a Linear Programming Problem

A diet of a sick person must contain at least 48 units of vitamin A and 64 units of vitamin B. Two foods F1F_{1} and F2F_{2} are available. Food F1F_{1} costs 6 per unit and food F2F_{2} costs 10 per unit. One unit of food F1F_{1} contains 6 units of vitamin A and 7 units of vitamin B. One unit of food F2F_{2} contains 8 units of vitamin A and 12 units of vitamin B. Find the minimum cost for the diet that consists of mixture of these two foods and also meeting the minimal nutritional requirements.

Stopping at the formulation

'Find the number of units' or 'find the minimum cost' asks for the solution too: the graph, the corners, the table of zz and the answer. The formulation alone earns only part of the marks.

No final sentence

End by answering the question asked, in words and with units: 'make 4 pots and 8 vases a day; the maximum profit is Rs 400', not just 'z=400z = 400'.

Summary — formulas & gotchas at a glance

A revision cheat-sheet for the formulas and gotchas above. Click any concept name to jump back to its full explanation.

Formulas (3)

  • Maximum profit: limited resources give ≤ constraints

    A maximum-profit L.P.P.

    Maximize z=px+qy  subject to a1x+b1y≤c1, a2x+b2y≤c2, x≥0, y≥0\text{Maximize } z = px + qy \ \text{ subject to } a_1x + b_1y \le c_1,\ a_2x + b_2y \le c_2,\ x \ge 0,\ y \ge 0
  • Minimum cost: requirements give ≥ constraints

    A minimum-cost L.P.P.

    Minimize z=px+qy  subject to a1x+b1y≥c1, a2x+b2y≥c2, x≥0, y≥0\text{Minimize } z = px + qy \ \text{ subject to } a_1x + b_1y \ge c_1,\ a_2x + b_2y \ge c_2,\ x \ge 0,\ y \ge 0
  • Formulate and solve: the full board answer

    Order of a full answer

    L.P.P.→feasible region→corner points→z at each corner→answer in words\text{L.P.P.} \to \text{feasible region} \to \text{corner points} \to z \text{ at each corner} \to \text{answer in words}

Reference tables (1)

The parts of a linear programming problem4 rows
PartWhat the textbook saysIn a profit problem
Decision variablesThe variables involved in the L.P.P.xx, yy = numbers of items A and B made
Objective functionA linear function of the variables which is to be maximized or minimizedz=30x+20yz = 30x + 20y, the total profit in RsQ
The Miscellaneous Exercise asks this as an MCQ: the objective function is the function to be maximized or minimized, not a constraint.
ConstraintsConditions under which the objective function is optimized, written as equations or inequationsMachine hours or raw material used, at most what is available
Non-negativity constraintsx≥0x \ge 0, y≥0y \ge 0Numbers of items made cannot be negative
Write all four in a formulation: 'Let x and y be ...', the objective function, the constraints, and x ≥ 0, y ≥ 0.

Watch out for (8)

Test yourself on Linear Programming

10 past MH HSC 12 questions from this chapter, timed at 15 minutes and marked the way the exam marks it. You see your score and every answer the moment you finish. Free to start.