Linear Programming Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Linear Programming.

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

Linear programming optimizes a linear objective subject to linear inequality or equality constraints.

You search the corners of an allowed region for the best score.

Read the full concept explanation →

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: Linear programming maximizes or minimizes a linear objective over a region cut out by linear constraints, and the optimum always sits at a corner of that region.

Common stuck point: The procedure for linear programming is the easy part; the trap is searching the interior for the best value. Asking "Am I optimizing a linear objective over a region bounded by linear inequalities, with the answer expected at a corner?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Sense of Study hint: Ask: Am I optimizing a linear objective over a region bounded by linear inequalities, with the answer expected at a corner?

Worked Examples

Example 1

medium
Maximize z=3x+2yz = 3x + 2y subject to x+y4x + y \leq 4, x0x \geq 0, y0y \geq 0.

Answer

z=12z = 12 at (4,0)(4, 0)

First step

1
Step 1: Identify the feasible region: the triangle with vertices (0,0)(0,0), (4,0)(4,0), (0,4)(0,4).

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Unlock answer keys One Family plan — every worked solution, all subjects

Example 2

hard
Minimize z=2x+5yz = 2x + 5y subject to x+2y6x + 2y \geq 6, x+y4x + y \geq 4, x0x \geq 0, y0y \geq 0.

Example 3

medium
Maximize P=5x+6yP = 5x + 6y subject to x+y8x + y \le 8, 2x+y122x + y \le 12, x,y0x, y \ge 0.

Example 4

medium
Find the feasible vertex of x+y6x+y\le 6 and 2x+y82x+y\le 8 in the first quadrant where the two lines meet.

Example 5

hard
A farmer plants wheat (xx acres, $200\$200 profit/acre) and corn (yy acres, $300\$300 profit/acre). Wheat needs 11 hour labor/acre; corn needs 22 hours. Total land 50\le 50 acres; labor 80\le 80 hours. Find the best mix.

Example 6

hard
Show that if the objective is parallel to a binding constraint, there can be infinitely many optimal solutions.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
A feasible region has vertices at (0,0)(0,0), (5,0)(5,0), (3,4)(3,4), (0,6)(0,6). Maximize z=x+2yz = x + 2y.

Example 2

medium
A company makes chairs ($40\$40 profit) and tables ($70\$70 profit). Each chair takes 2 hours, each table takes 5 hours. With 40 hours available, maximize profit.

Example 3

easy
Evaluate the objective P=3x+2yP = 3x + 2y at the corner point (2,1)(2, 1).

Example 4

easy
Does the point (1,1)(1, 1) satisfy the constraint x+y5x + y \le 5?

Example 5

easy
Is (6,0)(6, 0) feasible under x+y5x + y \le 5 with x,y0x,y \ge 0?

Example 6

easy
At which of (0,0)(0,0) and (3,3)(3,3) is P=x+yP = x + y larger?

Example 7

easy
State the non-negativity constraints for a problem producing xx chairs and yy tables.

Example 8

easy
Write a constraint: a worker has at most 88 hours, using 22 hours per unit of xx.

Example 9

easy
A constraint says production must be at least 1010 units of xx. Write it.

Example 10

easy
How many corner points does a triangular feasible region have to check?

Example 11

medium
Maximize P=2x+3yP = 2x + 3y over corners (0,0)(0,0), (4,0)(4,0), (0,3)(0,3), (2,2)(2,2).

Example 12

medium
Minimize C=x+2yC = x + 2y over corners (1,4)(1,4), (3,1)(3,1), (5,2)(5,2).

Example 13

medium
Find the intersection of x+y=4x + y = 4 and xy=2x - y = 2 (a corner point).

Example 14

medium
A shop profits $4\$4 per xx and $5\$5 per yy. Write the objective to maximize.

Example 15

medium
Region: x0x \ge 0, y0y \ge 0, x+y6x + y \le 6. Maximize P=x+yP = x + y.

Example 16

medium
Is the feasible region for x0x \ge 0, y0y \ge 0, x+y2x + y \ge 2 bounded or unbounded?

Example 17

medium
Maximize P=5x+4yP = 5x + 4y subject to x4x \le 4, y3y \le 3, x,y0x,y \ge 0.

Example 18

medium
A constraint 2x+3y122x + 3y \le 12 meets the xx-axis where?

Example 19

challenge
Maximize P=3x+4yP = 3x + 4y over x+y4x+y\le 4, x+3y6x+3y\le 6, x,y0x,y\ge0. Find the optimum.

Example 20

challenge
A factory makes x,yx,y with profit P=40x+30yP=40x+30y, limits x+y8x+y\le 8 (labor), 2x+y102x+y\le 10 (material), x,y0x,y\ge0. Maximize.

Example 21

challenge
Why must the optimum of a linear objective on a bounded polygon occur at a vertex?

Example 22

medium
Maximize P=x+2yP = x + 2y over corners (0,0)(0,0), (0,5)(0,5), (4,3)(4,3), (6,0)(6,0).

Example 23

easy
Evaluate P=4x+3yP = 4x + 3y at the corner (2,5)(2, 5).

Example 24

easy
Is (3,4)(3, 4) feasible for x+2y12x + 2y \le 12, x,y0x,y\ge 0?

Example 25

easy
Find the corner of the region x0x \ge 0, y0y\ge 0, x+y10x + y \le 10 that maximizes P=2x+5yP = 2x + 5y.

Example 26

easy
Find where 3x+4y=243x + 4y = 24 crosses the yy-axis.

Example 27

easy
Minimize C=x+yC = x + y over corners (0,2)(0,2), (3,0)(3,0), (2,1)(2,1).

Example 28

medium
Find the intersection of 2x+y=102x + y = 10 and x+y=6x + y = 6.

Example 29

medium
A bakery makes muffins ($2\$2 profit each) and scones ($3\$3 profit each). Each muffin uses 11 oz of butter; each scone uses 22 oz. They have 2020 oz of butter and want at most 1515 items total. Write the LP.

Example 30

medium
Maximize P=2x+3yP = 2x + 3y subject to x+2y20x + 2y\le 20, x+y15x + y \le 15, x,y0x,y\ge 0.

Example 31

medium
Minimize C=3x+2yC = 3x + 2y subject to x+y5x+y\ge 5, 2x+y82x+y\ge 8, x,y0x,y\ge 0.

Example 32

medium
Maximize P=6x+4yP = 6x + 4y subject to x+y10x + y \le 10, 2x+3y242x + 3y \le 24, x,y0x,y\ge 0.

Example 33

medium
Maximize P=x+yP = x + y over the region x+y4x+y \le 4, x,y0x,y \ge 0.

Example 34

medium
Find where 4x+3y=244x + 3y = 24 meets the xx-axis.

Example 35

medium
Is (5,4)(5, 4) feasible for 3x+2y253x + 2y\le 25, x+4y20x + 4y \le 20, x,y0x, y\ge 0?

Example 36

medium
At which corner is P=4x+yP = 4x + y maximized over (0,0)(0,0), (5,0)(5,0), (3,4)(3,4), (0,6)(0,6)?

Example 37

hard
Maximize P=7x+9yP = 7x + 9y subject to x+y6x+y\le 6, 3x+y123x+y\le 12, x+2y10x+2y\le 10, x,y0x,y\ge 0.

Example 38

hard
A diet problem: each unit of food A costs $3\$3 and provides 44 g of protein and 11 g of fat; each unit of food B costs $2\$2 and provides 22 g of protein and 11 g of fat. Need at least 2020 g protein and at most 88 g fat. Minimize cost.

Example 39

hard
Maximize P=3x+5yP = 3x + 5y on the region x+y4x+y\le 4, 2x+y62x+y\le 6, x,y0x,y\ge 0.

Example 40

challenge
A factory produces three products with profits $10,$12,$15\$10, \$12, \$15 per unit and machine-hour costs 1,2,31, 2, 3 hours per unit. With 2424 machine-hours available and a demand cap of 1010 units per product, but no constraint linking products, what is the best single-product plan?

Example 41

challenge
Minimize C=4x+5yC = 4x + 5y subject to x+y6x + y \ge 6, x+3y9x + 3y \ge 9, x,y0x, y\ge 0.

Background Knowledge

These ideas may be useful before you work through the harder examples.

inequalitiessystems of equationsconstraint system