If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: Statistics and probability>Unit 7

Lesson 9: Conditional probability and independence

# Calculating conditional probability

Conditional probabilities are written like P(A|B), which can be read to mean, "the probability that A happens GIVEN b has happened." If we know probabilities like P(A), P(B), and P(A|B), we can solve for other probabilties like P(B|A). Created by Sal Khan.

## Want to join the conversation?

• Why P(A and B) != P(A)*P(B). Because those events dependent?
• When A and B are independent, P(A and B) = P(A) * P(B); but when A and B are dependent, things get a little complicated, and the formula (also known as Bayes Rule) is P(A and B) = P(A | B) * P(B). The intuition here is that the probability of B being True times probability of A being True given B is True (since A depends on B) is the probability of both A and B are True.
• I'm a bit confused by this video. Basically, the video says that P(A) [Eating a bagel] is dependent
on P(B) [Eating a pizza for lunch]. But what I don't understand is why is P(B) dependent on P(A)? Nothing in the question indicates that having a bagel for breakfast affects having a pizza for lunch. Why, therefore, is P(B) dependent on P(A)?
• There does not have to be a causative relationship between A and B, just a correlation.
Suppose I have 4 friends:
Amy is on the basketball team and has red hair.
Bill is a cheerleader for the basketball team and has black hair.
Diego hates basketball and has brown hair.

Only 25% of my friends have red hair (Amy).
But if I tell you that I'm going to watch one of my friends play basketball, it has to be Amy (red hair) or Chad (blond hair), so there is a 50% chance that I am referring to a friend with red hair. Amy's red hair did not make her more likely to play basketball, it is just an accident of the situation.
• Can you explain how to work out Pr(A'|B')?
• When we say S ∩ Q , we mean that both S and Q should happen isn't it.
So we can express that in 2 ways.
Why 2 ways?, Because S ∩ Q = Q ∩ S (Commutative law is satisfied) (Eg. Bagel and Pizza <=> Pizza and Bagel)
1) Event S happening and Event Q happening given that S has already happened
(or)
2)Event Q happening and Event S happening given that Q has already happened

We can express 1) as: P(S ∩ Q) = P(S) * P(Q | S)---------------(alpha)
and we can express 2) as: P(Q ∩ S) = P(Q) * P(S | Q)--------------(beta)

Since intersection is commutative , (alpha) and (beta) both are same.
so using the values you mentioned, you can substitute them and solve it.
:)
• Is it possible that a dependency is valid only in one-direction? In other words, is it possible that B affects A, but A does not affect B. I believe there are real life examples of one-way dependencies.

If that is the case, then
P(A & B) = P(A given B) . P(B) = P(B given A) . P(A) could be rewritten as follows:
P(A & B) = P(A given B) . P(B) = P(B) . P(A) and if that is true, then
P(A given B) must be equal to P(A) which indicates that A & B are independent? I appreciate your feedback. Thank you.
• I don't get it, HOW can the likelihood of what you have for breakfast be influenced what you have for lunch! I can't even begin to try to draw this out via a tree diagram.
• Don't infer cause from dependence. If we look at the likelihood of what you eat for breakfast, there will be a frequency of each choice. The dependence merely observes that the frequency of choosing a bagel happens to be higher than usual on the days you also choose to eat pizza for lunch. There is no consideration of how, or even a claim that there is such a how. We simply notice the likelihood is higher and treat as dependent.
• I know this sounds really basic, but how would you go about answering an example like this?

A survey of college students finds that 20% like country music, 15% like gospel music and 10% like both country and gospel music.

The conditional probability that a student likes country music given that they like gospel music is.. ??
(1 vote)
• Conditional probability P(A | B) = P(AnB) / P(B)

So you're looking for the probability of both, divided by the probability of the thing that is the given that. 10 / 15. 66.7%
• I'm confused with this. Wouldn't P(A and B) be equal to A * B, or 0.6 * 0.5? To find P(A and B), Sal is multiplying P(A | B) by P(B), or 0.7 * 0.5, which gives another answer. Can anyone explain which method is correct?
• Multiplying P(A) and P(B) only works when A and B are independent. When they are not independent, then you need to use the conditional probability.