You are on page 1of 25

Bayes Rule and Decision Tree

Penelitian Operasional 3 (ISE – 183101)

Reference:
Winston, W.L. & Goldberg, J.B. (2004). Operations research: applications and algorithms (Vol 4).
BelmonteCalif:Thomson/Brooks/Cole
Chapter 13.5 & 12.4
Your Logo or Name Here
Outline

Decision Tree excercise

Review Bayes Rule

Bayes Rule and Decision Tree

Your Logo or Name Here


2
Exercise

Oilco must determine whether or not to drill for oil in the South China Sea. It
costs $100,000, and if oil is found, the value is estimated to be $600,000. At
present, Oilco believes there is a 45% chance that the field contains oil.
Before drilling, Oilco can hire (for $10,000) a geologist to obtain more
information about the likelihood that the field will contain oil. There is a 50%
chance that the geologist will issue a favorable report and a 50% chance of an
unfavorable report.
Given a favorable report, there is an 80% chance that the field contains oil. Given
an unfavorable report, there is a 10% chance that the field contains oil.

Determine Oilco’s optimal course of action. Also determine EVSI and EVPI.
Your Logo or Name Here
3
Your Logo or Name Here
4
$ -10,000
At each event fork, we Don’t Drill

calculate the expected


reward/payoff and enter Oil 80% $ 490,000
it in Drill
$ 370,000
Fav 50% ER = 0.8*(490,000) + 0.2*(-110,000) = $370,000.

No Oil 20% $ -110,000

Don’t Drill $ -10,000

Hire Geologist
Not Fav 50%
Oil 10% $ 490,000
- $ 50,000
Drill
ER = 0.1*(490,000) + 0.9*(-110,000) = - $50,000.

No Oil 90% $ -110,000

$ 500,000
$ 170,000 Oil 45%

Don’t Hire Drill ER = 0.45*(500,000) + 0.55*(-100,000) = $170,000.


Geologist
No Oil 55% $ -100,000

Don’t Drill $0
Your Logo or Name Here
5
At each decision fork, the Don’t Drill $ -10,000
decision that maximizes $ 370,000

the reward denoted by ‖ . $ 490,000


Oil 80%
Enter the ER associated ‖ $ 370,000
Drill
with that decision in . Fav 50%

ER = 0.5*(370,000) + 0.5*(-10,000) = $180,000. No Oil 20% $ -110,000

$ 180,000 Don’t Drill $ -10,000


- $ 10,000
Hire Geologist

Not Fav 50%
Oil 10% $ 490,000
‖ - $ 50,000
Drill

$ 180,000 No Oil 90% $ -110,000

Oilco’s optimal decision is hire $ 500,000


$ 170,000 Oil 45%
the geologist and act optimally
based on the report. Don’t Hire Drill
If report favorable, Drill. Geologist $ 170,000 ‖
No Oil 55% $ -100,000
If the report not Fav, do not drill.
Expected net profit $180,000.
Don’t Drill $0
Your Logo or Name Here
6
1. Expected value with sample Don’t Drill $ -10,000
information (EVWSI) = $ 370,000
180,000 + 10,000 =190,000
Oil 80% $ 490,000

Drill ‖ $ 370,000
Fav 50%
2. Expected value with original
information (EVWOI)
No Oil 20% $ -110,000
170,000
$ 180,000 Don’t Drill $ -10,000
- $ 10,000
3. Expected value of sample Hire Geologist

Not Fav 50%
information (EVSI)) Oil 10% $ 490,000
190,000 - 170,000 = 20,000 ‖ - $ 50,000
Drill

$ 180,000 No Oil 90% $ -110,000

$ 500,000
$ 170,000 Oil 45%
Since the cost of the hiring
Geologist ($10,000) bellow EVSI, Don’t Hire Drill

Geologist $ 170,000
Olico should hire the Geologist No Oil 55% $ -100,000
to get additional information
about the land.
Don’t Drill $0
Your Logo or Name Here
7
1. Expected value with perfect
$ 500,000
Drill information (EVWPI) = 225,000
ER = 0.45*(500,000) + 0.55*(0)
= $225,000.
2. Expected value of perfect
Oil 45% information (EVPI) =
Don’t Drill 225,000 – 170,000 = 55,000
$0

$ 225,000
Thus, a perfect (one that was
- $ 100,000 always correct) from geologist
Drill
No Oil 55% report would be worth $55,000.
that is, report (no matter how
good) can be worth more than
Don’t Drill $55,000.
$0

Perfect information → all uncertain events that can affect reward still occur with the given probabilities,
but Decision maker finds out event is happening before making the decision.

Your Logo or Name Here


8
Outline

Decision Tree excercise

Review Bayes Rule

Bayes Rule and Decision Tree

Your Logo or Name Here


9
Review on Bayes’ Rule

❑ An important decision often depends on the “state of the world” and its
probability.
❑ The states of the world are collectively exhaustive: S1, S2, . . . , Sn include all
possibilities.
❑ Suppose a decision maker assigns a probability P(Si) to Si.
❑ P(Si) is the prior probability of Si.
States of the world S = {Rumah, Wayang}
P (Rumah) = 0.5 dan P (Wayang)=0.5 → Prior Probabilities.

Your Logo or Name Here


10
Review on Bayes’ Rule (2)

❑ To obtain more information about the state of the world, the decision maker
may observe the outcome of an experiment.
❑ Suppose that for each possible outcome Oj and each possible state of the world
Si, the decision maker knows P(Oj|Si), the likelihood of the outcome Oj given
state of the world Si.
❑ Bayes’ rule combines prior probabilities and likelihoods with the experimental
outcomes to determine a post-experimental probability, or posterior
probability, for each state of the world, P(Si|Oj).
𝑷 𝑶𝒋 ห𝑺𝒊 𝑷 𝑺𝒊
𝑷 𝑺𝒊 ቚ𝑶𝒋 = 𝒌=𝒏
σ𝒌=𝟏 𝑷 𝑶𝒋 ห𝑺𝒌 𝑷 𝑺𝒌

Your Logo or Name Here


11
Review on Bayes’ Rule (3)

❑ In short way. We use bayes if we are given information:


❑ State of the world S = {S1, S2, . . . , Sn }
❑ Prior Probabilities P(Si), for i=1,2, …, n.
❑ Likelihood of Outcome Oj given state of the world Sj, P(Oj|Si).

❑ And we want to know the Posterior Probability P(Si|Oj).

Your Logo or Name Here


12
How to Calculate the Posterior Probability

1. Calculate the joint probability, 𝑃 𝑆𝑖 ∩ 𝑂𝑗 .


𝑃 𝑆𝑖 ∩ 𝑂𝑗 = 𝑃 𝑂𝑗 ห𝑆𝑖 ∙ 𝑃 𝑆𝑖

2. Calculate the Marginal probability, 𝑃 𝑂𝑗 .

𝑃 𝑂𝑗 = σ𝑘=𝑛
𝑘=1 𝑃 𝑂𝑗 ห𝑆𝑘 ∙ 𝑃 𝑆𝑘

3. Calculate the Posterior Probability P(Si|Oj)

𝑃 𝑂𝑗 ห𝑆𝑖 𝑃 𝑆𝑖 → The joint probability, 𝑃 𝑆𝑖 ∩ 𝑂𝑗


𝑃 𝑆𝑖 ቚ𝑂𝑗 =
σ𝑘=𝑛
𝑘=1 𝑃 𝑂𝑗 ห𝑆𝑘 𝑃 𝑆𝑘 → the Marginal probability, 𝑃 𝑂𝑗 .
Your Logo or Name Here
13
Example on Bayes’ Rule

❑ Suppose that 1% of all children have tuberculosis (TB).


❑ When a child who has TB is given the Mantoux test, a positive test result occurs
95% of the time. When a child who does not have TB is given the Mantoux test, a
positive test result occurs 1% of the time.
❑ Given that a child is tested and a positive test result occurs, what is the
probability that the child has TB?
❑ State of the world → S {TB, NTB)
❑ Prior Probabilities → P(TB) = 0.01, then P(NTB)= 0.99.
❑ Experiment (Mantoux Test). Outcome of the test → O {P, N}
Likelihood of the test → 𝑃 𝑃ȁ𝑇𝐵 = 0.95, 𝑃 𝑃ȁ𝑁𝑇𝐵 = 0.01.
Questions: 𝑃 𝑇𝐵ȁ𝑃
Your Logo or Name Here
14
Example on Bayes’ Rule (2)
P(TB) = 0.01 P(NTB)= 0.99. 𝑃 𝑂𝑗 ห𝑆𝑖 𝑃 𝑆𝑖
𝑃 𝑃ȁ𝑇𝐵 = 0.95 𝑃 𝑃ȁ𝑁𝑇𝐵 = 0.01. 𝑃 𝑆𝑖 ቚ𝑂𝑗 =
σ𝑘=𝑛
𝑘=1 𝑃 𝑂𝑗 ห𝑆𝑘 𝑃 𝑆𝑘

Questions: 𝑃 𝑇𝐵ȁ𝑃 ? 𝑃 𝑃ȁ𝑇𝐵 𝑃 𝑇𝐵


𝑃 𝑇𝐵ȁ𝑃 =
𝑃 𝑃ȁ𝑇𝐵 𝑃 𝑇𝐵 + 𝑃 𝑃ȁ𝑁𝑇𝐵 𝑃 𝑁𝑇𝐵

0.95 ∙ 0.01
𝑃 𝑇𝐵ȁ𝑃 =
0.95 ∙ 0.01 + 0.01 ∙ 0.99

𝑃 𝑇𝐵ȁ𝑃 = 0.4897

Other posterior probabilities? Probability the child have tuberculosis, given


the test result positive is 48.97%.
P NTBȁP , P TBȁN , P NTBȁN
Your Logo or Name Here
15
Prior Probabilities → P(TB) = 0.01, P(NTB)= 0.99. 1. Calculate the joint probability,

Likelihood of the test → 𝑃 𝑃ȁ𝑇𝐵 = 0.95 → 𝑃 𝑁ȁ𝑇𝐵 = 0.05


𝑷 𝑺𝒊 ∩ 𝑶𝒋 .
𝑃 𝑃ȁ𝑁𝑇𝐵 = 0.01 → 𝑃 𝑁ȁ𝑁𝑇𝐵 = 0.99 𝑃 𝑆𝑖 ∩ 𝑂𝑗 = 𝑃 𝑂𝑗 ห𝑆𝑖 ∙ 𝑃 𝑆𝑖

Questions: Posterior Probabilities, 𝑃 𝑆𝑖 ቚ𝑂𝑗 ?


𝑂𝑗 𝑆𝑖 𝑃 𝑆𝑖 𝑃 𝑶𝒋 ห 𝑺𝒊 𝑃 𝑆𝑖 ∩ 𝑂𝑗 2. Calculate the Marginal probability,
𝑷 𝑶𝒋 .
Positive TB 0.01 x 0.95 = 0.0095 𝑃 𝑂𝑗 = σ𝑘=𝑛
𝑘=1 𝑃 𝑂𝑗 ห𝑆𝑘 ∙ 𝑃 𝑆𝑘
(P)
NTB 0.99 0.01 0.0099
0.019 → 𝑃 𝑃 = 0.0194
Negative TB 0.01 0.05 0.0005 Sum of all the marginal
(N) probability is 1.
NTB 0.99 0.99 0.9801
0.9806 → 𝑃 𝑁 = 0.9806

Your Logo or Name Here


16
3. Calculate the Posterior Probability, P(Si|Oj)

𝑷 𝑶𝒋 ห𝑺𝒊 𝑷 𝑺𝒊 → The joint probability, 𝑃 𝑆𝑖 ∩ 𝑂𝑗


𝑷 𝑺𝒊 ቚ𝑶𝒋 =
σ𝒌=𝒏
𝒌=𝟏 𝑷 𝑶𝒋 ห𝑺𝒌 𝑷 𝑺𝒌 → the Marginal probability, 𝑃 𝑂𝑗 .

𝑂𝑗 𝑆𝑖 𝑃 𝑆𝑖 𝑃 𝑶𝒋 ห 𝑺𝒊 𝑃 𝑆𝑖 ∩ 𝑂𝑗 𝑃 𝑆𝑖 ቚ𝑂𝑗

Positive TB 0.01 0.95 0.0095 0.4897 𝑃 𝑇𝐵 ȁ𝑃 𝑷 𝑻𝑩ȁ𝑷 = 0.0095 : 0.019 = 0.4897

(P)
NTB 0.99 0.01 0.0099 0.5103 𝑃 𝑁𝑇𝐵 ȁ𝑃 𝑷 𝑵𝑻𝑩ȁ𝑷 = 0.0099 : 0.019 = 0.5103

0.019 1
Negative TB 0.01 0.05 0.0005 0.0005 𝑃 𝑇𝐵 ȁ𝑁
(N)
NTB 0.99 0.99 0.9801 0.9995 𝑃 𝑁𝑇𝐵 ȁ𝑁

0.9806 1

Your Logo or Name Here


17
Outline

Decision Tree excercise

Review Bayes Rule

Bayes Rule and Decision Tree

Your Logo or Name Here


18
Bayes Rule and Decision Tree

Many other decision tree problems share several common features, such as:
❑ There are several states of the world. Different states of the world result in
different payoffs to the decision maker.
❑ The estimates of the probabilities of each state of the world.
P(Si) →prior probabilities.
❑ The additional information that gives the decision maker more foreknowledge
about the state of the world.
❑ The decision maker receives information by observing the outcomes of an
experiment. Let S1, S2, . . . , Sn denote the possible states of the world, and let O1,
O2, . . . , Om be the possible outcomes of the experiment.

Your Logo or Name Here


19
Bayes Rule and Decision Tree (2)

❑ Given knowledge of the outcome of the experiment, these probabilities give


new values for the probability of each state of the world. The probabilities
P(Si|Oj) → posterior probabilities.

Colaco Example:
The prior probabilities are P(NS)=0.55 and P(NF)=0.45.
The experiment → the test-marketing procedure, with two possible outcomes (LF and LS).
The posterior probabilities were given to be P(NS|LS)=0.85, P(NS|LF)=0.10, P(NF|LS)=0.15,
P(NF|LF)=0.90

❑ The posterior probabilities just listed were used to define the event forks in the
decision tree that followed the action Test market.
Your Logo or Name Here
20
❑ Colaco’s Decision Tree

𝑃 𝑁𝑆ȁ𝐿𝑆

𝑃 𝐿𝑆

𝑃 𝑁𝐹ȁ𝐿𝑆

𝑃 𝐿𝐹

𝑃 𝑁𝑆ȁ𝐿𝐹

𝑃 𝑁𝐹ȁ𝐿𝐹

𝑃 𝑁𝑆

𝑃 𝑁𝐹
𝑃𝑟𝑖𝑜𝑟 𝑃𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑖𝑒𝑠

𝑃𝑜𝑠𝑡𝑒𝑟𝑖𝑜𝑟 𝑃𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑖𝑒𝑠

𝑀𝑎𝑟𝑔𝑖𝑛𝑎𝑙 𝑃𝑟𝑜𝑏𝑎𝑏𝑖𝑙𝑖𝑡𝑖𝑒𝑠
Your Logo or Name Here
21
Bayes Rule and Decision Tree (3)

❑ In many situations, however, we may be given the prior probabilities p(si) for
each state of the world, and instead of being given the posterior probabilities
p(si|oj), we might be given the likelihoods P(Oj|Si).
❑ For each state of the world, the likelihoods give the probability of observing
each experimental outcome.

Colaco example:
The prior probabilities are P(NS)=0.55 and P(NF)=0.45.
The likelihood were given to be:
51 4 9 36
P(LS|NS)= , P(LF|NS)= , P(LS|NF)= , P(LF|NF)=
55 55 45 45
To complete the decision tree, we need to calculate the posterior probabilities.
Your Logo or Name Here
22
The prior probabilities are P(NS)=0.55 and P(NF)=0.45. 1. Calculate the joint probability,
The likelihood: 𝑷 𝑺𝒊 ∩ 𝑶𝒋 .
51 4 9 36
P(LS|NS)= , P(LF|NS)= , P(LS|NF)= , P(LF|NF)= 𝑷 𝑺𝒊 ∩ 𝑶𝒋 = 𝑷 𝑶𝒋 ห𝑺𝒊 ∙ 𝑷 𝑺𝒊
55 55 45 45

Questions: Posterior Probabilities, 𝑃 𝑆𝑖 ቚ𝑂𝑗 ?


𝑂𝑗 𝑆𝑖 𝑃 𝑆𝑖 𝑃 𝑶𝒋 ห 𝑺𝒊 𝑃 𝑆𝑖 ∩ 𝑂𝑗 2. Calculate the Marginal probability,
𝑷 𝑶𝒋 .
Local NS 0.55 x 51/55 = 0.51
𝑷 𝑶𝒋 = σ𝒌=𝒏
𝒌=𝟏 𝑷 𝑶𝒋 ห𝑺𝒌 ∙ 𝑷 𝑺𝒌
Success
(LS)
NF 0.45 9/45 0.09
0.6 → 𝑃 𝐿𝑆 = 0.6
Local NS 0.55 4/55 0.04 Sum of all the marginal
Failure probability is 1.
(LF)
NF 0.45 36/45 0.36
0.4 → 𝑃 𝐿𝐹 = 0.4

Your Logo or Name Here


23
3. Calculate the Posterior Probability, P(Si|Oj)

𝑷 𝑶𝒋 ห𝑺𝒊 𝑷 𝑺𝒊 → The joint probability, 𝑃 𝑆𝑖 ∩ 𝑂𝑗


𝑷 𝑺𝒊 ቚ𝑶𝒋 =
σ𝒌=𝒏
𝒌=𝟏 𝑷 𝑶𝒋 ห𝑺𝒌 𝑷 𝑺𝒌 → the Marginal probability, 𝑃 𝑂𝑗 .

𝑂𝑗 𝑆𝑖 𝑃 𝑆𝑖 𝑃 𝑶𝒋 ห 𝑺𝒊 𝑃 𝑆𝑖 ∩ 𝑂𝑗 𝑃 𝑆𝑖 ቚ𝑂𝑗

Local NS 0.55 51/55 0.51 0.85 𝑃 𝑁𝑆ȁ𝐿𝑆 𝑃 𝑁𝑆ȁ𝐿𝑆 = 0.51 : 0.6 = 0.85
Success
(LS)
NF 0.45 9/45 0.09 0.15 𝑃 𝑁𝐹 ȁ𝐿𝑆 𝑃 𝑁𝐹 ȁ𝐿𝑆 = 0.09 : 0.6 = 0.15

0.6 1
Local NS 0.55 4/55 0.04 0.1 𝑃 𝑁𝑆ȁ𝐿𝐹 𝑃 𝑁𝑆ȁ𝐿𝐹 = 0.04 : 0.4 = 0.1
Failure
(LF)
NF 0.45 36/45 0.36 0.9 𝑃 𝑁𝐹 ȁ𝐿𝐹 𝑃 𝑁𝐹 ȁ𝐿𝐹 = 0.36 : 0.4 = 0.9
0.4 1

Your Logo or Name Here


24
Terima Kasih
Yani Herawati
Program Studi Teknik Industri
UNPAR
yani.herawati@unpar.ac.id

You might also like