Probability: the study of randomness

Download Report

Transcript Probability: the study of randomness

Probability
1
Today’s plan
Probability
• Notations
• Laws of probability
2
Set Notation
Sample space
All possible outcomes of an experiment
Example: You are playing a roulette with 100 numbers
Set S consists of each of the 100 possible outcomes labeled
1,2,…100: S={1,2,…,100} This is the sample space
Examples of sample space:
• Toss a coin once S={H,T}
• Roll a dice once S={1,2,3,4,5,6}
• Toss a coin twice S={HH,HT,TH,TT}
• Gender of a baby S={boy,girl}
• All letters of the alphabet S={a,b,c,…,z}
3
Set Notation
Event
A subset of the sample space
S={1,2,3,4,5,6}
Subset A is the odd numbers A={1,3,5}
A is a subset of S: AS
• 3 is an element of A: 3A
4
Example of an event
Event A = getting exactly one head when
tossing a coin twice
S={HH,HT,TH,TT}
A={HT,TH}
5
Venn diagram
• A tool for describing relations between sets
S
B
A
6
Venn diagram
Sample space: S={1,2,3,4,5,6}
A={1,3,5}
B={2,4}
S
A
B
7
Venn diagram
Sample space: S={1,2,3,4,5,6}
A={1,3,5}
B={1,2,4}
S
A
B
8
Complement of a set
A = Complement of A. Includes all
outcomes in S that are not in A
Also denoted by Ac
S
A
A
•  = An empty set
S  ?
9
Example:
S={1,2,3,4,5,6}
A={1,3,5}
S
A
A
A  {2,4,6}
10
Union of sets
A  B is the union of sets A and B.
– The set of outcomes that are in A or B.
– The event that either A, B, or both occur.
S
A
B
Dice example:
S={1,2,3,4,5,6}
A={1,3,5}
B={1,2}
A  B  {1,2,3,5}
11
Example
S={1,2,3,4,5,6,7,8,9}
A={2,4,6,8}
B={1,3,5,9}
C={1,2,3}
AUC= {1,2,3,4,6,8}
AUB= {1,2,3,4,5,6,8,9}
AUBc= {2,4,6,7,8}
AUCc={2,4,5,6,7,8,9}
12
Intersection of sets
A  B is the intersection of sets A and B.
– The set of outcomes that are in A and B.
– The event that both A and B occur.
S
A
A B
B
Dice example:
S={1,2,3,4,5,6}
A={1,3,5}
B={1,2}
A  B  {1}
13
Example
S={1,2,3,4,5,6,7,8,9}
A={2,4,6,8}
B={1,3,5,9}
C={1,2,3}
A∩B= 
A∩C= {2}
A∩Bc= {2,4,6,8}
Ac∩C= {1,3}
14
Disjoint sets
A and B are disjoint sets if A  B  
S
A
B
15
Example:
• S={1,2,3,4,5,6}
• A={1,2,3}
• B={4,5}
A B  
16
Events have probability
• S={1,2,3,4,5,6}
• A={1,2,3}
What is the probability of A?
P(A) = 3/6 = 0.5
17
Probability as a Relative Frequency
(occurrence “in the long run”)
Tossing a coin:
The relative frequency of
occurrences of an event A,
should approach the
probability P(A), as the
number of trials grows
(when the trials are random
and independent of each
other).
18
Probability as ratio of sizes
• The probability of an event A:
number of elements in A
P( A) 
number of elements in S
Roulette example: S  {1,2,3,,100}
A={1,13}
2
 P( A) 
100
19
Example:
• A letter is chosen at random from the word
PROFIT. What is the probability that it is a vowel?
• S – {P,R,O,F,I,T}
• A – a vowel = {O,I}
2
P ( A)   0.333
6
20
Example:
A stack contains eight tickets numbered 1,1,1,2,2,3,3,3. One ticket will
be drawn at random, and its number will be noted.
a.
List the sample space and assign probabilities to the elementary
outcomes
S={1,1,1,2,2,3,3,3}
p(1)=3/8 p(2)=2/8=0.25 p(3)=3/8
b.
What is the probability of drawing an odd numbered ticket?
A – odd numbered ticket
# of elements in A 6
P( A) 
  0.75
# of elements in S 8
21
Probability Rules
1. Any probability is a number between 0
and 1.
0  P( A)  1
For any event A,
A=head when tossing a coin once
P(A)=0.5 for a fair coin
22
Probability Rules
2. All possible outcomes together must have
probability 1.
For the sample space S,
PS   1
S={1,2,3,4,5,6}
p(S)=1
23
Blood types example
Blood type
O
A
B
AB
probability
0.49
0.27
0.20
?
What is the probability of type AB blood?
S={O,A,B,AB}
All probabilities must sum to 1
0.49+0.27+0.20=0.96 
p(AB)=1-0.96=0.04
24
Probability Rules
3. The probability that an event does not occur is
1 minus the probability that the event does occur.
Ac is the complement of A – the event that A does not
occur
p(Ac)=1-p(A)
• Other notation for complement:
PA   1  P( A)
25
Example:
when throwing a dice:
A={1,3} Ac={2,4,5,6}
p(Ac) = 1-p(A) = 1-2/6 = 4/6
26
Example:
when tossing a coin:
A=head Ac=tail
p(Ac) = 1-p(A) = 1-0.5 = 0.5
27
Example:
Choose an acre of land in Canada at random. The
probability is 0.35 that it is forest.
What is the probability that the acre chosen is not forest?
A – forest
Ac – not forest
p(A)=0.35
P(Ac)=1-p(A)=1-0.35=0.65
28
Probability Rules
4. The probability that a empty set occurs is zero
P   0
29
Example:
• S={1,2,3,4,5,6}
• A={1,2,3}
• B={4,5}
0
P(A∩B)=?
A∩B= 
30
The additive law of probability
for disjoint events
When A and B are disjoint
S
A
B
P( A  B)  P( A)  P( B)
31
The additive law of probability
P( A  B)  P( A)  P( B)  P( A  B)
S
A B
A
B
Dice example:
S  {1,2,3,4,5,6}
A={1,3} B={1,4,6}
2 3 1 4
P( A  B)    
6 6 6 6
32
Example: The additive rule
• A student is randomly selected from a class.
• Known facts about the class:
– 35% of the students are left-handed.
– 51% of the students are juniors.
– There is a probability of 0.1 of observing a left-handed
junior.
• What is the probability that the selected student
is either left-handed or a junior?
33
What is the sample space?
Left-handed
junior
S
junior
Lefthanded
34
Example – cont.
• Define the events:
Left-handed
junior
– A is “junior”
– B is “left-handed”
• Known: p(A)= 0.51
p(B)= 0.35
p(A B)= 0.1
S
junior
Lefthanded
• P(junior or left-handed) =
P( A  B)  P( A)  P( B)  P( A  B) 
 0.51  0.35  0.1  0.76
35
Blood types example
Blood type
probability
O
0.49
A
0.27
B
0.20
AB
0.04
Draw a person at random from this population.
What is the probability that the person chosen has type O blood?
Answer: p(O)=0.49
What is the probability that the person chosen has either type A or
type B blood?
Answer: the 2 events “having type A”, “having type B” are disjoint
since no person can have both blood types.
Addition rule  p(A or B)=p(A)+p(B)=0.27+0.20=0.47
36
Blood types example - cont.
Blood type
O
A
B
AB
probability
0.49
0.27
0.20
?
3. Mary has type B blood. She can safely receive blood transfusion from
people with blood types O and B. what is the probability that a randomly
chosen person can donate blood to Mary?
p(OUB)=?
The events “type O” and “type B” are disjoint, and therefore
p(O B)  p(O) p(B)  0.49 0.20 0.69
37
Engineering example
• Fuses are handled by one of three machines:
M1, M2, M3
– Machine M1 yields 200 fuses per hour
– Machine M2 yields 250 fuses per hour
– Machine M3 yields 350 fuses per hour
• After an hour, the fuses are mixed together, and
one is selected at random.
• What is the probability that the fuse was
produced by machine M3?
38
Engineering example – cont.
• Let Ai be the event “the chosen fuse is
from machine M i ” (i=1,2,3)
200
P( A1 ) 
 0.25
800
250
P( A2 ) 
 0.3125
800
350
P( A3 ) 
 0.4375
800
39
Sets: Reminder
• Set S – sample space - includes all possible outcomes
• AS (subset of S)
A
• A= complement of A
• Intersection
• Union
AB
AB
A
S
S
(A and B)
A
A B
B
(A or B)
40
Probability Rules
1.
Any probability is a number between 0 and 1
For any event A, 0  p(A)  1
2.
All possible outcomes together must have probability 1:
3.
The probability that an event does not occur is 1 minus
the probability that the event does occur.
pS  1
p(Ac)=1-p(A)
4.
The probability that a empty set occurs is zero
p( )  0
41
Assigning probability to equally likely
outcomes
Example
Find the probability of obtaining an even number in one roll
of a die
Answer:
There are 6 equally likely outcomes: 1,2,3,4,5,6
S={1,2,3,4,5,6}
A={an even number is observed on the die} = {2,4,6}
# of outcomes in A 3
P ( A) 
  0.5
# of outcomes in S 6
The probability of an odd number = Ac.
P(Ac)=1-p(A)=0.5
42
The additive law of probability
P( A  B)  P( A)  P( B)  P( A  B)
S
A B
A
B
Die example:
S  {1,2,3,4,5,6}
A={1,3} B={1,4,6}
2 3 1 4
P( A  B)    
6 6 6 6
43
Example
Let A be the event that a student gets an A in an exam,
and let F be the event that a student is female. Suppose
p(A)=.25 and p(F)=.40, and p(A F)=.10.
Find p(A F).
Answer:
if we simply add p(A) and p(F) we will be counting the
overlap p(A F) twice.
Therefore:
p(A F) = p(A)+p(F)-p(A F)=
=.25+.40-.1=.55
44
Example - continued
Say the probability of getting an A on the exam is .25
and the probability of getting a B is .30.
Now find p(A B)
Answer:
The events A and B are disjoint (also called
mutually exclusive), so:
p(A B) =p(A) + p(B) = .25+.30=.50
This is just a special case of the addition law,
where p(A B) is 0.
45
Independence and the multiplication rule
Example - penicillin
The probability that a patient is allergic to penicillin is 0.20. Suppose
this drug is administered to 2 patients. What is the probability that
both patients are allergic to penicillin?
Answer:
A=one of the patients is allergic to penicillin
B=the other patient is allergic to penicillin
P(A)=0.2
P(B)=0.2
What event are we looking for?
P( A  B)  ?
46
Independence and the multiplication rule
Two events are independent if knowing that one occurs
does not change the probability the other occurs.
If A and B are independent:
P( A  B)  P( A)  P( B)
A and B
This is the multiplication rule for independent events.
47
Back to our penicillin example:
In our example the two events are independent, since
knowing that one patient is allergic doesn’t change the
probability that the other patient is allergic.
P(A B)  p(A) p(B)  0.2  0.2  0.04
48
Example:
A general can plan a campaign to fight one major battle
or three small battles. He Believes that he has probability
0.6 of winning the large battle and probability of 0.8 of
winning each of the small battles. Victories or defeats
in the small battles are independent. The general
must win either the large battle or all three small battles
to win the campaign. Which strategy should he choose?
Answer:
A-winning the large battle p(A)= 0.6
Bi=winning a small battle i p(Bi)= 0.8 for each i
p(B1)=0.8
p(B2)=0.8
p(B3)=0.8
What are we looking for?
p(B1 B2 B3)=?
Since B1,B2,B3 are independent
p(B1 B2 B3)= p(B1)×p(B2) ×(B3)=0.83=0.512
The general should choose the large battle!
49
Example - Penicillin (continued)
The probability that a patient is allergic to penicillin is 0.20.
Suppose the drug is administered to 3 people.
(a) What is the probability that all 3 patients are allergic?
(b) Find the probability that at least one is not allergic
Answer:
(a) Define
Ai-person i is allergic
Events Ai are independent
P(A1
A2
A3) =
p(A1)p(A2)p(A3)=0.23=.0008
(b) p(at least one is not allergic)=
p(1 not allergic) + p(2 not allergic) + p(3 not allergic)=….
=1-p(all three are allergic)=1-0.008=0.992
50
When events are not independent:
Example
Drawing two aces from an ordinary deck of 52 cards:
For the first card, the probability of an ace is 4/52
If the first card is an ace, the probability that the second
card is an ace is 3/51
51
Conditional probability
Example:
Here is a two-way table for a class of 100 students,
classified according to whether or not they are freshmen,
and whether they live on or off campus
On
Off
Total
F
20
5
25
Not F
35
40
75
Total
55
45
100
What is the probability that a student lives on campus?
55/100=.55
Suppose a student is a freshman. What is the probability that the
students lives on campus?
20/25=0.80
52
Conditional probability
We call 0.80 a conditional probability, because a condition
(being a freshmen) has been specified.
In general, we write the conditional probability of event A
given event B as: p(A|B).
If
O=living on campus
F=freshman
P(O)=0.55
P(O|F)=0.80
53
Conditional probability
To see how conditional probabilities relate to ordinary ones:
S
O
OF
F
p(O F)
p(O| F) 
p(F)
54
Conditional probability
In general,
p(A  B)
p(A | B) 
p(B)
This definition, when rearranged, gives:
p(A B)  p(B)p(A| B)
Written this way, we are suggesting that B occurred first.
If A occurs first, we would use the equivalent identity:
p(A B)  p(A)p(B| A)
55
Example
Suppose I pick 2 students (without replacing the
first before the second is picked) at random from
a class of 50 where 30 are male and 20 are
female. Find the probability that
1. both are male
Denote:
M1- the first is male
M2-the second is male
30 29
p(M 1  M 2 )  p(M 1 )p(M 2 | M1 )  
50 49
56
Example
2. One is male and the other is female:
There are two possibilities for this result - first is male, second is female
- first is female, second is male
p(M1  F2 ) or p(F1  M2 ) 
 p(M1 )p(F2 | M1 )  p(F1 )p(M2 | F1 ) 
30 20 20 30
   
50 49 50 49
57
Example
Tossing a balanced coin twice: A=first toss is a head
B=second toss is a head
What is the probability of obtaining head on the first and the
second tosses?
A1=head on the first toss
A2=head on the second toss
p(A1 A2)=p(A1)p(A2|A1)=
=0.5×0.5=p(A1) p(A2)
When events are independent:
p(A
B)=p(A) ×p(B)
58