LINEAR PROGRAMMING
LINEAR PROGRAMMING
The word LINEAR indicates the relationship arising from the condition and is represented by
straight lines.
The relationships are in the form 𝑦 = 𝑚𝑥 + 𝑐
PROGRAMMING - indicates that decisions are made systematically.
NB:
The main function of linear programming is to either maximize or minimize a linear
function subject to a certain problem represented by linear equation.
Linear programming is more applicable in the field like production planning, distribution
of goods, economics and construction.
Linear functions are of the form 𝑦 = 𝑚𝑥 + 𝑐, for all real values of x, where m and c are
constants.
The word linear is used because the graph of a linear function is a straight line.
Expressed in terms of y, the equation of a linear function is written as 𝑦 = 𝑚𝑥 + 𝑐
EQUATIONS
TO FIND THE EQUATION FROM A GIVEN STRAIGHT LINE
First find the gradient and y – intercept of the equation of the line.
Solution
Here the y-intercept is at (0,2) so 𝑐 =
2.To calculate m: take any two points on
the line i.e (4, 6) and (2, 4)
𝑦 −𝑦 6−4
𝑚 = 𝑥2 −𝑥1 , so, 𝑚 = 4−2 = 1
2 1
INEQUALITIES OR INEQUATIONS
The types of the lines drawn depend on the inequality sign used.
Less than ‘<’ the line is broken or dotted
Greater than ‘>’ the line is broken or dotted
Less or equal ≤ the line is continuous or solid
Greater or equal ≥ the line is continuous or solids.
AT MOST means ‘Lessor Equal to’ (≤)
ALL MOST means ‘Less than’ (<)
AT LEAST means ‘greater or Equal to’ (≥)
NB:
When the line is dotted or broken, then it means points along the line are NOT part of the
solution set.
When the line is continuous or solid, then it means along the lines are part of the solution set.
Shade the unwanted region
Unshaded region is the wanted region
EXAMPLE
1. Solve the 3𝑥 − 1 < 2𝑥 + 5, 𝑥 ∈ 𝑅 and draw the graph of its solution set.
Solution
3𝑥 − 1 < 2𝑥 + 5
3𝑥 − 2𝑥 < 5 + 1
𝑥<6
2. Illustrate the solution sets of the following systems of inequations on a Cartesian diagram. Where
x, yR; y 5x + 1, y ≥ 5 –2x and y ≤ 7
solution
Consider the first equation: 𝑦 ≥ 5𝑥 + 1, such that, 𝑦 = 5𝑥 + 1 is a boundary line. That is – [ Pick
any suitable values of 𝑥 to find y ]
When x = 0, y = 1 (0, 1)
x = 1, y = 6 (1, 6)
[Plot the pairs of coordinates on the plane and connect them with a straight line
Do the same to the remaining inequations and form pairs of coordinates as above.
SOLUTION
For inequations
The UNSHADED region gives the solution set of all points (x, y) which satisfy the three
inequalities.
b. The solution sets lie in the unshaded region and that is where the integral points lie and these
points include.(0,1), (1,0), (1,1), (1,2), (2, -1), (2,0), (2,1), (2,2), (2,3).
NOTES:
The boundary line 𝑦 – 𝑥 = 1 is drawn solid or continuous to show that the sets of points on
the line are included in the solution set in the unshaded region or the required region.
The boundary lines 5𝑦 = −4𝑥 and 2𝑥 = 5 are drawn using broken lines to show that the
points on those lines are not included in the solution set in the unshaded region or the
required region.
Regions outside the boundaries are shaded to show that they are not required or not part of
the solution set.
Example
By shading the un wanted regions, on the same graph, draw the graphs of 4y –x < 4, x –y < 3
and x ≥ -2 and write down the integral values of x and y only.
HINTS:
Label the points with different letters for convenience or to avoid mistakes.
Pick any two points on each line. Find their respective gradients.
Use the y –intercept form, y = mx + c to find the equations of the lines.
Pick testing points for each line to identify the wanted and unwanted region.
EXAMPLE.
Write down the three inequalities which define the unshaded area labeled A.
LINE k.
K is the line x = 3.
K is solid.
Points to the right of k(shaded) are not required.
Hence the corresponding inequality is x ≤ 3
LINE m.
EXERCISE
Find,
a. The coordinates of the point P where the line 2𝑦 = 𝑥 + 8 crosses the y = axis.
b. The equation of the line which passes through the origin O and the point (-3, 6).
c. The three inequalities which define the triangular region R in the diagram
MATHEMATICAL MODELS.
A mathematical model is a system of inequations which are formed from the conditions in a problem.
EXAMPLES.1.
A hungry Mr. Chanda has a K 5, 000 to spend. He needs to buy two types of lolly pops, A and B. Type A
costs K 500 per unit and type B costs K 800 per unit. He intends to buy not more than three lolly pops of
type A and at least one of type B. Let the number of lolly pops of type A be x and the number of lolly
pops of type B be y. Write down the inequations arising from the given information or form four
mathematical models to illustrate this information.
SOLUTIONS.
HINTS:
These four (4) mathematical models can now be solved to find how many lolly pops of each type Mr.
Chanda bought.
1. Mrs. Chilala wants to bake two types of cakes for the visiting Republican President of Zambia
using the available ingredients. One kind of cake requires 200g of flour and 25g of fat, and
another kind of cake requires100g of flour and 50g of fat. Suppose she wants to make as many
cakes as possible but has only 4kg of flour and 1.2kg of fat available, although there is shortage
of the various other ingredients. Form four mathematical models to illustrate this information.
SOLUTIONS.
HINTS.
First translate the program into the language of mathematicsthis is called making the
mathematical model.
Flour Fat
First kind of cake (x) 200g 25g
Second kind of cake (y) 100g 50g
TOTAL AVAILABLE 4 kg 1.2kg
Let 𝑥 be the first kind of cake.
Let 𝑦 be the second kind of cake.
Since we shall need( 200x + 100y)g of flour, and we have 4000g (4kg into grams)
200x + 100y ≤ 4000, which reduces to;
2𝑥 + 𝑦 ≤ 40 .............................. (i).
since we shall need (25𝑥 + 50𝑦)𝑔 0f fat, we have 1200𝑔 ( 1.2 𝑘𝑔 into grams)
25𝑥 + 50𝑦 ≤ 1200
𝑥 + 2𝑦 ≤ 48 ....................... (ii).
EXERCISE.
At an Agricultural college, students must take both science and mathematics courses. Each
science course requires 4 contact hours and each mathematics course requires 3 contact hours. If
no student may take more than 72 hours in these areas, what are the possible combinations of
courses that can be taken? Let x be the number of mathematical courses and y be the number of
science courses taken.
a. Write down three inequalities which satisfy the given conditions.
b. If every student must take a minimum of 3 mathematics courses and a maximum of 12
science courses, write down two inequations which satisfy these conditions.
ANSWERS.
a. 3𝑥 + 4𝑦 ≤ 72, 𝑥 ≥ 1 and 𝑦 ≥ 1.
b. 𝑥 ≥ 3 and 𝑦 ≤ 12.
EXAMPLES.
One cake requires 150g of flour and 50g of fat, and another requires 75g of flour and 75g of fat. Mrs.
Olivia Tembo wants to make as many cakes as possible of the two kinds when 2.25kg of flour and 1.5kg
of fat are available.
a. Let x be the number of cakes of the first kind, and y be the number of cakes of the second kind.
Write down the obvious inequations for x and y, and show that two further inequations reduce to
𝟐𝒙 + 𝒚 ≤ 𝟑𝟎 and 𝟐𝒙 + 𝟑𝒚 ≤ 𝟔𝟎.
b. Write down the maximum number of each kind of cake that will be baked.
SOLUTIONS.
b. The graph(The graph may contain no negative numbers because you cannot have negative
cakes)
EXERCISE.
A Doctor advises an HIV/AIDS patient to take daily at least 10 units of ARVs vitamin A and at
least 15 units of ARVs vitamin B. The patient finds he can buy 2 tablets containing ARVs
vitamin A and 1 tablet containing ARVs vitamin B, or capsules containing 1 unit of ARVs
vitamin A and 3 units of ARVs vitamin B.
a. Suppose that the patient uses x tablets and y capsules daily. Write down a system of four
inequations in x and y which must be satisfied.
b. Taking a scale of 1cm to represent 1 unit on each axis, show the solution set of this system of
inequations.
c. Assuming that a tablet costs K 10, 000 and a capsule K 20, 000, write down the daily cost in
terms of x, y and hence find how many of each the patient should take to make the cost as
small as possible. State this daily cost
ANSWERS.
HINTS.
Form mathematical models.
Present them graphically and shade the unwanted region.
The unshaded part contains the solution set or feasible points.
Write down the coordinates of the possible feasible points.
Find the sum of each pair of the points.
The pair with the lowest sum is the required solution.
If the pair is (p, q) p x 10, 000 + q x 20, 000 K (10, 000p + 20, 000q), this will
give you the total daily cost.
EXAMINATION QUESTIONS
All the questions in this topic are to be answered on the sheet of graph papers
Solutions