Linear Programming
Linear Programming
How can quantitative methods be useful for below groups of potential users
a. Monetary economist who is tasked to design the monetary policy of the
country.
b. An analyst at an investment bank.
Mathematical Models
A model is a representation of real objects or situations. Eg. A business model which
tries to explain an end to end system of a business operations. A football model (4-4-2),
to represent how the football team will line up and play.
What about economic model?? What does it try to represent?
Given set of assumptions, a mathematical model – describe/represent a
problem/relationship by using equations or mathematical procedures. Equations will
contain the variables and parameters.
𝐺𝐷𝑃 = 𝐶 + 𝐼 + 𝐺
𝑪 = 𝑎 + 𝑏 𝑌 − 𝑇𝑎𝑥 Consumption function
𝑰 = 𝐼 𝐼𝑛𝑡𝑒𝑟𝑒𝑠𝑡 𝑟𝑎𝑡𝑒, 𝑜𝑡ℎ𝑒𝑟 𝑓𝑎𝑐𝑡𝑜𝑟𝑠
𝑮 = 𝐺(𝑡𝑎𝑥 𝑝𝑜𝑙𝑖𝑐𝑦, 𝑓𝑖𝑠𝑐𝑎𝑙 𝑝𝑜𝑙𝑖𝑐𝑦, 𝑚𝑜𝑛𝑒𝑡𝑎𝑟𝑦 𝑝𝑜𝑙𝑖𝑐𝑦, 𝑜𝑡ℎ𝑒𝑟 𝑓𝑎𝑐𝑡𝑜𝑟𝑠)
System Mathematical Model
Economic system – System of mathematical models /equations to describe the relationships
Closed Economy between different economic variables such as GDP, C, I, Tax, Interest
rate
Climate system System of mathematical models that describe the relationships between
different climate variables, such as temperature, precipitation, and
greenhouse gas concentrations.
Manufacturing System of mathematical models that describe the relationships between
Firm System production and manufacturing variables, such as price, quantity, costs,
profit
Portfolio System of mathematical models that describe the relationships between
Investment System different portfolio investment variables, such as stocks, returns, risks,
stock price.
Portfolio Return = (w1 * R1) + (w2 * R2) + ... + (wn * Rn)
Other systems: Diet system Interrelation between different nutrients and their composition
Optimization of systems of mathematical models
Given below system of a mathematical model
𝑦 𝛼 = 𝐴𝑥1 𝛽 + 𝐵𝑥2 𝜆 + ⋯ … . +Ω𝑥𝑛 𝜏
𝑅1 =≠≤≥ a𝑥1 + 𝑏𝑥2
𝑅2 =≠≤≥ c𝑥2 + 𝑑𝑥𝑛
Where ; 𝑅1 and 𝑅2 are the constants representing constraints existing between
the variables 𝑥1 , 𝑥2 , 𝑥𝑛 such as resources constraints
Where as,
Task 1: James holds two part-time jobs, Job I and Job II. He
never wants to work more than a total of 12 hours a week. He
has determined that for every hour he works at Job I, he needs
2 hours of preparation time, and for every hour he works at Job
II, he needs one hour of preparation time, and he cannot spend
more than 16 hours for preparation. If he makes TZS 4,000 an
hour at Job I, and TZS 3,000 an hour at Job II, how many
hours should he work per week at each job to maximize his
income?
Task 2: At a university, Professor Symons wishes to employ
two people, John and Mary, to grade papers for his classes.
John is a graduate student and can grade 20 papers per hour;
John earns TZS 15,000 per hour for grading papers. Mary is a
post-doctoral associate and can grade 30 papers per hour; Mary
earns TZS 25,000 per hour for grading papers. Each must be
employed at least one hour a week to justify their employment.
If Prof. Symons has at least 110 papers to be graded each
week, how many hours per week should he employ each
person to minimize the cost?
Methods to Solve Linear Programming Problems
The linear programming problem can be solved using different
methods such as;
1. Graphical method
2. Simplex method
3. Using tools such as R programming and open solver
Maximize
𝑌 = 4000𝑥1 + 3000𝑥2
Subject to
𝑥1 + 𝑥2 ≤ 12
2𝑥1 + 𝑥2 ≤ 16
𝑥1 ≥ 0, 𝑥2 ≥ 0
𝑥2
16
Feasible region points
A = (0,12)
B = (4, 8)
C = (8,0)
12
8 𝑥1
12
Note: Maximum (and minimum) of the objective
function lies at a corner point of the feasible region.
Maximum income in feasible region points
3.67
1 5.5 𝑥1
Minimum cost in the feasible region
Combination Cost as per objective function
A (1,3) 15,000(1) + 25,000(3) = TZS 90,000
B (4,1) 15,000(4) + 25,000(1) = TZS 85,000
Basic
𝑥1 𝑥2 𝑦1 𝑦2 𝑌 𝑅𝐻𝑆 solutions
1 1 1 0 0 12 𝑦1
2 1 0 1 0 16 𝑦2
-4000 -3000 0 0 1 0 𝑌
Step 4: Identify pivot column that is, the column with the
most negative entry in the bottom row. (Most –ve entry
represent largest coefficient in the objective function)
Basic
𝑥1 𝑥2 𝑦1 𝑦2 𝑌 𝑅𝐻𝑆 solutions
1 1 1 0 0 12 𝑦1
2 1 0 1 0 16 𝑦2
-4000 -3000 0 0 1 0 𝑌
Pivot column
Step 5: Identify pivot row that is, the row with the smallest
quotient. (Quotient is identified by taking RHS element
divide by the element in the pivot column
Basic
𝑥1 𝑥2 𝑦1 𝑦2 𝑌 𝑅𝐻𝑆 Quotient solutions
1 1 1 0 0 12 12/1 = 12 𝑦1
2 1 0 1 0 16 16/2 = 8 𝑦2
-4000 -3000 0 0 1 0 𝑌
The intersection between pivot column and pivot row will form a
pivot element which will be used for pivoting.
Step 6: Perform pivoting on the simplex tableau. Pivoting is
the process of obtain a 1 in the location of pivot element
and then making other elements zero in that column
To make pivot element 1 Divide pivot row by 2
Basic
𝑥1 𝑥2 𝑦1 𝑦2 𝑌 𝑅𝐻𝑆 solutions
1 1 1 0 0 12 𝑦1
1 1/2 0 1/2 0 8 𝑦2
-4000 -3000 0 0 1 0 𝑌
To make element in the pivot column above pivot element
zero Take second row times -1 plus first row
Basic
𝑥1 𝑥2 𝑦1 𝑦2 𝑌 𝑅𝐻𝑆 solutions
-1+1 -½+1 0+1 -½+0 0-0 -8+12 𝑦1
1 1/2 0 1/2 0 8 𝑦2
-4000 -3000 0 0 1 0 𝑌
Basic
𝑥1 𝑥2 𝑦1 𝑦2 𝑌 𝑅𝐻𝑆 solutions
0 ½ 1 -½ 0 4 𝑦1
1 1/2 0 1/2 0 8 𝑦2
-4000 -3000 0 0 1 0 𝑌
To make element in the pivot column below pivot element
zero Take second row times 4000 plus the bottom row
Basic
𝑥1 𝑥2 𝑦1 𝑦2 𝑌 𝑅𝐻𝑆 solutions
0 ½ 1 -½ 0 4 𝑦1
1 ½ 0 ½ 0 8 𝑥2
0 -1000 0 2000 1 32,000 𝑌
Basic
𝑥1 𝑥2 𝑦1 𝑦2 𝑌 𝑅𝐻𝑆 solutions
0 1 2 -1 0 8 𝑦1
1 ½ 0 ½ 0 8 𝑥2
0 -1000 0 2000 1 32,000 𝑌
Make element below pivot element zero Multiply first
row by -1/2 and add to the second row
Basic
𝑥1 𝑥2 𝑦1 𝑦2 𝑌 𝑅𝐻𝑆 solutions
0 1 2 -1 0 8 𝑦1
1 0 -1 1 0 4 𝑥2
0 -1000 0 2000 1 32,000 𝑌
Maximise D = 110𝑦1 + 𝑦2 + 𝑦3
Subject to
20𝑦1 + 𝑦2 ≤ 15,000
30𝑦1 + 𝑦3 ≤ 25,000
𝑦1 ≥ 0, 𝑦2 ≥ 0, 𝑎𝑛𝑑 𝑦3 ≥ 0
Step 4: Construct initial simplex tableau from the
above problem
𝒚𝟏 𝒚𝟐 𝒚𝟑 𝒙𝟏 𝒙𝟐 𝑫 𝑹𝑯𝑺
20 1 0 1 0 0 15,000
30 0 1 0 1 0 25,000
-110 -1 -1 0 0 1 0
Step 5: Find pivot column, pivot row, and pivot
element (Just like the previous session) Note: Pivot
element cannot be zero.
𝒚𝟏 𝒚𝟐 𝒚𝟑 𝒙𝟏 𝒙𝟐 𝑫 𝑹𝑯𝑺
20 1 0 1 0 0 15,000
30 0 1 0 1 0 25,000
-110 -1 -1 0 0 1 0
Step 6: Do pivoting
• To make pivot element 1 Multiply the 1st row by
1/20
𝒚𝟏 𝒚𝟐 𝒚𝟑 𝒙𝟏 𝒙𝟐 𝑫 𝑹𝑯𝑺
1 1/20 0 1/20 0 0 750
30 0 1 0 1 0 25,000
-110 -1 -1 0 0 1 0
• To make element in 2nd row below pivot element zero
Multiply 1st row by -30 and add to 2nd row
𝒚𝟏 𝒚𝟐 𝒚𝟑 𝒙𝟏 𝒙𝟐 𝑫 𝑹𝑯𝑺
1 1/20 0 1/20 0 0 750
0 -30/20 1 -30/20 1 0 2,500
-110 -1 -1 0 0 1 0
• To make element in the 3rd row below pivot element
zero Multiply 1st row by 110 and add to the 3rd row
𝒚𝟏 𝒚𝟐 𝒚𝟑 𝒙𝟏 𝒙𝟐 𝑫 𝑹𝑯𝑺
1 1/20 0 1/20 0 0 750
0 -30/20 1 -30/20 1 0 2,500
• To make
0 element
4.5 rd row0below
in-1the 35.5 1 pivot82,500
element
zero Add 2nd row to the 3rd row
𝒚𝟏 𝒚𝟐 𝒚𝟑 𝒙𝟏 𝒙𝟐 𝑫 𝑹𝑯𝑺
1 1/20 0 1/20 0 0 750
0 -30/20 1 -30/20 1 0 2,500
0 3 0 4 1 1 85,000
3.0 Irregular types of LPP
In theory, every linear programming problem either:
1. Is infeasible
2. Is unbounded
3. Has a unique optimal solution value (Single optimal
point or multiple optima)
Irregular LPP occurs under below circumstances.
1. When LPP problem has no feasible solution area.
2. LPP with multiple optimal points i.e. multiple
optima
3. Problems with unbounded solutions
4. Problems with ties for the pivot column or ties for
the pivot row.
5. Problems with constraints with negative quantity
values i.e. breach the non-negativity condition
Note:For irregular problems the general simplex
procedure does not always apply.
3.0.1 Infeasible LP models
An LLP is infeasible if it has no feasible solution in
which there will be no solution that will satisfy all
constraints. Given below LPP
Maximize 8𝑥1 + 5𝑥2
Subject to. 2𝑥1 + 𝑥2 ≤ 1000
3𝑥1 + 4𝑥2 ≤ 2400
𝑥1 − 𝑥1 ≤ 350
𝑥1 ≥ 800
𝑥1 , 𝑥2 ≥ 0
3.0.2 Unbounded solution