Probability and Indpendence

If we want to use the multiplication rule for two events that are not independent, we can modify the rule to work in more general situations.

Let's compute the probability of getting two hearts when we draw two cards from a standard 52-card deck. If, after we draw the first card, we replace the first card in the deck and reshuffle, then draw the second card, the probability of the second card being a heart is unaffected by the outcome of the first card:

P(two hearts) = P(first = heart and second = heart) = P(first = heart) × P(second = heart) = `13/52 times 13/52 = 1/4 times 1/4 = 1/16`

On the other hand, if we don't replace the first card, then the probability that the second card is  heart depends on whether or not the first card is a heart:

P(two hearts) = P(first = heart and second = heart) = P(first = heart) × P(second = heart | first = heart) = `13/52 times 12/51 = 1/17`

A generalized multiplication rule says:

P(E and F) = P(E)×P(F|E)

If the two events E and F are independent, then P(F|E) = P(F) because whether or not E is true does not affect whether F is true, and this general formula reverts back to the more specialized formula we first encountered:

P(E and F) = P(E)×P(F)

We can also rewrite the general multiplication rule as:

`P(E and F) = P(E) times P(F|E) => P(F|E) = (P(E and F))/(P(E))`

Which we can use to compute conditional probabilities in certain circumstances.

Recall the class survey data we previously analyzed to investigate an association between gender and beverage preference:

  female male total
Coke 7 9 16
Pepsi 10 4 14
neither 8 3 11
total 25 16 41

We can easily compute P(Coke|male) = 7/25 = 28% but if instead we only had table percentages or probabilities:

  female male
Coke 17% 22%
Pepsi 24% 10%
neither 20%  7%
  61% 39%

we could use this new formula to compute

P(beverage = Coke | gender = female) = `(P(text(beverage = Coke) and text(gender = female)))/(P(text(gender = female))) = (0.17)/(0.61) approx 0.28`