Chapter 7 Linear Programming
Chapter 7 Linear Programming
7
LINEAR
PROGRAMMING
SIA
AY
AL
M
AN
IK
ID
ND
PE
AN
RI
TE
List of Learning
Standards
[Link]/3gVApUc
232
Info Corner
SIA
Food truck business is increasingly
programming problems.
popular in Malaysia. Adnan plans to
start a food truck business. Based on
AY
the results of his survey, Adnan found
that food truck business is very viable For more info:
AL
at residential areas and at locations
around the cities where people work
M
late into the night. His business plan
takes into consideration [Link]/3hZI2KW
his capital, the amount of food
AN
required and the operating time.
He also wants to provide online
food catering services. His survey
also involves artificial intelligence
IK Significance of the Chapter
ID
in developing his business.
Can he be certain that he will get Linear programming is used widely
ND
Key words
KE
[Link]/2YQ1Kjo
233
7.1 Linear Programming Model
SIA
problems, namely
graphical method,
1. Identify the decision 2. Identify the objective simplex method, M
variables function
AY
method and two-phase
method. The most
Decision variables describe common method used
An objective function is a
AL
the decisions that need to be is graphical method.
made and can be represented function that needs to be
Scan the QR code for
by x and y. maximised or minimised.
M
information on
other methods.
AN
3. Identify the constraints IK
Present the existing constraints in the form of equations or [Link]/2FNCVPP
linear inequalities, which use symbols like =, ,, <, . and/or >.
ID
Constraints must be in terms of the decision variables.
ND
What is the most suitable method to solve a linear programming problem that has only
two decision variables?
PE
AN
You have learnt linear inequalities in one and two variables. How do you present inequality
TE
y , 4 or x > 2 graphically? Diagram 7.1 and Diagram 7.2 show the inequality graphs for
y , 4 and x > 2 respectively.
EN
y
y
4
M
4 x>2
y<4 2
2
KE
x
x 0 2 4 6
–4 –2 0 2 4 –2
–2
Diagram 7.1 Diagram 7.2
A mathematical model consisting of constraints or objective functions can be obtained
from the situation or problem given. Can the mathematical model be illustrated graphically
especially in the form of a graph? Let's explore this together.
234 7.1.1
Linear Programming
SIA
taking into account all the constraints found.
4. Using GeoGebra software, draw a graph for the linear inequality.
AY
5. Make a conclusion about the position of the shaded region and the type of lines for
the graph.
AL
From Discovery Activity 1, it is found that a mathematical DISCUSSION
M
model can be formulated by using the variables x and y with the
constraints in each situation being <, >, , or .. The region which satisfies
AN
the inequality
The region above the straight line ax + by = c satisfies 10x – 15y < 100 is below the
the inequalities ax + by > c and ax + by . c while the region straight line
IK
below the straight line ax + by = c satisfies the inequalities
ax + by < c and ax + by , c, where b . 0.
10x – 15y = 100. Is this
statement true? Discuss.
ID
The region on the right side of the line ax = c satisfies the inequalities ax > c and ax . c
ND
whereas the region on the left side of the line satisfies the inequalities ax < c and ax , c. R
PTE
In general, if a mathematical model involves signs like:
7
CHA
PE
Example 1
TE
(b) A hawker sells spinach and mustard leaves. The selling prices of 1 kg of spinach and
1 kg of mustard leaves are RM3.50 and RM4.50 respectively. The total sales of the
M
Solution
(a) Suppose x and y are the width and length of the rectangular x
photo frame.
Then, 2x + 2y , 180.
(b) Suppose x and y are the number of kilograms of spinach and mustard
leaves sold in a day respectively. Then, 3.50x + 4.50y > 350.
7.1.1 235
Example 2
Present the following inequalities graphically.
(a) x – 2y > − 4 (b) 5y – 5x , 25
Solution
(a) Given x – 2y > − 4 (b) Given 5y – 5x , 25
Since b = –2 (, 0) Since b = 5 (. 0)
Hence, the region lies below the line Hence, the region lies below the line
x – 2y = − 4. 5y – 5x = 25.
SIA
y y
4 10
AY
x – 2y > –4 5y – 5x < 25
2 5
AL
x x
–6 –4 –2 0 2 4 –10 –5 0 5 10
–2 –5
M
AN
Example 3
IK
Mr Andy plans to build two types of houses, A and B on a plot of land measuring 10 000 m2.
After making a survey, he found out that one unit of house A requires 100 m2 of land and one
ID
unit of house B requires 75 m2. Mr Andy has a limited land, so the number of houses to be
built is at least 200.
ND
(b) Constraint I: 100x + 75y < 10 000 100(100) + 75(200) < 10 000
Constraint II: x + y > 200 25 000 < 10 000 (False)
EN
236 7.1.1
Linear Programming
SIA
2
AY
Discovery Activity Group 21st cl
Aim: To explore how to optimise the objective function
AL
Steps:
M
1. Scan the QR code on the right or visit the link below it.
[Link]/ket9dk6r
2. Drag the slider P left and right. Note the changes that occur on the
AN
line d when P moves.
3. Then determine the maximum value in the region.
IK
4. It is given that the objective function is P = 60x + 90y. In your respective groups, discuss
how to find the maximum value of P in a given region defined by the mathematical model
ID
with the following constraints.
I: x + y < 320 II: x + 2y < 600 III: 5x + 2y < 1 000
ND
R
5. Present your group's findings to the class and also discuss with other groups. PTE
CHA
PE
From Discovery Activity 2, it is found that the optimum value of the objective function can be
obtained by moving the objective function line parallel to itself towards and into the region that
AN
satisfies all the constraints. The optimum value is obtained by substituting the coordinates of
the maximum point in the region into the objective function.
RI
TE
Example 4
EN
7.1.1 237
Solution
Given k = x + 2y.
(a) Let k = 4, then x + 2y = 4. Excellent Tip
y Steps to determine the
80 suitable value of k for
k = ax + by:
60 1. Note that a and b are
(15, 55)
coefficients of x and y
respectively.
40
SIA
2. Find the common
(47, 23) multiples of a and b.
20
3. Take k as the common
AY
x + 2y = 4 (15, 8) multiple.
0 x
20 40 60 80
AL
(b) (i) Substitute the maximum point for the shaded region,
which is (15, 55) into k = x + 2y.
M
k = 15 + 2(55)
k = 125
AN
Therefore, the maximum value of k is 125.
(ii) Substitute the minimum point for the shaded region,
which is (15, 8) into k = x + 2y.
IK
k = 15 + 2(8)
ID
k = 31
Therefore, the minimum value of k is 31.
ND
Self-Exercise 7.1
PE
3. Consider the situation below. Then answer each of the following questions.
M
Xin Tian wants to plant banana and papaya trees on a large plot of land of 80 hectares.
He hires 360 workers with a capital of at least RM24 000. He uses x hectares of land
KE
to plant banana trees and y hectares of land to plant papaya trees. Every hectare planted
with banana trees will be supervised by 3 workers while 6 workers will supervise every
hectare of papaya trees. The cost to maintain the banana trees is RM800 per hectare
while to maintain a hectare of papaya trees is RM300.
(a) Identify the constraints in the above problem.
(b) Form a mathematical model related to the problem above.
(c) Represent each mathematical model obtained in (b) graphically.
238 7.1.1
Linear Programming
SIA
0 x
5 10 15 20
AY
AL
7.1
M
Formative Exercise Quiz [Link]/34MIF53
AN
1. Write an inequality that describes each of the following shaded regions.
(a) (b)
IK
y y
ID
4 4
2 2
ND
R
x x PTE
–6 –4 –2 0
7
2 4 6 –6 –4 –2 0 2 4 6
CHA
–2 –2
PE
–4 –4
AN
2. A college offers two academic courses, P and Q. Admission to the college for these
courses is based on the following constraints.
RI
students in course P.
III The number of students in course Q exceeds the number of students in course P by at
EN
students taking course P and y represents the number of students taking course Q.
KE
3. Madam Laili receives a monthly salary of RM3 000. She spends RMx on transport and
RMy on food. The monthly expenses on food is at most three times the monthly expenses
on transport. The monthly food expenses is at least RM50 more than the monthly
expenses on transport. The total monthly expenses on transport and food do not exceed
one-third of her monthly salary. Write a mathematical model based on this situation.
7.1.1 239
7.2 Linear Programming Applications
SIA
we can interpret a problem in terms of its variables. A
system of inequalities or linear equations involving those
variables can be formed based on the existing conditions
AY
or constraints.
AL
Solving problems involving linear programming graphically
M
Linear programming problems can be solved by drawing graphs of all the related linear
AN
equations according to the following steps.
the constraints is an
known as a feasible solution.
infeasible value.
TE
EN
Example 5
M
A trader wants to arrange x bouquet of roses and y bouquet of orchids. The time taken to
KE
arrange a bouquet of roses is 20 minutes while a bouquet of orchids takes 30 minutes. The
process of arranging the bouquet of flowers must be based on the following constraints.
I The number of bouquet of orchids must not be more than twice the number of bouquet
of roses.
II The number of bouquet of orchids must be at least 1 of the number of bouquet of roses.
4
240 7.2.1
Linear Programming
SIA
number of bouquet of roses is 30, 20
(ii) the maximum profit of the trader if the profits
for each bouquet of roses and each bouquet of 10
AY
orchids are RM35 and RM25 respectively.
0 x
10 20 30 40
AL
Solution
(a) Constraint I: y < 2x
M
Constraint II: y > 1 x Information Corner
4
AN
(b) Consider the points (0, 60) and (40, 0). Maximum or optimum
points are points at
The gradient of the straight line, m = 60 – 0 = – 3
IK the vertices of a feasible
0 – 40 2 region that can give the
The equation of the straight line,
ID
optimum value of the
y – 0 = – 3 (x – 40)
objective function.
2
ND
2y + 3x = 120 PTE
R
CHA
PE
Therefore, the total time taken to arrange the bouquet of flowers is at least 2 hours.
(c) y (i) Substitute x = 30 into y = 1 x,
4
AN
y = 1 (30)
60 4
y = 7.5
RI
y = 2x
50 Therefore, the minimum number of
TE
bouquet of orchids is 8.
40 (ii) The maximum point in the shaded region
EN
20
y = 1– x k = 35x + 25y,
4
KE
R
10 k = 35(18) + 25(33)
k = 630 + 825
0
10 20 30 40
x k = 1 455
Therefore, the maximum profit made by
the trader is RM1 455.
7.2.1 241
Example 6 MATHEMATICAL APPLICATIONS
A school wants to buy two types of tables, P and Q to
equip a computer lab. The prices for a table P and a Excellent Tip
table Q are RM200 and RM100 respectively. The surface Problems in a situation can
area of table P is 1 m2 while that of table Q is 2 m2. The be simplif ied into tabular
school intends to buy x units of table P and y units of form. Based on Example 6,
table Q. The purchase of the tables will be based on the the problem in the situation
following constraints. can be simplif ied as follows:
I The total surface area of the tables is not less than 30 m . 2
Table P Table Q
SIA
II The amount allocated is RM6 000. Price RM200 RM100
III The number of table Q is at most twice that of table P.
Area 1 m2 2 m2
AY
(a) Other than x > 0 and y > 0, write three linear
inequalities that satisfy all the above constraints.
(b) Using a scale of 2 cm to 10 tables on both the x-axis and
AL
the y-axis, construct and label the R region that satisfies
all of the above constraints.
M
(c) Based on the graph drawn in (b), find
(i) the range for the number of tables P if the number of tables Q purchased is 10,
AN
(ii) the maximum number of pupils who can use the tables at a time if a table P can
accommodate 4 pupils and a table Q can accommodate 8 pupils.
IK
Solution
ID
ND
the variables.
The total allocation is RM6 000. 2. Define a mathematical
The total surface area of the tables is not less model in terms of
RI
inequalities.
3. Draw graphs and
of table P. determine the feasible
EN
region, R.
4. Write the objective
M
242 7.2.1
Linear Programming
SIA
40
Therefore, the three linear inequalities
that satisfy all the constraints are 30
AY
x + 2y > 30, 2x + y < 60 and y < 2x.
20
AL
R
10
M
x + 2y = 30
0 x
10 20 30
AN
(c) (i) Given that the number of table Q to be
purchased is 10. Then, draw a straight y
line y = 10.
IK
From the graph, the straight line y = 10 60
ID
intersects the region with the minimum value 2x + y = 60
of x = 10 and the maximum value of x = 25. 50
ND
R
Therefore, the range of the number of y = 2x PTE
7
table P is 10 < x < 25. 40
CHA
PE
20
From the graph, it is found that the
R
straight line passes through the optimum 10
RI
0 x
10 20 30
= 4(15) +8(30)
= 300
EN
M
Take any point in the shaded region, for example (20, 20).
Substitute this point (20, 20) into the function k.
k = 4(20) + 8(20)
k = 240 (, 300)
7.2.1 243
Self-Exercise 7.2
1. An institution offers two business courses, namely Management and Finance Courses. The
number of students in the Management Course is x and the number of students in the Finance
Course is y. The enrolment of these students is based on the following constraints.
I The total number of students in the Management and Finance Courses does not exceed
80 people.
II The number of students in the Finance Course does not exceed four times the number
of students in the Management Course.
III The number of Finance Course students must exceed the number of Management
SIA
Course students by at least 10 people.
(a) Other than x > 0 and y > 0, write three linear inequalities that satisfy all constraints above.
AY
(b) Using a scale of 2 cm to 10 students on both axes, construct and label the region R that
satisfies all of the above constraints.
AL
(c) By using the graph in (b), find
(i) the range for the number of students in the Finance Course if the number of
M
students in the Management Course is 20 people,
(ii) the maximum total of weekly fees that can be collected if the fees per week from
AN
the Management and Finance Courses students are RM60 and RM70 respectively.
Vase
Machine P Machine Q
A 40 30
PE
B 20 60
AN
(a) Other than x > 0 and y > 0, write three inequalities that satisfy all constraints above.
(b) Using a scale of 2 cm to 10 units on both axes, construct and label the region R that
M
(i) the minimum number of vase B produced if the factory intends to produce only
30 units of vase A,
(ii) the maximum profit per week if the profits from one unit of vase A and one unit of
vase B are RM300 and RM250 respectively.
244 7.2.1
Linear Programming
1. A gardener wants to plant hibiscus and roses on his plot of land of 300 m2. He has at least
RM1 000 to buy the plants. A hibiscus plant costs RM4 and it requires a land area of 0.4 m2
while a rose plant costs RM5 and it requires a land area of 0.3 m2. The number of roses must
exceed the number of hibiscus by at most 200.
(a) Other than x > 0 and y > 0, write three inequalities that satisfy all of the above
SIA
constraints, if x represents the number of hibiscus plants and y represents the number of
rose plants.
(b) Using a scale of 2 cm to 100 trees on the x-axis and the y-axis, draw and label the region
AY
R that satisfies all the inequalities in (a).
(c) From the graph obtained in (b), answer each of the following questions.
AL
(i) Find the maximum number of rose plants if the number of hibiscus plants is 300.
(ii) Within a given period, each hibiscus and rose plant generates a profit of RM3.50
M
and RM2.40 respectively. Find the maximum profit of the gardener.
2. Mr Malik allocates RM3 000 to purchase x copies of science reference books and y copies
AN
of mathematics reference books for the school library. The average costs per copy of
science reference books and mathematics reference books are RM30 and RM25
IK
respectively. The number of science reference books purchased is at least 20 copies and
the number of mathematics reference books purchased is at least 10 copies more than the
ID
science reference books.
ND
(a) Write down three linear inequalities that satisfy all the given conditions other than R
PTE
x > 0 and y > 0.
7
CHA
(b) Using a scale of 2 cm to 20 copies of books on both axes, construct and label the
PE
II The volume of beverage Q produced is not more than twice the volume of
beverage P produced.
EN
constraints above.
KE
(b) Using a scale of 1 cm to 1 000 litres on the x-axis and the y-axis, construct and label
the region R that satisfies all the above constraints.
(c) Based on the graph obtained in (b), answer each of the following questions.
(i) On a given day, the volume of beverage Q produced is 2 000 litres. Find the
maximum volume of beverage P produced.
(ii) If the profits per litre of beverage P and Q are RM50 and RM30 respectively, find
the maximum total profit of the factory.
245
REFLECTION CORNER
LINEAR PROGRAMMING
SIA
Given a straight line ax + by = c, Steps to solve a linear programming
where b . 0: problem:
AY
• Region above the straight line 1. Represent all the constraints for the
satisfies the inequalities situation in linear inequalities.
AL
ax + by > c and ax + by . c. 2. Draw a graph for each linear inequality
• Region below the straight line and shade the feasible region.
M
satisfies the inequalities 3. Define the objective function
ax + by < c and ax + by , c. ax + by = k and draw a graph for that
AN
objective function.
4. Determine the optimal value (maximum
IK
or minimum value) by substituting the
coordinates of the maximum point or
ID
Applications the minimum point into the objective
function.
ND
PE
Journal Writing
AN
RI
R
150
100
50
0 x
50 100 150 200 250 300 350 400
246
Linear Programming
Summative Exercise
1. A family in a village produces two types of rattan chairs, namely small rattan chairs and big
rattan chairs. The family is able to get at least 60 kg of rattan a week as the raw material.
A small rattan chair requires 3 kg of rattan while a big rattan chair requires 5 kg of rattan.
There are 60 workers. Two workers are required to produce one small rattan chair while
three workers are required to produce one big rattan chair. PL 4
(a) If x number of small rattan chairs and y number of big rattan chairs are produced in a
week, write four linear inequalities that satisfy the above conditions.
SIA
(b) Using a scale of 2 cm to 5 rattan chairs on both axes, construct and label the region R that
satisfies all the linear inequalities.
AY
(c) The price for a small rattan chair is RM40 and the price for a big rattan chair is RM80.
From the graph obtained in (b), find
AL
(i) the values of x and y that will provide the family with a maximum income,
(ii) the maximum income.
M
2. A baker takes 2.5 hours to bake an orange cake and 3 hours to bake a strawberry cake. The
AN
costs of making an orange cake and a strawberry cake are RM15 and RM20 respectively.
In a week, the baker can bake x orange cakes and y strawberry cakes based on the
following conditions. PL 5
I The baker works at least 30 hours a week.
IK
ID
II The total cost of baking both cakes is not more than RM300 a week.
III The number of orange cakes is not more than twice the number of strawberry cakes.
ND
(a) Write three linear inequalities, other than x > 0 and y > 0, that satisfy all the PTE
R
7
constraints above.
CHA
(b) Using a 2 cm scale to represent 2 cakes on both axes, construct and label the region R
PE
profits from an orange cake and a strawberry cake are RM17 and RM20 respectively.
RI
3. A post office wants to send 600 parcels to city M using x lorries and y vans. The
transportation for the parcels are subjected to the following constraints. PL 5
TE
I A lorry can carry 120 parcels while a van can carry 50 parcels.
II The number of vans used is not more than three times the number of lorries used.
EN
constraints above.
KE
(b) Using a 2 cm scale to a lorry on the x-axis and 2 cm to two vans on the y-axis,
construct and label the region R that satisfies all the above constraints.
(c) Using the graph obtained in (b), find
(i) the range of the number of lorries if 2 vans are used,
(ii) the maximum cost incurred if the costs of transportation by a lorry and a van
are RM150 and RM100 respectively.
247
4. Setia Indah Secondary School will host a motivational camp. Participants of the camp are
made up of x female pupils and y male pupils. The fee for a female pupil is RM100 and the
fee for a male pupil is RM120. The number of pupils in the camp is based on the following
constraints. PL 5
I The maximum number of pupils attending the camp is 80.
II The ratio of the number of female pupils to male pupils is at least 1 : 3.
III The total fees collected is not less than RM5 000.
(a) Write three linear inequalities that satisfy all the above constraints other than x > 0
and y > 0.
(b) Using a 2 cm scale for 10 pupils on the x-axis and the y-axis, construct and label the
SIA
region R that satisfies all the above constraints.
(c) Using the graph obtained in (b), find
AY
(i) the minimum number of male pupils if the ratio of the number of female to male
pupils is 1 : 3,
AL
(ii) the maximum profit obtained if the school takes 25% of the total fees collected.
M
cupboard A and cupboard B. Each cupboard requires
two types of raw materials P and Q. The amount of
AN
each raw material needed to produce each unit of
cupboard A and cupboard B are shown in the IK
table below. PL 6
ID
Number of raw material
Cupboard
ND
P Q Cupboard A
A 2 3
PE
B 5 2
Cupboard B
The amount of raw materials P and Q available to the factory are
AN
(a) Write three linear inequalities, other than x > 0 and y > 0, which satisfy all the
constraints above.
EN
(b) Using a scale of 2 cm to 2 units on the x-axis and 2 cm to 1 unit on the y-axis,
construct and label the region R that satisfies all the above constraints.
M
(i) the maximum number of cupboard B produced if the factory produces 4 units of
cupboard A,
(ii) the maximum profit earned by the factory if the profit from one unit of cupboard A
is RM200 and one unit of cupboard B is RM250.
248
Linear Programming
MATHEMATICAL EXPLORATION
(a) In your group, discuss the following situation using Hot Seat activity. It is given that the
region on one side of a straight line ax + by = c. If b , 0, which region satisfies ax + by > 0?
(b) A school is given an allocation to purchase type A
computers and type B computers for its computer
lab. The purchase of the computers is based on Information Corner
the conditions represented on the region R in the
diagram below. The total number of computers Learning steps of Hot Seat
purchased is at least 6 units. activity.
SIA
1. An expert pupil will sit on
y a chair.
2. Pupils in groups will ask
AY
questions related to the
14
problem.
AL
y=x 3. The expert pupil will
12
answer all the questions.
4. Each group will make
M
10 x=8
conclusions for all
the problems.
8
AN
6 x+y=6
4
IK
ID
R
2
ND
R
0 x PTE
7
2 4 6 8 10 12 14
CHA
PE
(i) State what are represented by the x-axis and the y-axis.
(ii) Besides the numbers of type A computers or type B computers being greater than
AN
(iv) If the costs of one type A computer and one type B computer are RM1 500
and RM2 000 respectively, find the maximum allocation required by
TE
that school.
EN
M
KE
249