Download probabilities

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Statistics wikipedia , lookup

History of statistics wikipedia , lookup

Birthday problem wikipedia , lookup

Inductive probability wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
7.5 Conditional Probability; Independent
Events
• This presentation is copyright by Paul Hendrick
• © 2003-2005, Paul Hendrick
• All rights reserved
7.5 Conditional Probability; Independent
Events
• To figure the probability of an event E, we’ve
been using the sample space S and the formula
P(E) = n(E) / n(S)
• Another example:
– Three fair coins are tossed (or one fair coin is
tossed three times).
– What’s the probability of having 2 heads (on 3
tosses) ?
– In symbols, P(2H) = ?
(How? Let’s see…)
– P(2H) = 3/8
7.5 Conditional Probability; Independent
Events
• Recall, P(E) = n(E) / n(S)
– We need to figure n(S) and n(E), (in that order -recommended!)
• In our example, there are three tosses, so
– S= {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}
• What’s the probability of having 2 heads (on 3
tosses)
?
– So E = 2H = {HHT, HTH, THH}
• Then P(E) = P(2H) = n(2H) / n(S) = 3/8
• Note that above, “2” means “exactly 2”, and HHH doesn’t count!
7.5 Conditional Probability; Independent
Events
• Let’s modify the above problem :
– Three fair coins are tossed (or one fair coin is
tossed three times).
– What’s the probability of having 2 heads (on 3
tosses), given that the first toss was a TAIL ?
– In symbols, P(2H|T1) = ?
• The | means “given that” and the superscript “1”
means on the first toss
– P(2H|T1) = 1/4
(How? Let’s see…)
7.5 Conditional Probability; Independent
Events
• Again, it would seem that
S= {HHH, HHT, HTH, HTT, THH, THT, TTH, TTT}
• But … we are told that the first toss was a tail!
• So, not all of the above were really possible!
• So we modify the sample space to reflect what could have
possibly happened:
~
S = {THH, THT, TTH, TTT} = T1
• Of these, our event E would be as follows:
• E = 2H = {THH}
• Then, P(2H|T1) = 1/4
– Note that the sample space was restricted (or reduced)
7.5 Conditional Probability; Independent
Events
• Restricted sample space
• This is called “Conditional probability”
– P(A|B) – what’s the probability that A occurs, on
condition that B has happened (or will have happened)?
– formula: P(A|B) = n(A B) / n(B) (all equallylikely outcomes!)
– or
P(A|B) = P(A B) / P(B) (in general).
• of course, denominator cannot equal 0, else result is
UNDEFINED
– In which case, the conditional probability has no meaning.
• NOTE: the right hand side is always P(both) / P(given)
7.5 Conditional Probability; Independent
Events
– Don’t confuse P(A|B) with P(B|A) -- they generally
are DIFFERENT VALUES
• P(A|B) = P(A B) / P(B)
• P(B|A) = P(A B) / P(A)
• are equal only if P(A) = P(B) and both 
• Back to the 3-coin example:
–
–
–
–
–
P(T1|2H) = ?
~
S = {HHT, HTH, THH} = 2H
E = T1 = {THH}
So, P(T1|2H) = 1/3
But P(2H|T1) = 1/4 (while ago!)
7.5 Conditional Probability; Independent
Events
• We saw listing out the elements in the sample
space and using formulas to do problems, above.
• Or we can use visual aids to help us work with
probabilities or conditional probabilities.
• These visual aids include
–
–
–
–
Venn diagrams
Tables
Tree diagrams
Probability tree diagrams
• We’ll look at using Venn diagrams first
7.5 Conditional Probability; Independent
Events
• Venn diagrams may help illustrate basic
probabilities and be handy for working with
conditional probabilities, if done carefully
• Such a diagram may show either counts or
probabilities.
• If counts are used, the sample space must be
uniform!
• Let’s look at an example of using a Venn diagram
in a conditional probability setting:
7.5 Conditional Probability; Independent
Events
• A composition course has 25 students of whom
14 are male and 9 are sophomores. In addition, 5
of the sophomores are men. A student is chosen
at random. Find the probability that the student
– (a) is a sophomore given that the student is a man.
– (b) is a woman given that the student is a sophomore.
• Note that counts are given, but it’s a uniform
sample space, so we’re OK.
– Why do we know it’s uniform?
•[on board]
7.5 Conditional Probability; Independent
Events
What if we had counts on freshmen, sophomores,
and juniors in the class category, as well as on
gender?
How well could we put this into our Venn
diagram??
• Tables will help us past this problem.
– But first another Venn diagram problem.
7.5 Conditional Probability; Independent
Events
• Let E and F be events with P(E) = .35, P(F) =
.67, and P(EF) = .24. Find P(E|F).
– Note that probabilities are given this time
• [on board]
– Note that above we DIDN’T HAVE TO USE
DIAGRAMS (we could just use formulas) …
– …but they certainly make clearer what’s going on
– that is, they help us visualize the situation
7.5 Conditional Probability; Independent
Events
• Tables can be viewed as similar to Venn
diagrams, except more versatile.
• Such a table may show either counts or
probabilities.
• If counts are used, the sample space must be
uniform!
• Let’s look at an example of using a table in a
conditional probability setting:
7.5 Conditional Probability; Independent
Events
– Problem 7.5 # 46. The following table, based on data from
the Centers for Disease Control, gives the number of new cases
of the AIDS virus for men and women in the United States in
1998 by method of transmission.
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
– Find (a) the probability that a male resident who was newly diagnosed with AIDS in 1998 contracted it via homosexual contact.
7.5 Conditional Probability; Independent
Events
– Problem 7.5 # 46 (a). Find the probability that a male
resident who was newly diagnosed with AIDS in 1998
contracted it via homosexual contact.
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
– The table represents ALL the individual residents.
– We are told that the resident is male. This is additional
information. It’s the “given”. Then we are asked about the
homosexual contact, as a transmission method.
7.5 Conditional Probability; Independent
Events
– Our P(A|B) = n(AB) / n(B) becomes
– P(Homosexual contact | Male) or
– P(Homos. c.| M)
= n(Homos. c.  M) / n(M)
= 8388 / 18423  .4553 or 45.53%
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
7.5 Conditional Probability; Independent
Events
– Problem 7.5 # 46. The following table, based on data from
the Centers for Disease Control, gives the number of new cases
of the AIDS virus for men and women in the United States in
1998 by method of transmission.
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
– Find (b) the probability that a female resident who was newly
diagnosed with AIDS in 1998 contracted it via intravenous drug
use.
7.5 Conditional Probability; Independent
Events
– Problem 7.5 # 46 (b) the probability that a female resident
who was newly diagnosed with AIDS in 1998 contracted it via
intravenous drug use.
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
– The table represents ALL the individual residents.
– We are told that the resident is female. This is additional
information. It’s the “given”. Then we are asked about the
intravenous drug use, as a transmission method.
7.5 Conditional Probability; Independent
Events
– Our P(A|B) = n(AB) / n(B) becomes
– P(intravenous drug use | Female) or
– P(IV drug | F)
= n ( IV drug  F) / n(F)
= 1541 / 5401  .2853 or 28.53%
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
7.5 Conditional Probability; Independent
Events
– Tree diagrams are handy for working with conditional
probabilities and especially for illustrating such
– And in particular, probability tree diagrams, with
probabilities written on the branches, and then the path
probabilities calculated and written for each of the
paths, are extremely helpful
– Just as above, we used a formula-based approach first,
then illustrated with a Venn diagram or table
– Here we’ll do the formula first, then a probability tree
diagram to illustrate the idea.
– First, let’s further develop the formulae.
7.5 Conditional Probability; Independent
Events
– We’ve had the formulae
P(A|B) = P(A B) / P(B)
P(B|A) = P(A B) / P(A)
– If you solve each of these equations for the
numerator on the right, you get
• Product Rule of Probability
• P(A B) = P(A) • P(B|A)
• P(A B) = P(B) • P(A|B) , also
7.5 Conditional Probability; Independent
Events
– Product Rule of Probability
• The probability of both of two events occurring is the product
of the probability of the first event occurring times the
conditional probability of the second event occurring given
that the first event has occurred.
• P(A B) = P(A) • P(B|A)
• P(A B) = P(B) • P(A|B) , also
• The conditional probability is key!
• This idea is called the Multiplication Principle.
– Remember, you are not multiplying the probabilities of
the two separate events, but rather the probability(ies)
that follow(s) the first must be conditional.
7.5 Conditional Probability; Independent
Events
• P(ABC) = P(A) • P(B|A) • P(C|AB)
– uses Prob of A,
– then Prob of B, but assuming that A has happened!
– then Prob of C, but assuming that both A and B have
happened!
– The conditional probability is key!
• Could also be
P(ABC) = P(B) • P(C|B) • P(A|BC)
– the order of the events DOES NOT MATTER in the
calculation
7.5 Conditional Probability; Independent
Events
• Examples: (problems #8,10,12,14 in 7.5 in our textbook)
– Two cards are drawn without replacement from an
ordinary deck.
– Find the following probabilities:
#8) The second is black, given that the first is a spade
#10) The second is an ace, given that the first is not an
ace
#12) An ace and a 4 are drawn
#14) Two hearts are drawn
– Note the “without replacement” in the description.
• Means the second card is conditional (depends on first card)!
7.5 Conditional Probability; Independent
Events
– #8) Two cards are drawn without replacement from an
ordinary deck. Find the probability that the second is
black, given that the first is a spade.
– In symbols, find P(B2|S1) where B2 represents “black on the
second card”, and S1 represents “a spade on the first card”
– Think what this question means, and solve, keeping in
mind what has happened (use a “ reduced” sample space):
• A spade is (was, will be) drawn first, leaving 12 spades and
39 other cards, 51 total;
• One of these is drawn; to be a “success”, it must be a black
card, i.e., one of the 12 spades or 13 clubs, 25 total.
• The probability therefore is 25/51.
P(B2|S1) = 25/51
7.5 Conditional Probability; Independent
Events
– #10) Two cards are drawn without replacement from
an ordinary deck. Find the probability that the second
is an ace, given that the first is not an ace.
– In symbols, find P(A2|A’ 1) where A2 represents “ace on the
second card”, and A’ 1 represents “not an ace on the first card”
– Think what this question means, and solve, keeping in
mind what has happened (use a “ reduced” sample space):
• Not an ace is (was, will be) drawn first, leaving 47 non-aces
and 4 aces, 51 total;
• One of these is drawn; to be a “success”, it must be an ace,
i.e., one of the 4 aces.
• The probability therefore is 4/51.
P(A2|A’ 1) = 4/51
7.5 Conditional Probability; Independent
Events
– NOTE: To solve the previous two problems, we
didn’t use anything high-powered, formulas or such!
– All we did have to do was
• (1) UNDERSTAND THE EXPERIMENT
• (2) UNDERSTAND THE QUESTION
• (3) KNOW THAT PROBABILITY CAN BE ANSWERED
IN TERMS OF COUNTING (in many situations)
and
• (4) DO SOME SIMPLE COUNTING
– Many probability problems, especially conditional
probability problems, can be worked within these
simple ideas.
7.5 Conditional Probability; Independent
Events
– #14) Two cards are drawn without replacement
from an ordinary deck. Find the probability that
two hearts are drawn.
– In symbols, find P(2H) where H represents “any heart”, so
2H represents “two hearts”
P(2H) = P(H1H2)
= P(H1) • P(H2|H1)
= 13/52 • 12/51 = 156/2652
= 1 / 17
 0.0588
7.5 Conditional Probability; Independent
Events
– #12) Two cards are drawn without replacement from
an ordinary deck. Find the probability that an ace and
a 4 are drawn.
– In symbols, find P(A4) where A represents “an ace of any
suit”, and 4 represents “a four of any suit”
– Think what this question means, and solve. We are asking about
a compound event . And there is no “given”.
• An ace and a 4 must be drawn to be a success, in either order.
Essentially this gives us two cases: A142 or 41A2.
• This is a very compound event, two “ands” with an “or”
between (or two intersections with a union between).
• Quite often, we handle compound events through the
formulas we’ve seen, for union & intersection.
7.5 Conditional Probability; Independent
Events
– #12) Two cards are drawn without replacement
from an ordinary deck. Find the probability that an
ace and a 4 are drawn.
– In symbols, find P(A4) where A represents “an ace of any
suit”, and 4 represents “a four of any suit”
P(A4) = P(A142  41A2 )
=
P(E  F ) = P(E) + P(F) – P(E  F )
P(A142 ) + P(41A2 ) – P(A142  41A2 ) mut. excl.
= P(A142 ) + P(41A2 )
P(EF)=P(E) • P(F|E)
= P(A1) • P(42|A1) + P(41 ) • P(A2|41)
= 4/52 • 4/51 + 4/52 • 4/51 = 16/2652 + 16/2652
= 32/2652 = 8/663  0.012066
7.5 Conditional Probability; Independent
Events
As said before,
– Tree diagrams are handy for working with conditional
probabilities and especially for illustrating such
– And in particular, probability tree diagrams, with
probabilities written on the branches, and then the path
probabilities calculated and written for each of the
paths, are extremely helpful
– Now that we’ve developed the use of formulae further,
let’s look at the previous two problems done with a
probability tree diagram to illustrate the idea.
•[on board]
7.5 Conditional Probability; Independent
Events
– For the probability of the compound event of two events
happening in succession, we have formulae such as
P(A B) = P(A) • P(B|A)
– But sometimes it happens that P(B|A) = P(B).
• In other words, the probability of B’s occurring is the
same whether additional information about A’s having
occurred or not is known or not
• In this situation, A and B are said to be independent
events.
– When events A and B are independent, the formula above
reduces to
P(A B) = P(A) • P(B)
7.5 Conditional Probability; Independent
Events
– The formula
P(A B) = P(A) • P(B)
can be used when we know the two events are independent, but
often this idea is taken in reverse, and
– The formula is used to TEST whether A and B are
independent
– Each of the three probabilities is calculated separately (be
especially careful with the first!) and then put together to see
if the L.H.S. is equal to the R.H.S. for the equation
P(A B) = P(A) • P(B) .
7.5 Conditional Probability; Independent
Events
P(A B) = P(A) • P(B) ?
• If P(A) = .5, P(B) = .6, P(A  B) = .8, then A&B are
independent …
– P(A = P(A) + P(B) – P(A  B)
= .5 + .6 .8
– .3 = (.5) (.6) is true
= .3
• If P(A) = .5, P(B) = .6, P(A B’) = .3, then A&B are not
independent (they are dependent) …
– P(A = P(A) - P(A B’)
= .5 - .3
– .2 = (.5) (.6) is NOT true
= .2
• Use calculations similar to these, not guessing, to determine
independence of events!
7.5 Conditional Probability; Independent
Events
– Problem 7.5 # 46. The following table, based on data from
the Centers for Disease Control, gives the number of new cases
of the AIDS virus for men and women in the United States in
1998 by method of transmission.
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
– Find (c) the probability that a newly diagnosed person with AIDS
is a female.
7.5 Conditional Probability; Independent
Events
– Problem 7.5 # 46 (c) the probability that a newly diagnosed
person with AIDS is a female.
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
– The table represents ALL the individual residents.
– We are NOT told any additional information. So there is no
“given”. We are simply asked about the gender of the patient.
7.5 Conditional Probability; Independent
Events
– This time, not P(A|B) but only P(A) is asked!
– P(Female) or
– P(F) = n (F) / n(S)
= 5401 / 23,824
 .2267 or 22.67%
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
7.5 Conditional Probability; Independent
Events
– Problem 7.5 # 46. The following table, based on data from
the Centers for Disease Control, gives the number of new cases
of the AIDS virus for men and women in the United States in
1998 by method of transmission.
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
– Find (d) the probability that a newly diagnosed person who
contracted AIDS via heterosexual contact was a female.
7.5 Conditional Probability; Independent
Events
– Problem 7.5 # 46 (d) the probability that a newly diagnosed
person who contracted AIDS via heterosexual contact was a
female.
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824
– The table represents ALL the individual residents.
– We are told that the person contracted AIDS via heterosexual
contact. This is additional information. It’s the “given”. Then we
are asked about the gender of the person.
7.5 Conditional Probability; Independent
Events
– Our P(A|B) = n(AB) / n(B) becomes
– P(intravenous drug use | Female) or
– P(IV drug | F)
= n ( IV drug  F) / n(F)
= 1541 / 5401  .2853 or 28.53%
Method of transm’n.
Male
Female
Total
Homosexual contact
8,388
0
8,388
Heterosexual contact
1,146
1,806
2,952
Intravenous drug use
3,652
1,541
5,193
Other
5,237
2,054
7,291
Total
18,423
5,401
23,824