Tutorial 1
Tutorial 1
Tutorial 01
Haobo Yu
2021 – 2022
Email: [email protected] Office: Room 808, KKL WeChat ID: yhb_Ber
1
2
Class notes
Tutorial
• Explanation of assignments
• More exercises
• Similar with in-class exercises and assignments
• Software
• Python is most used
• R, Excel
4
Agenda
• Joint distribution
• Corpus Data
• An Explanation of a homework
• Thompson Lumber Company
Corpus Data
the 30 0.30 3 1
to 16 0.16 2 1
some 15 0.15 4 2
grade 10 0.10 5 2
point 9 0.09 5 2
fail 8 0.08 4 2
pass 8 0.08 4 1
HK 4 0.04 2 0
6
Corpus Data
to 16 0.16 2 1
• The probabilities of some
some 15 0.15 4 2
events:
• 𝑃 2≤𝑋≤3 = grade 10 0.10 5 2
𝑃 to +𝑃 HK + 𝑃 the = point 9 0.09 5 2
0.16 + 0.3 + 0.04 = 0.5
fail 8 0.08 4 2
• 𝑃 2 ≤ 𝑌 = 𝑃 some +
pass 8 0.08 4 1
𝑃 grade + 𝑃 point +
𝑃 fail = 0.42 HK 4 0.04 2 0
7
Joint Distribution
• We can describe the joint distribution between word length (𝑋)
and number of vowels (𝑌):
• Let 𝑓 𝑥, 𝑦 = 𝑃 𝑋 = 𝑥, 𝑌 = 𝑦 .
• Examples:
• 𝑓 4,2 = 𝑃 fail + 𝑃 some = 0.15 + 0.08 = 0.23;
• 𝑓 3,1 = 𝑃 the = 0.3;
• 𝑓 5,0 = 0.
Words (w) Occurrences Probabilities Length Vowels Joint y
c(w) P(w) (x) (y) Distribution
0 1 2
the 30 0.30 3 1
2 0.04 0.16 0
to 16 0.16 2 1
x 3 0 0.30 0
some 15 0.15 4 2
4 0 0.08 0.23
grade 10 0.10 5 2
5 0 0 0.19
point 9 0.09 5 2
fail 8 0.08 4 2
pass 8 0.08 4 1
HK 4 0.04 2 0
8
Corpus Data
y
𝑓𝑋
0 1 2
x 3 0 0.30 0 0.3
5 0 0 0.19 0.19
Joint y y
𝑓𝑋 ∗ 𝑓𝑌
distribution 0 1 2 𝑓𝑋 0 1 2 𝑓𝑋
Café du Donut
• The Café buys donuts each day for $40 per carton of 20 dozen
donuts. Any cartons not sold are thrown away at the end of the
day. If a carton is sold, the revenue is $60.
• Suppose that the order size (Q) can only be either 6 or 7 due to
the storage capacity and delivery capacity.
12
Café du Donut
• The salesperson’s initial belief is that two demand situations are
equally likely.
DAILY DEMAND PROBABILITY PROBABILITY MARGINAL
(CARTONS) UNDER LOW UNDER HIGH PROBABILITY
DEMAND DEMAND
4 0.25 0.05 0.15
Café du Donut
Café du Donut
• The profit of each decision under each state of market remains the
same as the one in the slides of Session 2. The market also can be
favorable or unfavorable. Now Thompson Lumber Company is
deciding whether to hire a consulting company to give a prediction of
the market.
• We have a prior belief that P(Fav) = 0.8.
STATE OF NATURE
Favorable 35 20 55
Unfavorable 20 25 45
Total 55 45
$0
Without survey: EMV= 124k
18
$133,000
EMV = 113k Small
$72,000 Favorable Market (0.85)
$90,000
Plant
3 Unfavorable Market (0.15)
–$30,000
No Plant
–$10,000
1 $83,600 Favorable Market (0.72)
$190,000
4 Unfavorable Market (0.28)
–$190,000
$56,400
$83,600
Favorable Market (0.72)
Small $90,000
Plant
5 Unfavorable Market (0.28)
–$30,000
No Plant
–$10,000
Tossing Coins