Math Lab
Home/Class XII/Ch 12/Formulating a linear programming problem

Formulating a linear programming problem

Most marks in an LP question come from formulating the problem correctly. The graphing and evaluation that follow are mechanical; the translation from words to math is where students stumble.

The three ingredients

Every LPP has three components.

Decision variables: the unknowns the problem is asking you to determine. Typically xx and yy represent quantities of something , units produced, kilograms of a food eaten, hours spent at an activity.

Objective function: the quantity to maximise or minimise. Always linear in the decision variables: Z=ax+byZ = ax + by.

Constraints: linear inequalities (or sometimes equalities) describing limits on the decision variables. Include the non-negativity constraints x,y0x, y \ge 0 explicitly , quantities of things can't be negative.

The formulation algorithm

  1. Read carefully. Identify what is being chosen (decision variables) and what is being optimised (objective).
  2. Define each variable in plain words. Write "Let xx = number of units of A produced per day" , not just "xx".
  3. Write the objective. Express the quantity to be optimised as a linear function. State "maximise" or "minimise."
  4. Write each constraint as a linear inequality (or equality). One constraint per limit in the problem.
  5. Include x,y0x, y \ge 0.

Common patterns

Diet problem. A person needs at least so many units of nutrient A, so many of nutrient B, etc. Foods cost different amounts and contain different amounts of each nutrient. Minimise total cost. Variables: quantities of each food. Objective: cost. Constraints: nutrient requirements.

Manufacturing problem. A factory makes two products. Each unit of product I uses certain hours on machine A and machine B; same for product II. Available machine hours are limited. Profit per unit is given. Maximise total profit. Variables: units of each product. Objective: profit. Constraints: machine-hour limits.

Transportation problem. Goods sent from mm sources to nn destinations. Supplies, demands, and per-unit costs are given. Minimise total cost. Variables: amount sent from each source to each destination.

Resource allocation. Limited budget, multiple investment options with different returns and risks. Maximise total return (or minimise risk).

Reading practice

Problem A. "A confectioner makes two kinds of biscuits, Crunch and Munch. One packet of Crunch requires 300g300\,\text{g} of flour and 50g50\,\text{g} of sugar; one of Munch requires 150g150\,\text{g} of flour and 50g50\,\text{g} of sugar. He has 7.5kg7.5\,\text{kg} of flour and 3kg3\,\text{kg} of sugar. Profit on Crunch is ₹55 per packet, on Munch ₹44 per packet. How many packets of each should he make to maximise profit?"

Decision variables: let xx = packets of Crunch, yy = packets of Munch.

Objective: maximise Z=5x+4yZ = 5x + 4y.

Constraints (in grams):

  • Flour: 300x+150y7500300x + 150y \le 7500, i.e. 2x+y502x + y \le 50.
  • Sugar: 50x+50y300050x + 50y \le 3000, i.e. x+y60x + y \le 60.
  • Non-negativity: x,y0x, y \ge 0.

Problem B. "A diet needs at least 88 units of vitamin A and 1010 units of vitamin B daily. Food F1F_1 contains 22 units of A and 11 unit of B per gram; food F2F_2 contains 11 unit of A and 22 units of B per gram. F1F_1 costs ₹44/gram, F2F_2 costs ₹33/gram. Minimise the cost."

Decision variables: xx grams of F1F_1, yy grams of F2F_2.

Objective: minimise Z=4x+3yZ = 4x + 3y.

Constraints:

  • Vitamin A: 2x+y82x + y \ge 8.
  • Vitamin B: x+2y10x + 2y \ge 10.
  • Non-negativity: x,y0x, y \ge 0.

Worked examples

Example 1. A factory produces two products P and Q. P needs 33 hours on machine M1M_1 and 22 hours on machine M2M_2 per unit; Q needs 44 hours on M1M_1 and 11 hour on M2M_2. M1M_1 is available for 1212 hours, M2M_2 for 55 hours daily. Profit per unit: ₹55 for P, ₹44 for Q. Maximise daily profit.

xx = units of P, yy = units of Q. Z=5x+4yZ = 5x + 4y. Constraints: 3x+4y123x + 4y \le 12, 2x+y52x + y \le 5, x,y0x, y \ge 0.

Example 2. A farmer has 5050 acres of land for wheat and barley. Wheat earns ₹200200/acre with 4040 hours of labour; barley earns ₹150150/acre with 3030 hours. Total labour available: 15001500 hours. Maximise revenue.

xx = acres of wheat, yy = acres of barley. Z=200x+150yZ = 200x + 150y. Constraints: x+y50x + y \le 50 (land), 40x+30y150040x + 30y \le 1500 i.e. 4x+3y1504x + 3y \le 150 (labour), x,y0x, y \ge 0.

Example 3. A medical clinic wants to plan its supply of vitamin tablets. Tablet A costs ₹22 and provides 44 units of vit-C and 11 unit of vit-E. Tablet B costs ₹11 and provides 11 unit of vit-C and 11 unit of vit-E. Daily intake at least 88 vit-C and 55 vit-E. Minimise cost.

xx tablets of A, yy of B. Z=2x+yZ = 2x + y. Constraints: 4x+y84x + y \ge 8, x+y5x + y \ge 5, x,y0x, y \ge 0.

Example 4. A toy company makes dolls and trains. Each doll uses 44 units of plastic and 66 minutes of machine time. Each train uses 55 units of plastic and 55 minutes of machine time. Daily plastic: 200200 units; daily machine: 300300 minutes. Profit ₹1010 per doll, ₹1212 per train. Maximise profit.

xx dolls, yy trains. Z=10x+12yZ = 10x + 12y. Constraints: 4x+5y2004x + 5y \le 200, 6x+5y3006x + 5y \le 300, x,y0x, y \ge 0.

Example 5. Two transporters charge ₹1010/km and ₹1212/km, respectively. They can carry 5050 and 8080 kg in one trip. A merchant has 200200 kg to send a distance of 2020 km. Transporter 1 has 44 trucks; Transporter 2 has 55 trucks. Minimise cost.

This is more complex , but formulate cleanly. xx = trips by Transporter 1, yy = trips by Transporter 2. Cost per trip: ₹200200 and ₹240240. Objective: minimise Z=200x+240yZ = 200x + 240y. Constraints: 50x+80y20050x + 80y \ge 200 (capacity), x4x \le 4, y5y \le 5, x,y0x, y \ge 0.

Example 6. A student studies for two subjects, Maths and Physics, scoring marks proportional to study time. Each hour of Maths gives 55 marks, each hour of Physics gives 44. Constraint: total time 10\le 10 hours, Maths time at least 33 hours, Physics time at least 22 hours. Maximise score.

xx = Maths hours, yy = Physics hours. Z=5x+4yZ = 5x + 4y. Constraints: x+y10x + y \le 10, x3x \ge 3, y2y \ge 2.

Try it yourself

For each problem, identify decision variables, objective, and constraints.

  1. A baker makes two cakes A and B. A uses 11 kg flour, 22 kg sugar, profit ₹3030. B uses 22 kg flour, 11 kg sugar, profit ₹2525. Available: 1010 kg flour, 1212 kg sugar.
  2. A pharmacy sells two pills. Pill X has 55 vit-A, 33 vit-B, cost ₹55. Pill Y has 22 vit-A, 44 vit-B, cost ₹44. Need at least 2020 vit-A and 3030 vit-B daily.
  3. A factory makes chairs and tables. Chair needs 22 hours of work, 11 kg wood. Table needs 44 hours, 33 kg wood. Available: 3030 hours, 2424 kg. Profit ₹1010/chair, ₹2525/table.
  4. A car rental company has 2020 cars, each rented for ₹200200/day or sold for ₹1000010000. At least 55 cars must be rented. Maximise weekly revenue (assume rentals run all week).
  5. A student needs at least 1616 units of vitamin A and 2020 of B daily. Cereal P has 22 A, 33 B per scoop, ₹11/scoop. Cereal Q has 44 A, 11 B, ₹22/scoop. Minimise cost.
  6. A clothing manufacturer makes shirts and trousers. Shirt: 11m fabric, 0.50.5h labour, ₹2525 profit. Trouser: 1.51.5m fabric, 11h labour, ₹3030 profit. Available: 6060m fabric, 4040h labour.
  7. A confectioner has 5050kg sugar, 3030kg butter. Cake type A uses 11kg sugar, 0.50.5kg butter, profit ₹8080. Type B uses 22kg sugar, 11kg butter, profit ₹120120.
  8. A truck operator transports oranges and apples. Truck capacity: 55 tonnes. Oranges: 11 tonne, profit ₹15001500. Apples: 0.50.5 tonne, profit ₹10001000. Demand: at least 22 tonnes of each.
  9. A farmer has 4040 acres for sugarcane (xx) and wheat (yy). Profit: ₹12001200/acre sugarcane, ₹800800/acre wheat. Sugarcane needs 2020 hours/acre water, wheat needs 1010 hours/acre. Water available: 600600 hours.
  10. A diet plan: 22 types of foods. Food 1 has 200200 calories, 3030 proteins per unit. Food 2: 100100 calories, 2020 proteins. Need at least 400400 calories and 5050 proteins. Cost: ₹2020/unit, ₹1515/unit. Minimise.
  11. A library buys two types of books. Type A: ₹500500/book, 11kg, profit ₹8080. Type B: ₹300300/book, 0.50.5kg, profit ₹5050. Budget ₹1500015000, shelf 2525kg.
  12. An investor allocates ₹22 lakh to two schemes. Scheme 1: 8%8\% return, low risk. Scheme 2: 12%12\% return, high risk. At most ₹8000080000 in scheme 2. Maximise return.
  13. A baker has 55kg flour, 11kg sugar. Bread: 0.50.5kg flour, 0.050.05kg sugar, profit ₹55. Cake: 0.250.25kg flour, 0.10.1kg sugar, profit ₹1010.
  14. A factory packages two products in boxes. Type X: 11kg/box, 0.50.5m³/box, profit ₹1010. Type Y: 22kg, 11m³, profit ₹2525. Limits: 100100kg, 5050m³.

Pitfalls and tricks

  • Define variables in words. Just "xx" isn't enough , say "xx = number of …".
  • Match units. Don't mix kg and g; convert everything to a single unit.
  • Include x,y0x, y \ge 0 explicitly , easy to forget.
  • One constraint per resource. Don't combine two constraints into one inequality; keep them separate.
  • Re-read the problem after formulation to ensure each constraint corresponds to a real-world limit and the objective matches what's asked.

Practice quiz

Quick check on this topic.

Quiz
Quick check : Formulation
6 questions · pick the best answer
Q1

First step in formulating an LPP

Q2

Non-negativity constraints reflect

Q3

An objective function is

Q4

Translating 'at least 2020 units of A' into a constraint

Q5

If profit per unit is ₹3030 for X and ₹5050 for Y, the objective is

Q6

A constraint 'machine A works at most 40 hours' is