Transcript Chapter 4

Chapter 6
Probability
Mohamed Elhusseiny
[email protected]
Introduction
• This chapter introduced the basic concepts of
probability. It outlined rules and techniques for
assigning probabilities to events.
• One objective in his and the following chapters is to
develop the probability-based tools that are at the
basis of statistical inference.
• Probability can also play a critical role in decision
making
Assigning Probabilities to Events
•
Random Experiment
A random experiment is an action or process that
lead to one of several possible outcomes.
– Or is an experiment for which all possible outcomes are
known but the true one is not known before making the
experiment
•
Sample space
A sample space is the set of all possible outcome of a
random experiment.
Assigning Probabilities to Events
• Examples
– Flip or toss a coin one. The outcomes are S={ H , T}
– Flip or toss a coin twice. The outcomes are
S={ HH, HT, TH, TT}
– Record student evaluation of a course. The outcomes are
S={poor, fair, good, very good, Excellent}
– Flip or toss a coin three times. The outcomes are
S={ HHH, HHT, HTH, HTT, THH, THT, TTH, TTT }
Assigning Probabilities to Events
• The outcomes must be exhaustive ( all outcomes
must be included), and they must be mutually
exclusive ( no two outcomes can occur at the same
time)
• Example when tossing a die one the following are
not exhaustive outcomes 1 , 2 , 3 , 4, 5, 6
Requirement of probabilities
•
Given a sample space
S = { O1, O2,…,Ok}
The probabilities assigned to the outcomes must
satisfy the following
1.
0  P(Oi )  1
2.
 P(Oi ) 1
Events
• An Event is a subset of the sample space S
• Example: In tossing a die one, let A be the event of
having an outcome that is an even number and B be
the event of having an outcome that is at least 3, and
C the event of having a number greater than 5.
S={1,2,3,4,5,6}
and
A={2,4, 6}
B={3,4,5, 6}
C = { 6}
Simple events
Probability of an event
• The probability of an event is the ratio between the
number of element (simple event) in the event and
the total number of elements in the sample space.
Example: S = { 1 , 2 , 3 , 4 , 5 , 6 }
and
A={2,4, 6}
P(A) = 3 / 6
B={3,4,5, 6}
P(B) = 4 / 6
C = { 6}
P(C) = 1 / 6
Rules of Probability
• Addition Rule:
P(A  B) = P(A) + P(B) – P(A B)
P(A or B) = P(A) + P(B)
if A and B are mutually exclusive
• Multiplication Rule:
P(A  B) = P(A) · P(B)
• Complement Rule:
P( Ac ) = 1 – P(A)
if A and B are independent
Rules of Probability
• Example
In tossing a coin 3 times, let A be the event of
having exactly 2 heads, B the event of having at
most 2 heads and C the event of having no heads, D
no tails
A B={HHT, HTH, THH}
P(A)= 3 /8
Then
P(A B)=3/8
A = { HHT, HTH, THH}
P(C)=1/8 B = { HHT, HTH, THH, HTT, THT, TTH, TTT}
P(B)= 7 /8
C = { TTT}
D ={ HHH}
P(A  B) = P(A) + P(B) – P(A B)
Rules of Probability
C B={TTT}
P(A)= 3 /8
A = { HHT, HTH, THH}
P(C B)=1/8
B = { HHT, HTH, THH, HTT, THT, TTH, TTT}
P(B)= 7 /8
P(C)=1/8 C = { TTT}
• Example
P(A  C) = P(A) + P(B)
= 3/8 + 1/8 =4/8
P(C  B) = P(C) + P(B) – P(C B)
= 1/8 + 7/8 - 1/8 =7/8
Rules of Probability
• Example
A = { HHT, HTH, THH}
B = { HHT, HTH, THH, HTT, THT, TTH, TTT}
C = { TTT}
P(Ac) = 1 - P(A)
=1 - 3/8 = 5/8
P(Bc) = 1 - P(B)
=1 - 7/8 = 1/8
Rules of Probability
•
•
•
•
Example
A box containing 3 white balls, 4 black balls and 8
red balls.
What is the sample space if one ball is selected at
random
S = { W, B, R}
What is the sample space if two ball is selected at
random with replacement
S = { WW, WB, WR, BB, BW, BR, RR, RW, RB}
What is the sample space if two ball is selected at
random with replacement
S = { WB, WR, BW, BR, RW, RB}
Rules of Probability
•
•
Example
A box containing 3 white balls, 4 black balls and 8
red balls.
Two balls are selected at random what is the
probability that the first is red and the second is
white
With Replacement
P( R and W) = P( R  W) = (8/15) (3/15)
P( R and W) = P( R  W) = (8/15) (3/14)
Without Replacement
Rules of Probability
•
•
Example
A box containing 3 white balls, 4 black balls and 8
red balls.
Two balls are selected at random what is the
probability that the first is white and the second is
black
With Replacement
P( W and B) = P( W  B) = (3/15) (4/15)
P( W and B) = P( W  B) = (3/15) (4/14)
Without Replacement
Rules of Probability
•
•
Example
A box containing 3 white balls, 4 black balls and 8
red balls.
Two balls are selected at random what is the
probability that the one is white and the one is
black
With Replacement
P(One W and One B) =P( W and B) + P( B and W)
= (3/15) (4/15) + (4/15) (3/15)
P(One W and One B) =P( W and B) + P( B and W)
= (3/15) (4/14) + (4/15) (3/14)
Without Replacement
Marginal and Joint probability
• A company’s employees have been classified
according to age and salary, as shown in the
following table:
B1
P(A1(=35/100
B3
B2
A1
A3
B
P(A1 and B1(=32/100
A2
P(B1(=43/100
Marginal Probability
Joint Probability
P(B3(=26/100
Marginal and Joint probability
• One employee is selected at random, what is the
probability that he is between 30-45 years old
P(A2and B2(= 18/100
P(A2(= 49/100
B1
B
B3
B2
A1
A3
A2
Conditional probability
• It is the probability of one event given that the other
event has occurred. It is to know hoe two events are
related
• We would like to know for example what is the
performance of a female student will be.
Event B (Not Yet
Occurred)
EVANT A
(OCCURRED)
• The probability we look for is P( performance of a
student given that the student is female)
P( B and A)
Written P (B/A) where
P( B and A)  P( A) P( B / A)
P( B / A) 
P( A)
Conditional probability
• Example: One employee is selected at random and
found to be under 30 years old, what is the
probability that his salary is under $ 25,000
P( B3 and A1 ) 32 / 100 32
P( B3 / A1 ) 


P( A1 )
35 / 100 35
B
P ( B / A)
P(A1 and B1(=32/100
B1
B3
B2
A1
A3
A2
P(A1 (=35/100
Conditional probability
• Example: One employee is selected at random and
found to have a salary that between $25,000 and
$45,000, what is the probability that he is over 45 yr
old
P( A3 and B2 ) 10 / 100 10
P( A3 / B2 ) 


P( B2 )
31 / 100 31
B
P ( B / A)
P(A3 and B2(=10/100
B1
B3
B2
A1
A2
A3
P(B2 (=35/100
BAYES’ LAW
• Conditional probability is looking for the probability
of a particular event when one of its causes has
occurred. In many situations we may be interested
in finding the probability of a specific cause for this
particular event. ( A reverse thinking)
BAYES’ LAW
• Example: A computer chips manufactory has three
production lines to produce those chips. P1
(production line 1) produces 40% of the whole
production of the manufactory, P2 (production line
2) produces 35% of the whole production of the
manufactory, and P3 (production line 3) produces
25% of the whole production of the manufactory. It
is known that P1 produce 3% defective items, P2
produce 2% defective items, and P3 produce 1.5%
defective items. One item was drawn at random and
found to be defective. What is the probability that
this item was produces by P2.
BAYES’ LAW
• P(P1) = 0.40
• P(P2) = 0.35
• P(P3) = 0.25
P(D/P1) = 0.03
P(D/P2) = 0.02
P(D/P3) = 0.015
The required probability is P(P2/D)
P( D)  P( D / P1) P( A1)  P( D / P2) P( A2)  P( D / P3) P( A3)
P( D)  0.03  0.40  0.02  0.35  0.015  0.25  0.02275
P( P 2 and D) 0.02 0.35
P( P 2 / D) 

 0.3078
P( D)
0.02275