Tutorial: MSBA7003 Quantitative Analysis Methods
Tutorial: MSBA7003 Quantitative Analysis Methods
Tutorial: MSBA7003 Quantitative Analysis Methods
Tutorial 03
Haobo Yu
2021 – 2022
1
2
Agenda
• Solution to assignment 02
• Linear Programming
• Distributing Goods through a Distribution Network
Solution to Assignment 02
Solution to Assignment 02
Solution to Assignment 02
• Q2
• Dumoor Appliance Center sells and services several brands of major appliances.
Past sales for a particular model of refrigerator have resulted in the following
probability distribution for demand:
Demand per Week 0 1 2 3 4
Solution to Assignment 02
• Based on cost considerations as well as storage space, the company has decided
to order 15 units each time. The shipping cost for each order is $30. The holding
cost is $5 per week per unit that is left in inventory at the end of the week. The
stock-out cost is $40 per unit. The company has decided to place an order
whenever there are only two or fewer refrigerators left at the end of the week.
No order can be placed when refrigerators are being shipped on the way.
Simulate 10 weeks of operation for Dumoor Appliance by hand assuming that
there are currently 5 units in inventory. You must use the random numbers listed
in the table below to generate demand and lead time values, respectively.
Solution to Assignment 02
Week Order Total R.N. Demand Sales Lost Ending Place R.N. Lead Time
Received Available Sales Inventory Order
1 0 5 0.52 0.56
2 0.37 0.45
3 0.82 0.07
4 0.98 0.16
5 0.96 0.48
6 0.33 0.61
7 0.50 0.31
8 0.88 0.43
9 0.90 0.28
10 0.06 0.31
8
Solution to Assignment 02
• Only C is correct.
9
Solution to Assignment 02
Solution to Assignment 02
Solution to Assignment 02
• Q4.
• We are solving a dynamic decision-making problem for a project, for
which the final outcome is either success or failure. In the process to
build a search tree with the Monte Carlo Tree Search algorithm to
maximize the success rate (V), after the 22nd round of selection-
expansion-simulation-backpropagation is finished, the first 4 rows of
the table that stores the search tree is given below. The UCB1
selection strategy is used, and the constant 𝐶 = 1/2.
12
Solution to Assignment 02
• Solution:
• The upper confidence bound (UCB) for node 𝑖 (an option) is given by
ln 𝑁𝑖
𝐵𝑖 = 𝑉𝑖 +
𝑛𝑖
• For choice (A), suppose the 22nd search started from node 4 and
failed. Before the 22nd search,
0.1667
• 𝑛2 = 6, 𝑉2 = 6 ∗ = 0.1667, 𝑁2 = 21, 𝐵2 = 0.879.
6
0
• 𝑛3 = 4, 𝑉3 = 4 ∗ = 0, 𝑁3 = 21, 𝐵3 = 0.8724.
4
0.4167
• 𝑛4 = 11, 𝑉4 = 12 ∗ = 0.4545, 𝑁4 = 21, 𝐵4 = 0.9806.
11
• The 22nd search started from node 4. Choice (A) is wrong.
13
Solution to Assignment 02
• For choice (B), since the node 4 has the highest UCB value, the 23rd
search will surely start from node 4. Choice (B) is correct.
• For choice (C), since the 23rd search will start from node 4, the UCB
values for node 2 and 3 will increase. For node 4, if the 23rd search is
successful, the updated UCB value is as follows.
6
• 𝑛4 = 13, 𝑉4 = = 0.4615, 𝑁4 = 23, 𝐵4 = 0.9526.
13
• Choice (C) is correct.
• For choice (D), suppose the 23rd search fails. The updated UCB values
are as follows.
0.1667
• 𝑛2 = 6, 𝑉2 = 6 ∗ = 0.1667, 𝑁2 = 23, 𝐵2 = 0.8896.
6
0
• 𝑛3 = 4, 𝑉3 = 4 ∗ = 0, 𝑁3 = 23, 𝐵3 = 0.8854.
4
0.4167
• 𝑛4 = 13, 𝑉4 = 12 ∗ = 0.3846, 𝑁4 = 23, 𝐵4 = 0.8757.
13
• Choice (D) is correct.
14
Distributing Goods
• The DISTRIBUTION UNLIMITED CO. will be producing the same new
product at two different factories, and then the product must be
shipped to two warehouses, where either factory can supply either
warehouse.
Distributing Goods
• Decision variables
• 𝑥𝐹1−𝐹2 , 𝑥𝐹1−𝐷𝐶 , 𝑥𝐹1−𝑊1 , 𝑥𝐹2−𝐷𝐶 , 𝑥𝐷𝐶−𝑊2 , 𝑥𝑊1−𝑊2 , 𝑥𝑊2−𝑊1 : the amounts
shipped through the respective lanes
• Constraints
• Upper-bound constraints: 𝑥𝐹1−𝐹2 ≤ 10 and 𝑥𝐷𝐶−𝑊2 ≤ 80
• Net flow constraints:
• Factory: amount shipped out - amount shipped in = amount produced
• DC: amount shipped out = amount shipped in
• Warehouse: amount shipped in - amount shipped out = amount needed
• Nonnegativity constraints
• Objective
• To minimize the total shipping cost
16
Distributing Goods
• Programming model
17
Distributing Goods
• Final solution
Violating Proportionality
1 2 3
0 0 0 0
1 1 0 -1
2 3 2 2
3 3 3 4
19
Violating Proportionality
• One Formulation with Auxiliary Binary Variables.
• A natural formulation would be to let 𝑥1 , 𝑥2 , 𝑥3 be the number of TV
spots allocated to the respective products.
• However, we cannot write a linear objective function in terms of
these integer decision variables. For example, the profit function of
product 1, 𝐹1 𝑥1 , is not linear.
• Now we introduce an auxiliary binary variable 𝑦𝑖𝑗 to replace the
1 if 𝑥𝑖 = 𝑗
original decision variables, where 𝑦𝑖𝑗 = ቊ
0 otherwise.
• The values of 𝑦𝑖𝑗 can imply the value of 𝑥𝑖 .
• For example, 𝑦21 = 0, 𝑦22 = 0, and 𝑦23 = 1 mean that 𝑥2 = 3.
• These definitions are enforced by adding the constraints.
• 𝑦𝑖1 + 𝑦𝑖2 + 𝑦𝑖3 ≤ 1 for 𝑖 = 1, 2, 3.
20
Violating Proportionality
Violating Proportionality
• for 𝑖 = 1, 2, 3.
• These definitions are enforced by adding the constraints
22
Violating Proportionality
• The new definition of the 𝑦𝑖𝑗 also changes the objective function.
0 0
1 1
2 3
3 3
23
Violating Proportionality
Violating Proportionality
Logical Constraint
• How to formulate the following shaded area in a linear programming
problem?
26
Logical Constraint
• Constraint Feasibility
• Possibly the simplest logical question that can be asked in mathematical
programming is whether a given choice of the decision variables satisfies a
constraint. More precisely, when is the general constraint satisfied?
𝑓 𝑥1 , 𝑥2 , … , 𝑥𝑛 ≤ 𝑏
• We introduce a binary variable 𝑦 with the interpretation:
𝑓 𝑥1 , 𝑥2 , … , 𝑥𝑛 − 𝐵𝑦 ≤ 𝑏,
• where the constant 𝐵 is chosen to be large enough so that the constraint
is always satisfied if 𝑦 = 1.
27
Logical Constraint
𝑓1 𝑥1 , 𝑥2 − 𝐵1 𝑦1 ≤ 𝑏1
𝑓2 𝑥1 , 𝑥2 − 𝐵2 𝑦2 ≤ 𝑏2
𝑦1 + 𝑦2 ≤ 1
𝑦1 , 𝑦2 binary
• The variables 𝑦1 and 𝑦2 and constants 𝐵1 and 𝐵2 are chosen as above
to indicate when the constraints are satisfied.
• The multiple-choice constraint 𝑦1 + 𝑦2 ≤ 1 implies that at least one
variable 𝑦𝑗 equals 0, so that, as required, at lease on constraint must
be satisfied.
• For this case, we can save one integer variable. Actually, 𝑦1 + 𝑦2 = 1.
28
Logical Constraint
• As an illustration, consider the problem in Session 5. If at least only
one of the first two constraints is required.
4𝑇 + 3𝐶 ≤ 240 or 2𝑇 + 𝐶 ≤ 100
𝑇, 𝐶 ≤ 100
𝑇, 𝐶 ≥ 0
• the integer-programming formulation
4𝑇 + 3𝐶 − 700𝑦 ≤ 240
2𝑇 + 𝐶 − 300 1 − 𝑦 ≤ 100
𝑇, 𝐶 ≤ 100
𝑇, 𝐶 ≥ 0
𝑦 = 0 or 1
• In this case, 𝐵1 = 700 and 𝐵2 = 300, which are large enough so that
the constraint is not limiting for the production process not used.
29
Logical Constraint