lecture 16

Upload: abhishek-sharma

Post on 31-Oct-2015

3 views

Category:

Documents


0 download

DESCRIPTION

vb cv cvfbvdfvdffbdfbdfbvfvbdfbdfbdfbdffbdfb

TRANSCRIPT

  • STAT 2Lecture 16:

    Adding and multiplying probabilities

  • 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%

  • Example: the deck of cards

    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?

  • Example: the deck of cards

    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

  • Example: the deck of cards

    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?

  • Example: the deck of cards

    P(1st card is queen of spades) = 1/52

    P(2nd card is six of diamonds, given 1st was queen of spades) = 1/51

    P(3rd card is queen, given 1st was queen of spades and 2nd was six of diamonds) = 3/50

  • Example: the deck of cards

    P(1st card is queen of spades, 2nd is six of diamonds, 3rd 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

  • Today

    Independent events Mutually exclusive events and the

    addition rule Trees and Venn diagrams

  • I

    Independent events

  • Independent events: definition

    Two events are independent if the outcome of one event doesn't change the probabilities of the outcomes of the other event

  • Independent events: example

    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

  • Independent events: example

    When events are independent, the conditional probability is the same as the unconditional probability

    P(2nd toss is a head | 1st toss is head) = P(2nd toss is head | 1st toss is tail) = P(2nd toss is head) = Note: a vertical line | denotes given,

    i.e. a conditional probability

  • Independent events: example

    If I toss a coin twice:P(two heads) = P(1st toss head and 2nd toss head) = P(1st toss head) * P(2nd toss head |

    1st toss head) by multiplication rule = P(1st toss head) * P(2nd toss head) = * =

  • Dependent events: example

    I deal 2 cards from a shuffled deck. First event: the first card is a king Second event: the second card is a

    queenHow do we show these events are

    not independent?

  • Dependent events: example

    P(2nd 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

  • The and formula

    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

    Mutually exclusive events

  • 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

  • The addition rule

    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

  • Example: the addition rule

    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

  • The addition rule: advanced

    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)?

  • The addition rule: advanced

    Possibilities: Both a king and a spade A king but not a spade A spade but not a kingThese three possibilities are

    mutually exclusive

  • The addition rule: advanced

    P(Both a king and a spade) = 1/52P(King but not a spade) = 3/52P(Spade but not a king) = 12/52 P(King or spade)= 1/52 + 3/52 + 12/52= 16/52 = 4/13

  • The addition rule: advanced

    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)

  • Example: homework problemI 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/8P(HTH) = 1/8P(THH) = 1/8P(2 heads) = 1/8 + 1/8 +1/8 = 3/8

  • Multiplication and addition for probability trees 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

  • Example: deck of cards

    I deal two cards from a shuffled deck. What is the probability of:

    Two spades? One spade? No spades?

  • Example: deck of cards

  • Example: deck of cards

    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

  • Example: Venn diagram

  • Example: Venn diagram

    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

  • Example: Venn diagram

    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?)

  • Example: Venn diagram

    G = 5%D+G = 20%E+G = 15%F+G = 10%A+D+E+G=35%B+D+F+G=30%C+E+F+G=25%

  • Example: Venn diagram

    Students taking at least one of the three subjects = 5+5+5+15+10+5+5 = 50%

  • Example: Venn diagram

    Note that circles may not overlap (events may be mutually exclusive)

  • V

    Putting it all together

  • The deck of cards

    Event A: first card is a queenEvent B: first card is a spade Are the events independent? Are the events mutually exclusive?

  • The deck of cards

    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

  • The deck of cards

    Event A: first card is a spadeEvent 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?

  • The deck of cards

    P(spade|not club) = 26/39 = 2/3 P(spade|club) = 0So not independent Can't have both a spade and a club,

    so mutually exclusive P(spade or club)

    = P(spade) + P(club) = + =

  • The deck of cards

    Event A: first card is a kingEvent 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?

  • The deck of cards

    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

  • The deck of cards

    P(A or B) = P(A) + P(B) P(A and B)

    P(first or second card king)

    = P(first card king) + P(second card king) P(both kings)

    = 4/52 + 4/52 (4/52*3/51) = 14.9%

  • Rest of the week

    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