title: "Lecture 1: Introduction to Mathematical Modelling and LPs" author: "Junaid Hasan" date: "June 20, 2021"¶
A Real Life Scenario¶
- Washington State Ferries do not carry enough lifeboats for all passengers.
- They do carry enough life vests to make up the difference.
- Reason:
- Lifeboats take up too much space!
- If we allow lifeboats for everyone, then capacity will go down by a lot.
A demo problem¶
- Suppose a boat company wants to design a new ferry with the following:
- A vest holds 1 person and requires $0.05 m^3$ of space to store.
- A boat holds 20 people and requires $2.1 m^3$ of space to store.
- The ferry must have a capacity of 1000.
- The space devoted for emergency equipment is $85 m^3$.
- Question: What to do?
Lets try out a few cases¶
- Suppose all lifeboats then 50 boats need $50 \times 2.1 \approx 105 m^3$ space.
- Suppose all lifevests then 1000 lifevests need $1000 \times 0.05 = 50 m^3$ space.
- Therefore we must do a combination.
Computation¶
- Let $x_1$ vests.
- Let $x_2$ boats.
- The capacity limit means $$x_1 \cdot 0.05 + x_2 \cdot 2.1 = 85.$$
- The person limit means $$ x_1 \cdot 1 + x_2 \cdot 20 = 1000.$$
In [6]:
# you may need to install numpy
# do it via 'pip install numpy' or 'conda install numpy'
import numpy as np
A = np.array([[0.05, 2.1],[1, 20]])
b = np.array([85, 1000])
x = np.linalg.solve(A,b)
print(x)
[363.63636364 31.81818182]
Discussing the solution¶
- We found out we need 363.64 vests and 31.82 boats.
- Since fractional vests/boats are not practical we need to interpret this correctly:
- How?
- Note that the volume cannot be increased, so we must reduce boats by 1 and increase vests to accommodate to 1000.
- If boats are 31, then 620 people are covered,
- Therefore we need 380 vests.
- The volume needed is $31 \cdot 2.1 + 380 \cdot 0.05 = 84.1 m^3$
Finishing touches¶
- Now we write to the company with 31 boats and 380 vests.
- The company replies: "You are crazy! Lifeboats are arranged on symmetric racks, therefore must be even! Fix it"
- So we must have 30 boats and therefore the remaining 400 vests.
Reconsideration¶
- Notice that we had $x_2 = 31.8$, so suppose we want 32 boats. But this means we need more space.
- The space taken is $32 \cdot 2.1 + 360 \cdot 0.05 = 85.2 m^3$ slightly more than 85.
- This means we write back to the company with "If the space were to be increased by $0.2 m^3$ we could accommodate 2 more boats means 40 more people in the boats!
- A significant improvement indeed".
- They respond: "Sure that works! The 85 figure was an approximation, we can easily find another $0.2 m^3$ of space if it means 2 more boats".
What do we learn from this¶
- A modelling problem may not be explicitly stated.
- There are multiple ways of modelling the same problem mathematically.
- As we saw the equality condition may not hold, if inequalities hold then this problem is called
- a linear programming problem, furthermore we want
- the numbers to be integers so it was an integer linear programming problem.
- Once we solve the problem we have to interpret the answer. More so we ask the question "Does it make sense?"
contd..¶
- Often all the information may not be present and we might have to tweak the solution a little bit. For example the arrangement of the boats allowed us to change our solution.
- Problem may be hard and solution may not exist or infeasible.
- Therefore math modelling is the cycle
In [ ]: