Probability Review

advertisement
Probability
An Experiment is any action that leads to an uncertain outcome.
The sample space , denoted S is the set of all possible outcomes.
Events are sets of outcomes or subsets of S and are denoted by capital letters such as A,
B, …
Simple events are events consisting of exactly 1 outcome.
Example1:
Flip a coin and pick a number (1, 2, or 3)
Draw Tree diagram to get S = {(H1, H2, H3, T1, T2, T3)}
Note that order of H1 ≠ 1H but order in S does not matter so
S = {( T1, T2, T3, H1, H2, H3)}
The probability of an event A is denoted P(A). P(A) is the measure of the likelihood that
A will occur when the experiment is run.
You can think of P(A) in three ways:
1. If the experiment were to be run, what would be the chance A would occur.
(Theoretical)
2. If you ran the experiment many times, the relative frequency of the times A occurred.
(Empirical)
3. If all the outcomes are equally likely to occur, then
P(A) =
number of ways that A occurs
Total number outcomes of the experiment
P(A)
=
number of outcomes in A
number of outcomes in S
Some important rules of probability
0 ≤ P(A) ≤ 1
P(S) = 1
{} = empty set, which is the set that contains no elements
P({}) = 0
0 ≠ {}
P(A) is the sum of the probabilities of the outcomes in A. You can just the sum the
outcomes to get the probability of A.
A' = compliment of A which means “not A” or the event that A did not occur.
P(A') = 1 – P(A)
P(A ∩ B) means that both event A and event B occur!
P(A U B) means that either A occurs or B occurs or they both occur.
Another helpful diagram to help calculate probabilities is a Venn Diagram.
Example 2:
Roll a fair die. Let E = {2, 4, 6} and F = {1, 2, 3, 4}
Draw Venn Diagram
S = {1,2,3,4,5,6}
P(E ) = 3/6 = ½ = 0.5
P(F) = 4/6 = 2/3 = 0.667
P(E') = 1 – ½ = ½ = 0.5
P(F') = 1 – 2/3 = 1/3 = 0.333
(E ∩ F ) = {2, 4} so P(E ∩ F) = 2/6 = 1/3 = 0.333
(E U F ) = {1, 2, 3, 4, 6} so P(E U F) = 5/6 = .833
Note that in the above example:
P(E U F) = P(E) + P(F) – P(E ∩ F) = ½ + 2/3 – 1/3 = 3/6 + 4/6 – 2/6 = 5/6 = .833
This is true in general for any events A and B:
P(A U B) = P(A) + P(B) – P(A ∩ B)
P( A∩B ) = 0 means A and B are Disjoint or Mutually Exclusive
Example #3
You flip a fair coin twice.
a. Construct the sample space for the 2 flips.
S = {HH, HT, TH, TT}
Note that depending on what we are interested in HT may not be the same as TH
b. Find the probability that both flips are Tails.
Let E = {TT}
P(E) = ¼ = 0.25
c. What is the probability that at least one Head is flipped?
The event {at least one H} is the compliment of two Tails {TT}, so
P(E') = 1 – ¼ = ¾ = 0.75, which is easier than calculating
P(At least one H) = P(HH) + P(HT) + P(TH) = ¼ + ¼ + ¼ = ¾ = 0.75
Note to self: Draw tree diagram
e. If the probability of flipping a T is actually 0.4 and not 0.5 how does this change the
P(TT) and the P(at least one H)?
(Draw Tree diagram)
Let F = {TT}
P(F) = .4 * .4 = 0.16 (less than 0.25)
P(F’) = 1 - .16 = 0.84 (more than .75)
Example #4
A single random digit is selected.
a. What is the sample space?
b. What is the probability that each digit is selected?
c. Justify that this is a valid probability model.
a. S = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
b. The probability of each digit is 1/10 = 0.1
c. since 0 < 0.1 < 1, all the probabilities are between 0 and 1 and since there are 10 digits
the sum of the probabilities is 10 * 0.1 = 1.
Example 5:
Two random digits from {0, 1, 2, 3} are selected randomly with replacement.
a. Find the probability that the sum of the digits equals 0.
b. Find the probability that the sum of the digits greater than 0.
c. Find the probability that the sum of the digits less than 6.
d. Find the probability that the sum of the digits equals 1.
e. Find the probability that the sum of the digits equals 3.
Hint: draw a tree diagram or list the possible outcomes
Example #6
One thousand people were asked to give their primary source of news. The results are
given in the following table. A random subject is selected.
Male
Female
Radio
275
200
TV
135
175
Paper
35
70
Other
60
50
a. Find the probability that the subject gets news from the Radio.
P (Radio) = (275 + 200)/ 1000 = 475 / 1000 = .475
b. Find the probability that the subject gets news from Paper and is Female.
P (Paper ∩ Female) = 70 / 1000 = .070
Remember that AND means both!
c. Find the probability that the subject gets news from TV or is Male
P (TV U Male) = P(TV) + P(Male) – P(TV ∩ Male) =
310/1000 + 505/1000 – 135/1000 = 680/1000 = 0.680
d. Find the probability that the subject gets news from Paper GIVEN she is Female.
This is a new type of probability called Conditional Probability. We are given additional
information here, that the subject is Female. So we are limiting our Sample Space.
P (Paper | Female) = 70 / 495 = .141
In general P (A | B) = P(A ∩ B)
P(B)
Provided that the P(B) ≠0
For the last example P(Paper ∩ Female) = 70/1000 = .07 and the
P(Female) = 495/1000 = .495
so the P(Paper | Female) = .07 / .495 = .141
e. Find the probability that the subject is Female given she gets news from Paper.
P(Female | Paper) = .07 / .105 = .667 = 70 / 105
In general P(A | B ) ≠ P(B | A) whereas
P(A ∩ B) = P(B ∩ A) and P( A U B ) = P( B U A)
P(A | B) is a probability so it is between 0 and 1, if you get a number bigger than 1 it
means you made a mistake! Fix it!
You may give answers as fractions or decimals but not both.
In part e of the last example, acceptable answers are:
P(Female | Paper) = .667 = 70 / 105 = 2/3
Unacceptable answers are
P(Female | Paper) = .07 / .105, this is not a proper fraction or a proper decimal.
Male
Female
Radio
275
200
TV
135
175
Paper
35
70
Other
60
50
Find the P(Male), P(TV), P(Male ∩ TV), P(Male | TV) and P(TV | Male)
Example #7:
P(E) = .45
P(F) = .35
P(E U F) = .60
Find the P(E | F) and P(F | E).
First we need to find the P(E ∩ F).
Recall that P(E U F) = P(E) + P(F) – P(E ∩ F). This implies that
P(E ∩ F) = P(E) + P(F) – P(E U F)
So
P(E ∩ F) = .45 + .35 - .60 = .20
Then
P(E | F) = P(E ∩ F) / P(F) = .20 / .35 = 4/7 = .571
P(F | E) = P(E ∩ F) / P(E) = .20 / .45 = 4/9 = .444
P(E ∩ F ) = P(F ∩ E) and P(E U F) = P(F U E) but
P(E | F) ≠ P(F | E)
Recall P(A′) = 1 – P(A)
P(A′ | B) = 1 – P(A | B) but P(A′ |B) ≠ 1 – P(A′ | B′)
Using the above example: Draw Venn diagram
P(E′) = .55
P(F′) = .65
P(E′ ∩ F′) = .40
P(E′ ∩ F) = .15 P(F′ ∩ A) = .25
P(E′ | F) = P(E′ ∩ F)/P(F) = .15 / .35 = 3/7 = .429
P(E′ | F′) = P(E′∩ F′) / P(F′) = .40 / .65 = 8/13 = .615
This is because for any sets A and B
P(A) = P(A ∩ B) + P(A ∩ B′) and
P(B) = P(B ∩ A) + P(B ∩ A′)
Draw Venn Diagram!
Another Example:
A standard Bridge or Poker deck of cards has 52 cards. 4 suits: 2 red: Hearts and
Diamond and 2 black: Clubs and Spades. Each suit has 13 cards labeled 2, 3, 4, 5, 6, 7, 8,
9, 10, Jack, Queen, King and Ace. The jack, queen and king are known as the picture or
face cards. You pick a card at random. Let E = {Jack}, F = {face card}, G = {black card}.
Find the following probabilities and describe in words what they mean:
P(E) = 4/52
P(F) = 12/52
P(G) = 26/52
P(E ∩ F) = 4/52
P(E ∩ G)= 2/52
P(F ∩ G)= 6/52
P(E U F)= 12/52
P(E U G)= 28/52
P(F U G)= 32/52
P(E | F) = 4/12
P(F | E)= 1
P(E | G)= 2/26
P(G | E)= 2/4
P(F | G)= 6/26
P(G | F)= 6/12
Multiplicative Rule of Probability
P(A ∩ B) = P(A | B) P(B)
If you knew P(A | B) = .42 and P(B) = .27 then
P(A ∩ B) = .42 * .27 = .1134
Two events (A and B) are independent when the fact that A occurs does not affect the
probability that B will occur and vice versa.
Equivalent definitions of Independent events A and B:
P( A ∩ B ) = P(A) P(B)
P(A | B) = P(A)
P(B | A ) = P(B)
So P(A ∩ B) = P(A) P(B) only if A and B are independent.
Ex. the experiment is to draw a single card from a deck of 52. Let E be the event that the
card is a Jack and let G be the event that the card is Black. Find the probability of E, G
and E ∩ G, E|G, G|E ? Are E and G independent?
P(E) = 4/52 = 1/13
P(G) = 26/52 = ½
P(E ∩ G) = 2/52 = 1/26
P(E | G) = 2/26 = 1/13
P(G | E) = 2/4 = ½
E and G are independent because:
P(E ∩ G) = 1/26 = 1/13 * ½ = P(E) P(G)
P(E | G) = 1/13 = P(E)
P(G |E) = ½ = P(G)
Ex. Roll a fair die. Let H = {1, 3, 5} G = {1, 2, 3}
Are H and G independent?
P(H) = ½
P(G) = ½
P(H ∩ G) = 2/6 ≠ ½ * ½ = ¼ so A and C are not independent.
P(H | G ) = 2/3 ≠ P(H)
P(G | H) = 2/3 ≠ P(G)
Ex. Two fair dice are rolled. (Draw Table!)
Let M = {Sum is odd}
Q = {sum > 9}
R = {at least one die shows a 4}
Recall that:
P(M) = 18/36 = ½
P(Q) = 6/36 = 1/6
P(R) = 11/36
P(M ∩ Q) = 2/36 = 1/18
P(M ∩ R) = 6/36
P(Q∩ R) = 2/36 = 1/18
Now find P(M | Q), P(Q | M), P(M | R), P(R | M), P(Q | R), P(R | Q),
P(M|Q) = (2/36) / (6/36) = 2/6 = 1/3
P(Q|M) = (2/36) / (18/36) = 2/18 = 1/9
P(M|R) = (6/36) / (11/36) = 6/11
P(R|M) = (6/36) / (18/36) = 6/18 = 1/3
P(R|Q) = (2/36) / (6/36) = 2/6 = 1/3
P(Q|R) = (2/36) / (11/36) = 2/11
** DO not confuse Independent with Mutually Exclusive Events!
If A and B are independent then P(A ∩ B) = P(A) P(B)
If A and B are mutually exclusive then P(A ∩ B) = 0
Counting: essential to probability
Ex
How many ways can I order the letters A B C?
ABC, ACB, BAC, BCA, CAB, CBA: which is 6.
You can think of this as you have 3 choices for the first letter and 2 choices for the
second letter and 1 choice for the 3 letter. 3*2*1 =6
When you say “and” you multiply.
This is known as the multiplicative rule of counting.
If the first part of an experiment can be done in k ways and the second part can be done
in m ways, then the experiment can be done in k * m ways.
This can be generalized to an experiment with any number of parts.
Menu Example:
You own a restaurant and want to offer combination dinners. The patrons get a choice
of 1 of 3 appetizers, 1 of 5 entrees and 1 of 2 desserts. How many combination meals
are there?
3 * 5 * 2 = 30.
How many ways can I order the letters A B C D?
24 = 4 * 3 * 2 * 1
How many ways can I order n distinct letters (objects)?
n! = n factorial.
0! = 1
n! = n * (n – 1)! for any positive integer n
n! = n * (n-1) * (n-2) * …(2) * (1)
1! = 1
2! = 2
3! = 6
4! = 24
to find 5! On TI83/84, hit [5], [MATH], go over to PRB and the fourth option is 4:!(hit
[4]).
On screen you should see 5!
Hit [ENTER]
Answer is 120, which is 5 * 4! = 5 * 24
n! gets big really fast.
n! = the number of ways to order n distinct items.
Ex.
How many ways can I order A B C D?
n = 4, 4! = 24
A more complicated question:
Ex How many ways can I select and order 2 letters from
{A B C D E}?
AB AC AD AE BC BD BE CD CE DE
BA CA DA EA CB DB EB DC EC ED
20 ways = 5 * 4
Also this can be done using Permutations. When you have n distinct objects and you
select r of them and order is important, meaning AB ≠ BA, then you have n P r or P(n, r).
n Pr 
n!
(n  r )!
The above example: n = 5 and r = 2.
5 P 2 = 5!/3! = 20
To calculate 5 P 2 on the TI83/84:
hit [5], [MATH], go over to PRB and the
second option is nPr, hit [2]
On your screen you should see 5 nPr then hit [2]
and [ENTER]
You should get 20.
Ex. How many ways can I select 2 letters from {A B C D E}?
(here it assumed that order is not important)
AB AC AD AE BC BD BE CD CE DE = 10 ways.
This can also be looked at as a combination. When you have n distinct objects and you
select r of them and order is NOT important, meaning AB = BA, then you have n C r or
C(n, r).
Other Notation:
nCr 
n!
r!(n  r )!
In the above example:
n = 5, r = 2 so
n C r = 5 C 2 = 5! / (2! * 3!) = 120 / (2 * 6) = 10
To calculate 5 C 2 on the TI83/84:
hit [5], [MATH], go over to PRB and the
third option is nCr, hit [3]
On your screen you should see 5 nCr then hit [2]
and [ENTER]
You should get 10.
nCn = 1
nC1 = n
nC0 = 1
nC2 = n*(n-1)/2
Example:
You are given an urn that contains 10 marbles. There are 5 Red marbles, 3 White
marbles and 2 Blue marbles. You select 2 marbles without replacement. Find the
following probabilities:
(Hint: a tree diagram may be helpful.)
1. Both marbles are White.
2. Neither marble is White.
3. Both marbles are the same color.
R
R P(R) = 4/9
W P(W) = 3/9
B P(B) = 2/9
P(W) = 3/10
W
R P(R) = 5/9
W P(W) = 2/9
B P(B) = 2/9
P(B) = 2/10
B
R P(R) = 5/9
W P(W) = 3/9
B P(B) = 1/9
P(R) = 5/10
P(WW) = 3/10 * 2/9 = 6/90 = 1/15 = .067
P(NEITHER IS W) = P(RR) + P(RB) + P(BR) + P(BB)
= 5/10 * 4/9 + 5/10 * 2/9 + 2/10 * 5/9 + 2/10 * 1/9 = 42/90 = .467
P(BOTH SAME COLOR) = P(RR) + P(WW) + P(BB) =
= 5/10 * 4/9 + 3/10 * 2/9 + 2/10 * 1/9 = 28/90 = .311
Another way to answer question 1 is by using combinations.
P(WW) = number of ways to pick 2 white marbles
number of ways to pick 2 marbles
P(WW) = 3 C 2/ 10 C 2 = 3 / 45 = 6 /90
P(RR) = 5 C 2 / 10 C 2 = 10 / 45 = 20 / 90
P(BB) = 2 C 2 / 10 C 2 = 1 / 45 = 2 / 90
Ex. An urn contain 8 balls: there are 4 white, 3 red and 1 black. 2 balls are picked
randomly.
If the balls are picked with replacement (meaning the balls are picked one at a time and
the first ball is replaced before the second is picked)
Find the following probabilities:
a.
P(2 white balls are picked) =
b.
P(no white balls are picked) =
c.
P(at least 1 white ball is picked) =
d.
P(2 black balls are picked) =
Ex. Using the same urn structure, if the balls are picked without replacement (meaning
the balls are picked two at a time and the first ball is NOT replaced before the second is
picked)
Find the following probabilities:
a.
P(2 white balls are picked) =
b.
P(no white balls are picked) =
c.
P(at least 1 white ball is picked) =
d.
P(2 black balls are picked) =
Diagnostic testing
Let S = {condition or disease is present}
Then S′ = {condition or disease is NOT present}
Let T = { test for S is positive}
Then T′ = { test for S is negative}
Sensitivity = P(T | S )
Sensitivity = probability that the test is + given we know the subject has the condition
Specificity = P(T′ | S′)
Specificity = probability that the test is - given we know the subject does not have the
condition
P(False Positive) = P(T | S′)
P(False Negative) = P(T′ | S)
Note that
P(False Positive) = P(T | S′) = 1 – P(T′ | S′)
and
P(False Negative) = P(T′ | S) = 1 – P(T | S)
Prevalence of a condition or disease is the percent or probability of the population that
has it.
Prevalence = P(S)
What is usually of interest is the probability the subject actually has the condition given
the test is + or the probability the subject actually does not have the condition given the
test -.
Tree Diagram
---P(T | S)
--------- P(S)---|
|
---P(T′|S)
|
|
|
---P(T|S′)
--------- P(S′)---|
---P(T′|S′)
From the tree diagram we can calculate the AND probabilities.
---P(T | S)
--------- P(S)---|
P(T ∩ S ) = P(T|S) * P(S)
|
---P(T′|S)
|
|
|
---P(T|S′)
--------- P(S′)---|
---P(T′|S′)
P(T′ ∩ S ) = P(T′|S) * P(S)
P(T ∩ S′ ) = P(T|S′) * P(S′)
P(T′ ∩ S′) = P(T′|S′) * P(S′)
Note that P(S) = P(S ∩ T) + P(S ∩ T′) and
P(T) = P(T ∩ S) + P(T ∩ S′)
Draw Venn Diagram!
To find P(S | T) =
P(S ∩ T)
P(T)
Ex. It is known that about 1% of women who get a mammogram have breast cancer. The
sensitivity of a mammogram is 0.86 and the specificity is 0.88.
Real Questions:
Given that the mammogram is +, what is the probability the woman has breast cancer?
Given that the mammogram is -, what is the probability the woman does not have
breast cancer?
To get these answers we will make a tree diagram.
We will then find P(T), P(T′), P(S ∩ T) and P(S′ ∩ T′)
These will then be used to find P(S | T) and P(S′ | T′).
Note what we are given in the problem:
P(S) = .01, P(T|S) = .86 and P(T′|S′) = .88
which means: P(S′) = .99, P(T′|S) = .14 and P(T| S′) = .12
P(T|S)=.86
---P(S) = .01 |
|
P(T′|S)=.14
|
|
|
P(T|S′)=.12
--P(S′) = .99 |
P(T′|S′)=.88
P(T ∩ S ) = .01 * .86 = .0086
P(T′ ∩ S ) = .01 * .14 = .0014
P(T ∩ S′ ) = .99 * .12 = .1188
P(T′ ∩ S′) = .99 * .88 = .8712
P(T) = P(T ∩ S) + P(T ∩ S′)
P(T) = .0086 + .1188 = .1274
P(T′) = P(T′ ∩ S) + P(T′ ∩ S′)
P(T′) = .0014 + .8712 = .8726 = 1 – P(T)
To answer the questions:
P(S | T) = P(T ∩ S) / P(T) = .0086 / .1274 = .0675 = 6.75%
P(S′ | T′) = P(T′ ∩ S′) / P(T′) = .8712 / .8726 = .9984 = 99.84%
The fraction of women who take a pregnancy test that are pregnant is 75%. The test has
a sensitivity of 93% and a specificity of 96%.
Find the probability that:
a. a woman is pregnant if the test is positive.
b. a woman is not pregnant if the test is negative.
Note what we are given in the problem:
P(S) = .75, P(T|S) = .93 and P(T′|S′) = .96
which means: P(S′) = .25, P(T′|S) = .07 and P(T| S′) = .04
P(T|S)=.93
---P(S) = .75 |
|
P(T′|S)=.07
|
|
|
P(T|S′)=.04
--P(S′) = .25 |
P(T′|S′)=.96
P(T ∩ S ) = .75 * .93 = .6975
P(T′ ∩ S ) = .75 * .07 = .0525
P(T ∩ S′ ) = .25 * .04 = .01
P(T′ ∩ S′) = .25 * .96 = .24
P(T) = P(T ∩ S) + P(T ∩ S′)
P(T) = .6975 + .01= .7075
P(T′) = P(T′ ∩ S) + P(T′ ∩ S′)
P(T′) = .0525 + .24 = .2925 = 1 – P(T)
To answer the questions:
P(S | T) = P(T ∩ S) / P(T) = .6975 / .7075 = .9859
P(S′ | T′) = P(T′ ∩ S′) / P(T′) = .24/.2925 = .8205
Download