KEMBAR78
3 - Calculating Prob | PDF | Probability | Sampling (Statistics)
0% found this document useful (0 votes)
36 views130 pages

3 - Calculating Prob

1. There are 26 students total, with 14 economics majors and 15 first-year students. 7 students are neither. 2. To calculate the probability that a randomly selected student is both an economics major and first-year, we take the number that are both (which is the intersection of the two events) and divide by the total number of students. 3. Given that the student is first-year, the probability they are also an economics major is calculated by taking the number of first-year economics majors and dividing by the total number of first-year students.

Uploaded by

ngocbao123steam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views130 pages

3 - Calculating Prob

1. There are 26 students total, with 14 economics majors and 15 first-year students. 7 students are neither. 2. To calculate the probability that a randomly selected student is both an economics major and first-year, we take the number that are both (which is the intersection of the two events) and divide by the total number of students. 3. Given that the student is first-year, the probability they are also an economics major is calculated by taking the number of first-year economics majors and dividing by the total number of first-year students.

Uploaded by

ngocbao123steam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 130

Computing

Probability

1 / 104
Objectives
1 Use counting technique to calculate
probability of an event in a sample
space with equally likely outcomes
2 Calculate the probabilities of joint
events such as unions and intersections
from the probabilities of individual
events
3 Interpret and calculate conditional
probabilities of events
2 / 104
4 Determine the independence of events
and use independence to calculate
probabilities
5 Use multiple law to compute
probabilities of joint events
6 Use total law to compute probability
of event with divide - conquer strategy
7 Use Bayes’ theorem to calculate
conditional probabilities
3 / 104
Table of contents
1 Probability for equally likely out-
comes
2 Inclusion - Exclusion principle
3 Conditional probability
4 Independence
5 Multiplication formula and Tree
diagram
6 Total probability law
7 Bayes’ Theorem
4 / 104
Experiments with Equally
Likely Outcomes
Let S be a sample space consisting of
finite equally likely outcomes
• Probability of each outcome is
1
number of outcomes in Ω
• Probability of event E
number of outcomes in E
P(E) =
number of outcomes in Ω
5 / 104
Example

An urn contains eight white balls and


two green balls. A sample of three
balls is selected at random. What is
the probability of selecting only white
balls?

6 / 104
Solution
• The experiment consists of
selecting 3 balls from the
• The total number of outcomes is
n(Ω) = C(10, 3),
• E = “all three balls selected are
white.”
• the number of different samples
in which all are white is
n(E) = C(8, 3)

n(E) C(8, 3) 7
P(E) = = =
n(Ω) C(10, 3) 157 / 104
Practice
A toy manufacturer inspects boxes of
toys before shipment. Each box con-
tains 10 toys. The inspection proce-
dure consists of randomly selecting
three toys from the box. If any are de-
fective, the box is not shipped. Sup-
pose that a given box has two defec-
tive toys. What is the probability that
it will be shipped?

8 / 104
Practice
A batch of 140 semiconductor chips
is inspected by choosing a sample of
five chips. Assume 10 of the chips
do not conform to customer require-
ments.

Find probability that a sample of five


contain exactly one nonconforming chip

9 / 104
Table of contents
1 Probability for equally likely out-
comes
2 Inclusion - Exclusion principle
3 Conditional probability
4 Independence
5 Multiplication formula and Tree
diagram
6 Total probability law
7 Bayes’ Theorem
10 / 104
Inclusion - Exclusion
formula

P(A ∪ B) = P(A) + P(B) − P(A ∩ B)


If A and B are mutually exclusive (AB =
∅) then
P(A ∪ B) = P(A) + P(B)

11 / 104
Inclusion - Exclusion
formula

P(A ∪ B) = P(A) + P(B) − P(A ∩ B)


If A and B are mutually exclusive (AB =
∅) then
P(A ∪ B) = P(A) + P(B)

11 / 104
General Inclusion - Exclusion Formula
• P(A ∪ B ∪ C) =
P(A) + P(B) + P(C) − P(AB) −
P(BC) − P(CA) + P(ABC)

P(A1 ∪ A2 ∪ ... ∪ An)
=P(A1) + P(A2) + · · · + P(An)
X X
− P(AiA)j + P(AiAjAk )
i1 <ij i<j<k

+ · · · + (−1)n−1P(A1A2 . . . An)
12 / 104
Example
After being interviewed at two com-
panies he likes, John assesses that his
probability of getting an offer from
company A is 0.8, and his probability
of getting an offer from company B is
0.6. If he believes that the probability
that he will get offers from both com-
panies is 0.5, what is the probability
that he will get at least one offer from
these two companies?
13 / 104
Solution
Denote
• A: he gets offer from company
A
• B: he gets offer from company
B
We have
P(A) = 0.8, P(B) = 0.6, P(AB) = 0.5
We need to compute
P(A ∪ B)
14 / 104
Applying inclusion - exclusion for-
mula, we obtain
P(A ∪ B) = P(A) + P(B) − P(AB)
so
P(A ∪ B) = 0.8 + 0.6 − 0.5 = 0.9

15 / 104
Complement rule

P(A′) = 1 − P(A)

16 / 104
Example

A group of five people is to be se-


lected at random. What is the prob-
ability that two or more of them have
the same birthday? For simplicity, we
ignore February 29.

17 / 104
Solution
• Pick out five people, and
observe their birthdays. The
outcomes of this experiment are
strings of five dates,
corresponding to the birthdays.
For example, one outcome of
the experiment is (June 2, April
6, Dec. 20, Feb. 12, Aug. 5).
• the total number of possible
outcomes 3655
18 / 104
Solution
• Pick out five people, and
observe their birthdays. The
outcomes of this experiment are
strings of five dates,
corresponding to the birthdays.
For example, one outcome of
the experiment is (June 2, April
6, Dec. 20, Feb. 12, Aug. 5).
• the total number of possible
outcomes 3655
18 / 104
• E: two or more of 5 selected
people have the same birthday
• E′: all 5 people have different
birthdays
• Total number of outcomes in E′:
365.364.363.362.361
• P(E′) = 365.364.363.362.361
3655
≈ ...3
⇒ P(E) = 1 − P(E′) = ...

19 / 104
• E: two or more of 5 selected
people have the same birthday
• E′: all 5 people have different
birthdays
• Total number of outcomes in E′:
365.364.363.362.361
• P(E′) = 365.364.363.362.361
3655
≈ ...3
⇒ P(E) = 1 − P(E′) = ...

19 / 104
• E: two or more of 5 selected
people have the same birthday
• E′: all 5 people have different
birthdays
• Total number of outcomes in E′:
365.364.363.362.361
• P(E′) = 365.364.363.362.361
3655
≈ ...3
⇒ P(E) = 1 − P(E′) = ...

19 / 104
• E: two or more of 5 selected
people have the same birthday
• E′: all 5 people have different
birthdays
• Total number of outcomes in E′:
365.364.363.362.361
• P(E′) = 365.364.363.362.361
3655
≈ ...3
⇒ P(E) = 1 − P(E′) = ...

19 / 104
Practice

An urn contains eight white balls and


two green balls. A sample of three
balls is selected at random. What is
the probability that the sample con-
tains at least one green ball?

20 / 104
Exercise
A customer will invest in tax-free bonds
with a probability of 0.6, will invest
in mutual funds with a probability of
0.3, and will invest in both tax-free
bonds and mutual funds with a prob-
ability of 0.15. Find the probability
that a customer will invest
1 in either tax-free bonds or
mutual funds;
2 in neither tax-free bonds nor
mutual funds.
21 / 104
Table of contents
1 Probability for equally likely out-
comes
2 Inclusion - Exclusion principle
3 Conditional probability
4 Independence
5 Multiplication formula and Tree
diagram
6 Total probability law
7 Bayes’ Theorem
22 / 104
Conditional probability provides us with a
way to reason about the outcome of an ex-
periment, based on partial information.
Example
In an experiment involving two successive
rolls of a fair die, you are told that the sum
of the two rolls is 9. How likely is it that the
first roll was a 6?

23 / 104
Conditional probability provides us with a
way to reason about the outcome of an ex-
periment, based on partial information.
Example
In an experiment involving two successive
rolls of a fair die, you are told that the sum
of the two rolls is 9. How likely is it that the
first roll was a 6?

23 / 104
• Restrict possible outcomes on
new sample space
{(3, 6), (4, 5), (5, 4), (6, 3)}
• First roll was 6 = {(6, 3)}
• the probabililty is equal to
1
4 = 0.25
24 / 104
Example
Select randomly one out of the 10 balls and
then, without returning this to the box, we
take another one.

What is the prob that the second ball is blue


if the first ball is white? 4 25 / 104
Example
Select randomly one out of the 10 balls and
then, without returning this to the box, we
take another one.

What is the prob that the second ball is blue


if the first ball is white? 4 25 / 104
Example
A class contains 26 students. Of these,
14 are economics majors, 15 are first-
year students, and 7 are neither. A
person is selected at random from the
class.
1 What is the probability that the
person is both an economics ma-
jor and a first- year student?
2 Given that the person selected
is a first-year student. What is
the probability that he or she is
also an economics major? 26 / 104
Solution
let E: economic students
let F: first-year students
P(EuF) = P(E) +P(F) - P(EnF) = 14 + 15 - (26-7)=10
a) P(EuF)/P(S) = 10/26 = 5/13
b) P(EuF)/P(E) = (5/13) / (15/26)
5
1
13
2
2
3

27 / 104
• 2 events A and B
• If we know for sure that A
happens, how does the
likelihood of B change?
seek to construct a new probability
law, which takes into account this knowl-
edge and which, for any event A, gives
us the conditional probability of B given
A, denoted by P(B|A)

28 / 104
• 2 events A and B
• If we know for sure that A
happens, how does the
likelihood of B change?
seek to construct a new probability
law, which takes into account this knowl-
edge and which, for any event A, gives
us the conditional probability of B given
A, denoted by P(B|A)

28 / 104
• 2 events A and B
• If we know for sure that A
happens, how does the
likelihood of B change?
seek to construct a new probability
law, which takes into account this knowl-
edge and which, for any event A, gives
us the conditional probability of B given
A, denoted by P(B|A)

28 / 104
Conditional Probability
The conditional probability of B given
A, denoted by P(B|A), is defined by
P(AB)
P(B|A) =
P(A)
if P(A) > 0
Measure the likelihood of B in the new
sample space A
29 / 104
Conditional Probability
The conditional probability of B given
A, denoted by P(B|A), is defined by
P(AB)
P(B|A) =
P(A)
if P(A) > 0
Measure the likelihood of B in the new
sample space A
29 / 104
Meaning
Conditional probability provides the
capability of reevaluating the idea of
probability of an event in light of ad-
ditional information, that is, when it
is known that another event has oc-
curred. The probability P(A|B) is
an updating of P(A) based on the
knowledge that event B has occurred.

30 / 104
Properties
1 Complement rule
P(Bc|A) = 1 − P(B|A)
2 Additive rule
P(B∪C|A) = P(B|A)+P(C|A)−P(BC|A)

31 / 104
Example
Twenty percent of the employees of
Acme Steel Company are college grad-
uates. Of all of its employees, 20%
are college graduate and 15% are col-
lege graduates earning more than $50,000
What is the probability that an em-
ployee selected at random earns more
than $50,000 per year, given that he
or she is a college graduate?

32 / 104
Solution
• H = “earns more than $50,000
per year”
• C = “college graduate.”
• We need to compute P(H|C)
• Given data P(C) = 0.2,
P(H ∩ C) = 0.15

P(H ∩ C) 0.15
P(H|C) = = = 0.75
P(C) 0.2
33 / 104
Practice
The probability that a regularly sched-
uled flight departs on time is P(D) =
0.83; the probability that it arrives on
time is P(A) = 0.82; and the prob-
ability that it departs and arrives on
time is P(A ∩ D) = 0.78. Find the
probability that a plane
1 arrives on time, given that it
departed on time
2 departed on time, given that it
has arrived on time.
34 / 104
Interpretation

In the group of employees which are


college graduate, there are 75% earn
more than $50,000 per year

35 / 104
Example
Education Male Female
Elementary 38 45
Secondary 28 50
College 22 17
If a person is picked at random from
this group, find the probability that
the person is a male, given that the
person has a secondary education.
36 / 104
Question: find the probability that
the
| person
{zis a male},
A: interested event
given that
|the person has a secondary
{z education}
B: addition information - condition or new sample space
Find
P(AB)
P(A|B) =
P(B)

37 / 104
Question: find the probability that
the
| person
{zis a male},
A: interested event
given that
|the person has a secondary
{z education}
B: addition information - condition or new sample space
Find
P(AB)
P(A|B) =
P(B)

37 / 104
Solution - 1st approach
• Sample size: number of ways to pick a
person randomly is
|Ω| = 38+45+28+50+22+17 = 200
• Convert data into probability

Education Male Female Sum


38
Elementary 200 = .19 .225
Secondary .14 .25 .39
College .11 .085 .195
Sum .44 .56 138 / 104
Education Male Female Sum
Elementary .19 .225
Secondary .14 .25 .39
= P(AB) = P(B)
College .11 .085 .195
Sum .44 .56 1
P(AB) .14
P(A|B) = =
P(B) .39
39 / 104
Solution - 2nd approach
• New sample space is B with 78
elements
• In new sample space, the
number of ways to pick a male
is 28
• The probability that the person
is a male, given that the person
has a secondary education is
28
≈ 0.36
78
40 / 104
Intepretation

Among all the person with secondary


education, the fraction of male is 36%

41 / 104
Practice
400 parts classified by surface flaws
and as (functionally) defective

Select randomly a part. Find the prob-


ability that the selected part is defec-
tive given that
1 the part with surface flaws
2 the part without surface flaws
42 / 104
Example

A fair coin is flipped twice. what is


the conditional probability that both
flips land on heads, given that
(a) the first flip lands on heads?
(b) at least one flip lands on heads?

43 / 104
Solution for (a)
• A = {HH} (both head)
• F = {HH, HT} (first is head)

P(AF) P({HH})
P(A|F) = =
P(F) P({HH, HT})
1/4 1
= =
2/4 2

44 / 104
Solution for (b)
• B = {HH, HT, TH} (at least one
head)
P(AB)
P(A|B) =
P(B)
P({HH}) 1
= =
P({HH, HT, TH}) 3

45 / 104
Practice
Toss a fair coin twice. Compute
P(2nd toss is head)
and
P(2nd toss is head | 1st toss is head)

46 / 104
Comment
1 1
P(A) = while P(A|B) = ̸= P(A)
4 3
indicates that A depends on B
P(2nd toss is Head|1st toss is Head)
1
= P(2nd coin is Head) =
2
Result of the 2nd toss does not the de-
pend of the 1st toss result
47 / 104
Comment
1 1
P(A) = while P(A|B) = ̸= P(A)
4 3
indicates that A depends on B
P(2nd toss is Head|1st toss is Head)
1
= P(2nd coin is Head) =
2
Result of the 2nd toss does not the de-
pend of the 1st toss result
47 / 104
Idea

• Usually P(A|B) ̸= P(A).


• If P(A|B) = P(A), B has no
effect on A or knowing B does
not change the probability that
A happens then
• A and B have no relation

48 / 104
Idea

• Usually P(A|B) ̸= P(A).


• If P(A|B) = P(A), B has no
effect on A or knowing B does
not change the probability that
A happens then
• A and B have no relation

48 / 104
Idea

• Usually P(A|B) ̸= P(A).


• If P(A|B) = P(A), B has no
effect on A or knowing B does
not change the probability that
A happens then
• A and B have no relation

48 / 104
Table of contents
1 Probability for equally likely out-
comes
2 Inclusion - Exclusion principle
3 Conditional probability
4 Independence
5 Multiplication formula and Tree
diagram
6 Total probability law
7 Bayes’ Theorem
49 / 104
Independent events

A and B are independent if


P(A|B) = P(A)
or
P(AB) = P(A)P(B).

50 / 104
Complement

If A is independent of B then it is in-


dependent of Bc.

51 / 104
Example
Two successive rolls of a fair 6-sided
die

A: the 1st roll results in 2

B: the 2nd roll results in 4

Are A and B independent?

52 / 104
Solution

• P(A) = 61
• P(B) = 16
• 1
P(AB) = 36 = P(A)P(B)
• A and B are independent

53 / 104
Practice

Suppose that P(A|B) = 0.4, P(B) =


0.8 and P(A) = 0.5. Are A and B are
independent?

54 / 104
Practice
400 parts classified by surface flaws
and as (functionally) defective

Select randomly a part. Let


D = ”the part is defective”
F = ”the part has surface flaw”
Are D and F independent? 55 / 104
Independence of a set of
events
A set of events is said to be indepen-
dent if, for each collection of events
chosen from them, say, E1, E2, ..., En,
we have
P(E1 ∩ · · · ∩ En) = P(E1) . . . P(En)

56 / 104
Example

Three events A, B, and C are inde-


pendent: P(A) = .5, P(B) = .3, and
P(C) = .2.
1 Calculate P(A ∩ B ∩ C).

2 Calculate P(A ∩ C).

57 / 104
Example
A company manufactures stereo com-
ponents. Experience shows that de-
fects in manufacture are independent
of one another. Quality-control stud-
ies reveal that
2% of CD players are defective,
3% of amplifiers are defective,
7% of speakers are defective.
A system consists of a CD player, an
amplifier, and two speakers. What is
the probability that the system is not
defective? 58 / 104
Example

• A series system is up if all of its


component is up
• Components operate
independently
• pi: prob that component i is up
• Prob that series system is up:
p1p2...pn
59 / 104
Example
A parallel system is up if any one of
its component is up

Assume that all component operates


independently
60 / 104
• pi: probability that component i
is up
• Probability that the parallel
system is down:
(1 − p1)(1 − p2)...(1 − pn)
• Probability that the parallel
system is up:
1 − (1 − p1)(1 − p2)...(1 − pn)

61 / 104
• pi: probability that component i
is up
• Probability that the parallel
system is down:
(1 − p1)(1 − p2)...(1 − pn)
• Probability that the parallel
system is up:
1 − (1 − p1)(1 − p2)...(1 − pn)

61 / 104
• pi: probability that component i
is up
• Probability that the parallel
system is down:
(1 − p1)(1 − p2)...(1 − pn)
• Probability that the parallel
system is up:
1 − (1 − p1)(1 − p2)...(1 − pn)

61 / 104
Example
An electronic system consists of 4 in-
dependent components. Find the prob-
ability that entire system works.

62 / 104
Solution
• Probability that the subsystem
CD in parallel is up
pCD = 1 − (1 − pC )(1 − pD)
= 1 − (1 − .8)(1 − .8) = .96
• Probability that the whole
system is up
pApBpCD = (.9)(.9)(.96) =
63 / 104
Table of contents
1 Probability for equally likely out-
comes
2 Inclusion - Exclusion principle
3 Conditional probability
4 Independence
5 Multiplication formula and Tree
diagram
6 Total probability law
7 Bayes’ Theorem
64 / 104
Multiplication Formula

P(AB) = P(B|A)P(A).
Think of AB as event with 2 steps,
then probability equals probability of
first step multiply with the conditional
probability of second step given first
step

65 / 104
Example
Draw 2 balls without replacement from
the box.

What is the probability that both balls


are white?
66 / 104
Solution

• Ai: the ith draw is white


• 6
P(A1) = 10
• P(A2|A1) = 59
• P(A1A2) = P(A1)P(A2|A1) =
6 5 1
10 9 = 3

67 / 104
Multistep
Sequence of events A1, A2, . . . , Ak
P(A1A2 . . . Ak ) =P(A1) × P(A2|A1) × P(A
× P(Ak |A1 . . . Ak−1)

68 / 104
Example - Qualify control
A box contains five good lightbulbs
and two defective ones.
Bulbs are selected one at a time (with-
out replacement) until a good bulb is
found. Find the probability that the
number of bulbs selected is

(i) one, (ii) two, (iii) three.

69 / 104
Solution
A bulb selected at
Initial random will be
situation
• good (G) with
probability 57
• defective (D)
with probability
2
7

70 / 104
Situation if the first selected bulb
is defective

The second bulb


selected at random
will be
• good (G) with
probability 56
• defective (D)
with probability
1
6
71 / 104
Situation if the first and second se-
lected bulbs are defective

The third bulb


selected at random
will be
• good (G) with
probability 1
• defective (D)
with probability
0
72 / 104
Each of the three paths leading to a G
has a different length.
5
(i) P(1) =
7
2 5 5
(ii) P(2) = . =
7 6 21
2 1 1
(iii) P(3) = . .1 =
7 6 21
73 / 104
Practice
A lot of 100 semiconductor chips con-
tains 20 that are defective.

Three are selected, at random, with-


out replacement, from the lot. Deter-
mine the probability that all are de-
fective.

74 / 104
Practice

Suppose that P(A|B) = 0.4, P(B) =


0.5. Determine
1 P(A ∩ B)

2 P(A ∩ B)

75 / 104
Practice
The probability that the head of a house-
hold is home when a telemarketing
representative calls is 0.4. Given that
the head of the house is home, the
probability that goods will be bought
from the company is 0.3. Find the
probability that the head of the house
is home and goods are bought from
the company.

76 / 104
Table of contents
1 Probability for equally likely out-
comes
2 Inclusion - Exclusion principle
3 Conditional probability
4 Independence
5 Multiplication formula and Tree
diagram
6 Total probability law
7 Bayes’ Theorem
77 / 104
Partition
A1, . . . , An is a partition of Ω if
• mutually exclusive: AiAj = ∅ for i ̸= j
• A1 ∪ A2 ∪ . . . An = Ω

BA1, . . . , BAn is a partition of B


B = BA1 ∪ BA2 ∪ ... ∪ BAn 78 / 104
Partition
A1, . . . , An is a partition of Ω if
• mutually exclusive: AiAj = ∅ for i ̸= j
• A1 ∪ A2 ∪ . . . An = Ω

BA1, . . . , BAn is a partition of B


B = BA1 ∪ BA2 ∪ ... ∪ BAn 78 / 104
Total probability formula -
divide - and - conquer
• Partition sample space into A1,
A2 , . . . , An
• Know P(B|Ai) for every i
• Compute P(B)
X n
P(B) = P(BAi)
i=1
Xn
= P(B|Ai)P(Ai) 79 / 104
Example
Select randomly one out of the a box
of 6 blue balls and 4 green balls. Then
without returning this to the box, we
take another one.

What is the probability that the sec-


ond ball is blue?

80 / 104
Solution

Denote
• B2: the second ball is blue
• G1: the first ball is green
• B1: the first ball is blue
We need to compute P(B2).

81 / 104
There are two possible cases that the
2nd ball is blue
B2 = (B1G1) ∪ (B2G2)
By total law,
P(B2) = P(B2 ∩ G1) + P(B2 ∩ B1)
= P(G1)P(B2|G1) + P(B1)P(B2|B1)
4 6 6 5 54
= × + × = = 0.6
10 9 10 9 90
82 / 104
Example
You enter a chess tournament where your prob-
ability of winning a game is 0.3 against half
the players (call them type 1), 0.4 against
a quarter of the players (call them type 2),
and 0.5 against the remaining quarter of the
players (call them type 3). You play a game
against a randomly chosen opponent. What
is the probability of winning?

83 / 104
Solution
• Ai: your opponent is of type i
• W: you win
• The event that you win can be
divided into three cases
according to the type of your
opponent
W = (A1W) ∪ (A2W) ∪ (A2W)

84 / 104
P(Ai) P(W|Ai) P(AiW)
1 1
2 0.3 2 (0.3) = 0.15
1 1
4 0.4 4 (0.4) = 0.1
1 1
4 0.5 4 (0.5) = 0.125

P(W) = 0.15 + 0.16 + 0.2 = 0.375

85 / 104
Example
In a certain assembly plant, three machines,
B1, B2, and B3, make 30%, 45%, and 25%,
respectively, of the products. It is known
from past experience that 2%, 3%, and 2% of
the products made by each machine, respec-
tively, are defective. Now, suppose that a fin-
ished product is randomly selected. What is
the probability that it is defective?

86 / 104
Solution
Denote
• A: the selected product is
defective
• Bi: the selected product is made
by machine Bi
The event that the selected product
is defective can be divided into three
cases according to which machine made
it
A = (AB1) ∪ (AB2) ∪ (AB3)
87 / 104
• P(AB1) = P(B1)P(A|B1) =
(.3)(.02) = .006
• P(AB2) = P(B2)P(A|B2) =
(.45)(.03) = .0135
• P(AB3) = P(B1)P(A|B1) =
(.25)(.02) = .005
So P(A) = P(AB1)+P(AB2)+P(AB3) =
0.0245

88 / 104
Re-evaluate

if a product was chosen randomly and


found to be defective, what is the prob-
ability that it was made by machine
B3 ?

89 / 104
Solution

P(B3A)
P(B3|A) =
P(A)
0.005 10
= =
0.0245 49

90 / 104
Table of contents
1 Probability for equally likely out-
comes
2 Inclusion - Exclusion principle
3 Conditional probability
4 Independence
5 Multiplication formula and Tree
diagram
6 Total probability law
7 Bayes’ Theorem
91 / 104
Bayes’ Theorem
• B1 , B2 , . . . , Bn
are mutually
exclusive
• B1 ∪ B2 ∪ · · · ∪
Bn = S
P(Bk )P(A|Bk )
P(Bk |A) =
P(B1)P(A|B1) + · · · + P(Bn)P(A|Bn)
for k = 1, 2, . . . , n
92 / 104
Meaning
• Prior probability P(Bi) - initial
belief
• Know P(A|Bi) for each i
• Given A occurs, wish to revise
(update) ”belief” P(Bk |A)
P(A|Bk )P(Bk )
P(Bk |A) = Pn
i=1 P(A|Bi )P(Bi )

93 / 104
Bayes’ rule is often used for infer-
ence. There are a number of “causes”
that may result in a certain “effect.”
We observe the effect, and we wish
to infer the cause

94 / 104
Exercise
There is 0.25% of the general pop-
ulation suffer from Covid. To diag-
nose whether someone suffers from
Covid, there is a medical examina-
tion which has a probability 1% of
giving a false result if someone has
Covid and 2% if someone does not
have Covid. If we select at random
a person from the general population
and he/she tests positive for Covid,
what is the probability that this per-
son actually suffers from Covid?
95 / 104
Exericse
A contestant on a television show has
to answer multiple choice questions
with four possible answers. The prob-
ability that the contestant knows the
answer to a question is 75%. If the
contestant does not know the answer
to a particular question, she gives an
answer at random. If she has answered
the first question correctly, what is the
probability that she knew the answer?
96 / 104
Example
A plane is missing and it was equally likely
to have gone down in any of three possible
regions. Let 1 − αi denote the probability the
plane will be found upon a search of the i-
th region when the plane is, in fact, in that
region, i = 1, 2, 3. What is the conditional
probability that the plane is in the i-th region,
given that a search of region 1 is unsuccess-
ful, i = 1, 2, 3?
97 / 104
Solution

• Ai={the plane is in region i}


• B={search of region 1 was
unsuccessful}
• Need P(Ai|B) =?

98 / 104
Solution

• Ai={the plane is in region i}


• B={search of region 1 was
unsuccessful}
• Need P(Ai|B) =?

98 / 104
Solution

• Ai={the plane is in region i}


• B={search of region 1 was
unsuccessful}
• Need P(Ai|B) =?

98 / 104
Solution
Need to find
P(AiB) and P(B)
with information
• P(Ai) = 31

P( plane is found in region i|Ai) =
1−α

99 / 104
Solution
P(A1B) =?
A1B means that
• Plane is in region 1
• Search in region 1 was
unsuccessful = plane was not
found in region 1
1 α1
P(A1B) = P(A1)P(B|A1) = ∗α1 =
3 3
100 / 104
Solution
P(A1B) =?
A1B means that
• Plane is in region 1
• Search in region 1 was
unsuccessful = plane was not
found in region 1
1 α1
P(A1B) = P(A1)P(B|A1) = ∗α1 =
3 3
100 / 104
Solution
P(A1B) =?
A1B means that
• Plane is in region 1
• Search in region 1 was
unsuccessful = plane was not
found in region 1
1 α1
P(A1B) = P(A1)P(B|A1) = ∗α1 =
3 3
100 / 104
Solution
A2B means that
• Plane is in region 2
• Search in region 1 was
unsuccessful = plane was not
found in region 1
1 1
P(A2B) = P(A2)P(B|A2) = ∗ 1 =
3 3

101 / 104
Solution
A2B means that
• Plane is in region 2
• Search in region 1 was
unsuccessful = plane was not
found in region 1
1 1
P(A2B) = P(A2)P(B|A2) = ∗ 1 =
3 3

101 / 104
Solution
A3B means that
• Plane is in region 3
• Search in region 1 was
unsuccessful = plane was not
found in region 1
1 1
P(A3B) = P(A3)P(B|A3) = ∗ 1 =
3 3

102 / 104
Solution
A3B means that
• Plane is in region 3
• Search in region 1 was
unsuccessful = plane was not
found in region 1
1 1
P(A3B) = P(A3)P(B|A3) = ∗ 1 =
3 3

102 / 104
Solution

P(B) =P(A1B) + P(A2B) + P(A3B)


1 1 1
=α1 × + 1 × + 1 ×
3 3 3
α1 + 2
=
3

103 / 104
Solution

P(B) =P(A1B) + P(A2B) + P(A3B)


1 1 1
=α1 × + 1 × + 1 ×
3 3 3
α1 + 2
=
3

103 / 104
Solution
P(A1B) α1
P(A1|B) = =
P(B) α1 + 2
P(A2B) 1
P(A2|B) = =
P(B) α1 + 2
P(A3B) 1
P(A3|B) = =
P(B) α1 + 2
104 / 104
Solution
P(A1B) α1
P(A1|B) = =
P(B) α1 + 2
P(A2B) 1
P(A2|B) = =
P(B) α1 + 2
P(A3B) 1
P(A3|B) = =
P(B) α1 + 2
104 / 104
Solution
P(A1B) α1
P(A1|B) = =
P(B) α1 + 2
P(A2B) 1
P(A2|B) = =
P(B) α1 + 2
P(A3B) 1
P(A3|B) = =
P(B) α1 + 2
104 / 104

You might also like