Beruflich Dokumente
Kultur Dokumente
Review: probability
Frequentist theory of probability: if you repeat the event millions of time, what percentage will turn out a certain way Subjective theories of probability also exist In all theories: P(event happens) + P(event doesn't happen) = 100%
I deal three cards in succession from a shuffled deck. The first is the queen of spades; the second is the six of diamonds. What is the probability that the third card is a queen?
After dealing the first two cards, there are 3 queens left out of 50 cards Probability is 3/50 = 6% This is a conditional probability
I deal three cards in succession from a shuffled deck. What's the probability that the first card is the queen of spades, the second is the six of diamonds, and the third is a queen?
P(1 card is queen of spades) = 1/52 P(2nd card is six of diamonds, st given 1 was queen of spades) = 1/51 P(3rd card is queen, given 1st was nd queen of spades and 2 was six of diamonds) = 3/50
st
P(1 card is queen of spades, 2 is rd six of diamonds, 3 is queen) = 1/52 * 1/51 * 3/50 = 3/132600 or 0.0023% Multiplication rule: to find the probabilities of successive events, multiply conditional probabilities given the previous events
st
nd
Today
Independent events Mutually exclusive events and the addition rule Trees and Venn diagrams
Independent events
Two events are independent if the outcome of one event doesn't change the probabilities of the outcomes of the other event
I toss a coin twice. First event: the first toss is heads or tails. Second event: the second toss is heads or tails Whether the first toss is heads or tails doesn't change the probability of heads or tails on the second toss, so the events are independent
When events are independent, the conditional probability is the same as the unconditional probability nd st P(2 toss is a head | 1 toss is head) nd st = P(2 toss is head | 1 toss is tail) nd = P(2 toss is head) = Note: a vertical line | denotes given,
If I toss a coin twice: P(two heads) st nd = P(1 toss head and 2 toss head) st nd = P(1 toss head) * P(2 toss head | st 1 toss head) by multiplication rule st nd = P(1 toss head) * P(2 toss head) =*=
I deal 2 cards from a shuffled deck. First event: the first card is a king Second event: the second card is a queen How do we show these events are not independent?
P(2 card is queen) = 4/52 P(2nd card is queen | 1st card is king) = 4/51 Conditional and unconditional probabilities are not equal Not independent
nd
To find the joint probability of two events A and B: P(A and B) = P(A) * P(B|A) = P(B) * P(A|B) If A and B are independent: P(A and B) = P(A) * P(B)
II
Definition
Two events are mutually exclusive if they can't both happen e.g First card is a king and first card is a queen are mutually exclusive events First card is a king and first card is a spade are NOT mutually exclusive events
If two (or more) events are mutually exclusive, we can find the probability that one or the other of them happens by adding the probabilities of each of them
What is the probability the first card is a king or a queen? 1st card king and 1st card queen are mutually exclusive P(king or queen) = P(king) + P(queen) = 4/52 + 4/52 = 8/52 = 2/13
We can often split combinations of events into mutually exclusive parts e.g. What's the probability the first card is a king or a spade (or both)?
Possibilities: Both a king and a spade A king but not a spade A spade but not a king These three possibilities are mutually exclusive
P(Both a king and a spade) = 1/52 P(King but not a spade) = 3/52 P(Spade but not a king) = 12/52 P(King or spade) = 1/52 + 3/52 + 12/52 = 16/52 = 4/13
P(A or B) = P(both A and B) + P(A but not B) + P(B but not A) = P(A) + P(B but not A) = P(A) + P(B) P(both A and B)
I roll two dice. What's the probability I get at least one six? P(first die is six) = 1/6 P(second die is six) = 1/6 P(both dice are 6) = 1/6*1/6 = 1/36 P(at least one six) = 1/6 + 1/6 1/36 = 11/36 = 30.6%
Long way: list all 36 possible outcomes
III
Trees
Probability trees
When considering a series of events, drawing a tree may help to list all possible outcomes Each event is one stage of the trees Each branch represents a possible outcome
Probability trees
Probability trees
I toss three coins. What's the probability I get exactly 2 heads? From tree: P(HHT) = 1/8 P(HTH) = 1/8 P(THH) = 1/8 P(2 heads) = 1/8 + 1/8 +1/8 = 3/8
If events are not independent, branches show probabilities conditional on previous branches Multiply branch probabilities to get overall probability Each twig is mutually exclusive, so twig probabilities can be added
I deal two cards from a shuffled deck. What is the probability of: Two spades? One spade? No spades?
P(two spades) = 13/52 * 12/51 = 5.9% P(one spade) = (13/52 * 39/51) + (39/52 * 13/51) = 38.2% P(no spades) = 39/52 * 38/51 = 55.9% Check: 5.9 + 38.2 + 55.9 = 100%
IV
Venn diagrams
Venn diagrams
Venn diagrams can help you decide which mutually exclusive probabilities you need to add up Draw a circle representing each event; work out what each overlap is
Of Berkeley summer students: 35% are taking Stat, 30% are taking Arch, 25% are taking Sansk. 20% are taking both Stat and Arch, 15% are taking Stat and Sanskrit, 10% are taking Arch and Sanskrit 5% are taking all three
What's the probability a randomly selected Berkeley summer student is taking at least one of statistics, architecture and Sanskrit? (i.e. what percentage of Berkeley summer students are taking at least one of those three subjects?)
Students taking at least one of the three subjects = 5+5+5+15+10+ 5+5 = 50%
Note that circles may not overlap (events may be mutually exclusive)
Event A: first card is a queen Event B: first card is a spade Are the events independent? Are the events mutually exclusive?
The queen of spades is both a queen and a spade, so events aren't mutually exclusive P(spade|queen) = P(spade|not queen) = 12/48 = Probability of B doesn't change given A, so independent
Event A: first card is a spade Event B: first card is a club Are the events independent? Are the events mutually exclusive? What's the probability of either a spade or a club?
P(spade|not club) = 26/39 = 2/3 P(spade|club) = 0 So not independent Can't have both a spade and a club, so mutually exclusive P(spade or club) = P(spade) + P(club) = + =
Event A: first card is a king Event B: second card is a king Are the events independent? Are the events mutually exclusive? What's the probability of at least one of the first two cards being a king?
P(second card king|first card king) = 3/51 P(second card king|first card not king) = 4/51 So not independent Can have kings on both first and second cards, so not mutually exclusive
Tomorrow: A couple more probability tricks; review of study design, descriptive statistics, correlation Thursday: Review of regression and probability Friday: 10 a.m. sharp midterm