 # How to Use the Ruler Method for Linear Optimization

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

Rule

### TheRulerMethod

1.
Set up inequalities based on the text. We’ll be talking about a number of units, so it’s natural to say that $x\ge 0$ and $y\ge 0$, because it’s impossible to produce a negative number of units.
2.
Solve the inequalities you found for $y$, so that they look like functions $y\left(x\right)$.
3.
Draw the graphs of these functions in a coordinate system. Because $x\ge 0$ and $y\ge 0$, you only need to graph within the first quadrant.
4.
Mark the area that is surrounded by the graphs!
5.
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\left(x,y\right)=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\left(x,y\right)$ with a constant, $K$. Solve the equation for $y$ so that you have a linear function you can move around: $\begin{array}{llll}\hfill Z\left(x,y\right)& =Ax+By\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill K& =Ax+By\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill K-Ax& =By\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill By& =K-Ax\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y& =\frac{K}{B}-\frac{A}{B}x\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y& =-\frac{A}{B}x+\frac{K}{B}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

The only thing that matters here is the slope of the function, $-\frac{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.

6.
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.
7.
Read off the coordinates of this point. This is the optimal point
8.
Find the profit/income by inserting the coordinates of the optimal point into $Z\left(x,y\right)$.

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 $\text{}\text{}295\text{}$, while a skirt is sold for $\text{}\text{}450\text{}$. 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\ge 0$
• The number of skirts you produce can be no skirts, or more. That gives you

 $y\ge 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\le 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\le 300$

You end up with this system of inequalities: $\begin{array}{lll}\hfill x& \ge 0\phantom{\rule{2em}{0ex}}& \hfill \text{(1)}\phantom{\rule{0.33em}{0ex}}\\ \hfill y& \ge 0\phantom{\rule{2em}{0ex}}& \hfill \text{(2)}\phantom{\rule{0.33em}{0ex}}\\ \hfill 2x+y& \le 200\phantom{\rule{2em}{0ex}}& \hfill \text{(3)}\phantom{\rule{0.33em}{0ex}}\\ \hfill x+3y& \le 300\phantom{\rule{2em}{0ex}}& \hfill \text{(4)}\phantom{\rule{0.33em}{0ex}}\end{array}$

### Item 2

Now you need solve the inequalities with respect to $y$. First, inequality (3): $\begin{array}{llll}\hfill 2x+y& \le 200\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y& \le 200-2x\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

Inequality (4): $\begin{array}{llll}\hfill x+3y& \le 300\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill 3y& \le 300-x\phantom{\rule{1em}{0ex}}|÷3\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y& \le 100-\frac{1}{3}x\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

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:  ### 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\left(x,y\right)=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 $\begin{array}{llll}\hfill Z\left(x,y\right)& =295x+450y\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill K& =295x+450y\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill 450y& =K-295x\phantom{\rule{2em}{0ex}}|÷450\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y& =\frac{K}{450}-\frac{295}{450}x\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\\ \hfill y& \approx -0.66x-\frac{K}{450}\phantom{\rule{2em}{0ex}}& \hfill & \phantom{\rule{2em}{0ex}}\end{array}$

### 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:  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.  ### Item 7

You read off the coordinates of the point and find that $B=\phantom{\rule{-0.17em}{0ex}}\left(60,80\right)$. 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\left(60,80\right)=295\cdot 60+450\cdot 80=53\phantom{\rule{0.17em}{0ex}}700$

The factory earns \$$53\phantom{\rule{0.17em}{0ex}}700$ 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.