Colorful House of Math logo
Log in

How to Use the Ruler Method for Linear Optimization

Here you’ll learn how to use the ruler method for linear optimization.


The Ruler Method

Set up inequalities based on the text. We’ll be talking about a number of units, so it’s natural to say that x 0 and y 0, because it’s impossible to produce a negative number of units.
Solve the inequalities you found for y, so that they look like functions y(x).
Draw the graphs of these functions in a coordinate system. Because x 0 and y 0, you only need to graph within the first quadrant.
Mark the area that is surrounded by the graphs!
Find the equation for the lines of the objective function. Use the objective function that denotes the thing you want to optimize: Profit, income, or something else.

The objective function can be found by summing the “price per unit” multiplied by the “number of units” for all the items you have. Then it looks like this:

Z(x,y) = Ax + By

where A is the price of an item that has sold x units and B is the price of an item that has sold y units.

You can swap Z(x,y) with a constant, K. Solve the equation for y so that you have a linear function you can move around: Z(x,y) = Ax + By K = Ax + By K Ax = By By = K Ax y = K B A Bx y = A Bx + K B

The only thing that matters here is the slope of the function, A B. The constant term changes all the time, because you change the value of K to move the line outwards in the coordinate system.

Draw the line for the objective function you found in the previous point so that it passes through the outermost point of the area surrounded by the graphs.
Read off the coordinates of this point. This is the optimal point
Find the profit/income by inserting the coordinates of the optimal point into Z(x,y).

Example 1

A factory that produces brands will make a shirt and a skirt for Tom Ford. Both pieces have to be made of cashmere and silk. To make a shirt, you need two lengths of cashmere and one length of silk. To make a skirt, you need one length of cashmere and three lengths of silk. The factory has 200 lengths of cashmere and 300 lengths of silk available. A shirt is sold for $295, while a skirt is sold for $450. How many shirts and skirts does the factory have to produce to maximize its income, and what is this income?

Item 1

First, you set up the constraints described in the text as inequalities. Let x be the number of shirts produced and y be the number of skirts produced. The cashmere and the silk has to be distributed between the shirts and skirts. That gives you these inequalities:

  • The number of shirts you produce can be no shirts, or more. This means that

    x 0
  • The number of skirts you produce can be no skirts, or more. That gives you

    y 0
  • Now you must construct an inequality for the available cashmere. You need two lengths for a shirt, and one length for a skirt. The roll has a total of 200 lengths. That results in

    2x + y 200
  • Next, you make an inequality for the available silk. You need one length for a shirt and three lengths for a skirt. The roll has 300 lengths of silk. That would be

    x + 3y 300

You end up with this system of inequalities: x 0 (1) y 0 (2) 2x + y 200 (3) x + 3y 300 (4)

Item 2

Now you need solve the inequalities with respect to y. First, inequality (3): 2x + y 200 y 200 2x

Inequality (4): x + 3y 300 3y 300 x| ÷ 3 y 100 1 3x

You don’t have to do anything with the other two inequalities.

Items 3 and 4

Graph the two inequalities in a coordinate system and mark the area where they overlap. You know that you only need the first quadrant because both x and y is greater than or equal to 0. That should give you this figure:

Example of linear optimization using ruler method 1

Example of linear optimization using ruler method 1

Item 5

Find the optimal point using this figure. You know that it is one of the points within the marked area where the graphs intersect, or where the graphs intersect the axes.

When you use the ruler method, you have to find the expression for the objective function Z(x,y) = Ax + By. You know that a shirt costs $295 and that a skirt costs $450. Insert these prices for A and B in the expression and solve for y. Then you get Z(x,y) = 295x + 450y K = 295x + 450y 450y = K 295x| ÷ 450 y = K 450 295 450x y 0.66x K 450

Item 6

Because the term with the constant term K in it isn’t important when you push the line outwards in the first quadrant, you can choose any value for it that you want. It’s smart to begin by picking a value on the y-axis that lies within the marked area. In the figure below, the constant term has been chosen to be 80. It looks like this:

Example of linear optimization using ruler method 2

Example of linear optimization using ruler method 2

Place your ruler on the black line (line: y = 0.66x + 80) and slide it along, parallel to the marked area. Eventually, you will end up in a situation where the edge of your ruler only hits the marked area at one point. This point will be an intersection between two graphs or a graph and an axis. This is the optimal point.

Example of linear optimization using ruler method 3

Example of linear optimization using ruler method 3

Item 7

You read off the coordinates of the point and find that B = (60, 80). That means the factory should produce 60 shirts and 80 skirts in order to maximize their income.

Item 8

You find the income of the factory at the optimal point by inserting the x-value and the y-value you found in Item 7 into the objective function. That means x = 60 and y = 80, and you get

Z(60, 80) = 295 60 + 450 80 = 53700

The factory earns $53700 by producing 60 shirts and 80 skirts. This is the optimal production, because it was the outermost point in the marked area that the line of the objective function intersected.

Want to know more?Sign UpIt's free!
White arrow pointing to the LeftPrevious entry
How to Use the Graphical Method for Linear Optimization