Middle Years

# 13.02 Constraints and objective functions

Lesson

As we saw in the previous lesson, many real-world problems involve constraints on a set of resources. These constraints give us a set of possible combinations for the resources, which we call the feasible region.

Any one of these combinations may be viable, but we often consider things like cost of production, or profit to inform us of which exact combination(s) are most suitable to either reduce the cost, or to maximise the profit.

An objective function is a function of the constraint variables, and typically indicates a cost or profit. For instance, let $x$x and $y$y indicate the amount of flour and sugar in kilograms respectively. If flour costs $\$1.05$$1.05 per kg, and sugar costs \1.65$$1.65 per kg, then the cost, $z$z, of the ingredients is:

$z=1.05x+1.65y$z=1.05x+1.65y

Linear programming problems involve maximising or minimising an objective function over the feasible region. This section investigates only identifying the objective function.

#### Worked example

##### Example 1

Define the constraints and objective function for the following problem:

A recycling company that has two types of waste bins available for purchase. The Bin-it bin costs $\$100$$100 each, the Fill-it-up bin costs twice as much, and the total available for purchases is \1400$$1400.

The Bin-it bins take up $6$6 m2 of factory yard space and can hold $8$8 m3 of recyclable waste. The more expensive bins take up $8$8 m2 of space but can hold $12$12 m3 of waste. The yard is fairly small, confined to $72$72 m2 of useable area.

Think: We are given three types of information:

1. the cost of each type of waste bin.
2. the factory yard space of each type of waste bin.
3. the volume of waste of each type of waste bin.

Note that each scenario has the 'type of waste bins' in common. Therefore, we first want to identify these constraint variables.

So let $x$x be the number of Bin-it bins, and $y$y be the number of Fill-it-up bins.

Then using the available budget, and space, we want to identify a set of inequalities that describe the constraints. From there we want to construct an objective function, one that gives the total waste storage (in cubic metres) in terms of $x$x and $y$y.

It is often helpful to group the given information into relevant categories:

 Type of waste bin Variable Cost $(\$)$($) Yard space ( m2 ) Volume of waste ( m3 ) Bin-It $x$x $100$100 $6$6 $8$8 Fill-it-up $y$y $200$200 $8$8 $12$12 Totals $\le$≤ $1400$1400 $\le$≤ $72$72 $?$?

Do: We can now form our inequalities.

To buy $x$x Bin-it bins, the cost would be $\$100x$$100x, and to buy yy Fill-it-up bins the cost would be \200y$$200y. The total cost of $x$x Bin-it bins and $y$y Fill-it-up bins would be the sum $100x+200y$100x+200y, and this must not exceed our limit of $\$1400$$1400. So the first constraint is given by 100x+200y\le1400100x+200y1400. Secondly, yard space is limited. Buying xx Bin-it bins will take up 6x6x m2 of yard space and yy Fill-it-up bins will take up 8y8y m2 of yard space with a maximum space of 7272 m2. Another constraint is given by 6x+8y\le726x+8y72. Finally, the quantities xx and yy cannot be negative numbers. We can write these constraints as x\ge0x0 and y\ge0y0. These last constraints are not contained in the problem explicitly, but they should be included when considering realistic solutions. So in summary the constraints are listed in the table:  100x+200y\le1400100x+200y≤1400 (1) 6x+8y\le726x+8y≤72 (2) x\ge0x≥0 (3) y\ge0y≥0 (4) The problem also asks for an objective function, one that describes the total waste storage. If we call the total storage SS, then since xx Bin-it bins store 8x8x m3, and yy Fill-it-up bins store 12y12y m3, then we can write: S=8x+12yS=8x+12y Reflect: It would be ideal to find the values of xx and yy that maximise the value of the storage space SS, but still satisfies the constraints. This is called a linear programming problem, and will be touched on in the following chapter. #### Practice questions ##### Question 1 A warehouse is stocked with two types of storage containers: square boxes and rectangular boxes. The square boxes cost \55$$55 each and have a volume of $2$2 m3 and the rectangular boxes cost $\$65$$65 each and have a volume of 77 m3. The warehouse has a total storage space of 200200 m3 and there is a budget of \800$$800 to purchase the containers.

1. Let $x$x represent the number of square boxes purchased, and $y$y represent the number of rectangular boxes purchased.

Fill in the gaps to complete the following constraint inequalities for $x$x and $y$y:

$x\ge\editable{}$x

$y\ge\editable{}$y

2. Write an inequality relating $x$x and $y$y to the total budget for the warehouse:

3. Finally, write an inequality relating $x$x and $y$y to the total storage space of the warehouse:

##### Question 2

Students have set up a Mother's Day stall and are selling two products: photo frames for $\$5$$5 and necklaces for \12$$12.

1. Write down an equation (the Objective Function) for the revenue earned, $R$R, made by selling the items at the stall.

Let $x$x represent the number of photo frames sold, and let $y$y represent the number of necklaces sold.

##### Question 3

Eileen is spending the week at a sports camp. She is able to attend coaching sessions for her two favourite sports: basketball and football.

She can attend a maximum of $26$26 sessions in the week, but she must attend at least $20$20 sessions.

Let $x$x represent the number of basketball sessions she attends, and $y$y represent the number of football sessions she attends.

1. Eileen's basketball coach has told her that she must attend at least $5$5 basketball sessions. Her football coach has told her that she must go to at least $8$8 more football sessions than basketball sessions.

From this information, complete the set of constraint inequalities below:

1. $x\ge\editable{}$x
2. $y\ge\editable{}+\editable{}$y+
3. $\editable{}+\editable{}\le26$+26
4. $\editable{}+\editable{}\ge20$+20
2. Which graph correctly shows the region defined by the 4 constraint inequalities?

A

B

C

D
3. The region of possible solutions from part (b) has been sketched more clearly below:

$\left(\editable{},\editable{}\right),\left(\editable{},\editable{}\right),\left(\editable{},\editable{}\right),\left(\editable{},\editable{}\right)$(,),(,),(,),(,)