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.

Main content

Conditional probability and independence

In probability, we say two events are independent if knowing one event occurred doesn't change the probability of the other event.
For example, the probability that a fair coin shows "heads" after being flipped is 1/2. What if we knew the day was Tuesday? Does this change the probability of getting "heads?" Of course not. The probability of getting "heads," given that it's a Tuesday, is still 1/2. So the result of a coin flip and the day being Tuesday are independent events; knowing it was a Tuesday didn't change the probability of getting "heads."
Not every situation is this obvious. What about gender and handedness (left handed vs. right handed)? It may seem like a person's gender and whether or not they are left-handed are totally independent events. When we look at probabilities though, we see that about 10% of all people are left-handed, but about 12% of males are left-handed. So these events are not independent, since knowing a random person is a male increases the probability that they are left-handed.
The big idea is that we check for independence with probabilities.
Two events, A and B, are independent if P(| B)=P(A) and P(| A)=P(B).

Example 1: Income and universities

Researchers surveyed recent graduates of two different universities about their annual incomes. The following two-way table displays data for the 300 graduates who responded to the survey.
Annual incomeUniversity AUniversity BTOTAL
Under $20,000362460
$20,000 to 39,99910956165
$40,000 and over354075
TOTAL180120300
Suppose we choose a random graduate from this data.
Are the events "income is $40,000 and over" and "attended University B" independent?
Let's check using conditional probability.
Example 1: Problem A
What is the probability that a randomly selected graduate earns $40,000 and over?
P($40,000 and over)=
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

Example 1: Problem B
What is the probability that a randomly selected graduate earns $40,000 and over given they are from University B?
P($40,000 and over | Uni. B)=
  • Your answer should be
  • a proper fraction, like 1/2 or 6/10
  • an exact decimal, like 0.75

Example 1: Problem C
Are the events "income is $40,000 and over" and "attended University B" independent?
Choose 1 answer:

Example 2: Income and universities (continued)

Here is the same data from the previous example:
Annual incomeUniversity AUniversity BTOTAL
Under $20,000362460
$20,000 to 39,99910956165
$40,000 and over354075
TOTAL180120300
Suppose we choose a random graduate from this data.
Are the events "income under $20,000" and "attended University B" independent?
Let's check using conditional probability.
Example 2: Problem A
What is the probability that a randomly selected graduate earns under $20,000?
P(under $20,000)=
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

Example 2: Problem B
What is the probability that a randomly selected graduate earns under $20,000 given they are from University B?
P(under $20,000| Uni. B)=
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi

Example 2: Problem C
Are the events "income is under $20,000" and "attended University B" independent?
Choose 1 answer:

What if the probabilities are close?

When we check for independence in real world data sets, it's rare to get perfectly equal probabilities. Just about all real events that don't involve games of chance are dependent to some degree.
In practice, we often assume that events are independent and test that assumption on sample data. If the probabilities are significantly different, then we conclude the events are not independent. We'll learn more about this process in inferential statistics.
Finally, be careful not to make conclusions about cause and effect unless the data came from a well-designed experiment. For a challenge, can you think of some outside variables — apart from the universities — that may be the cause of the income disparity between the graduates at the two universities in Example 2?

Want to join the conversation?

  • mr pink green style avatar for user chris
    At the top it says two events, A and B, are independent if P(A|B) = P(A) and P(B|A) = P(B).

    But in the last exercise we are only asked to find P(A|B) = P(A) and judge independence solely on that.

    Why are we not asked to find P(B|A) = P(B)?
    (29 votes)
    Default Khan Academy avatar avatar for user
    • primosaur seed style avatar for user Ian Pulizzotto
      Assuming that A and B are events with nonzero probabilities, P(A|B) = P(A) is actually mathematically equivalent to P(B|A) = P(B).

      We can see this because
      P(A|B) = P(A) means P(A and B)/P(B) = P(A) from definition of conditional probability,
      P(B|A) = P(B) means P(A and B)/P(A) = P(B) from definition of conditional probability, and
      P(A and B)/P(A) = P(B) is obtained from P(A and B)/P(B) = P(A) by multiplying both sides by the well-defined, nonzero quantity P(B)/P(A).

      So, assuming that P(A) and P(B) are nonzero, it's enough to test just one of P(A|B) = P(A), P(B|A) = P(B) to determine if A and B are independent.
      (55 votes)
  • blobby green style avatar for user ytcsplayz2018
    Hello everybody. I had a very challenging question in class today. There are two parts to this question. Hope this does not bug anybody.

    Based on an online poll, 35% of motorists routinely use their cell phone while driving. Tree people are chosen at random from a group of 100.

    a) What is the probability of at least two people of the three people use their cell phone while driving?

    b) What is the probability that no more than one person of the three people use their cell phone while driving?

    Thank you so much to everybody for reading this and helping me solve this problem.
    (7 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Page Ellsworth
    P($40,000 and over ∣ Uni. B) equals
    40/120, but NOT .33
    (0 votes)
    Default Khan Academy avatar avatar for user
    • primosaur seed style avatar for user Ian Pulizzotto
      Note that the correct answer is 40/120 = 1/3, but 1/3 is the repeating decimal 0.333... which is not exactly the same as 0.33. The question asks for a fraction or an exact decimal, so this is why 0.33 is marked wrong. Had the question said you could round to two decimal places, then 0.33 would have been acceptable.

      Have a blessed, wonderful day!
      (12 votes)
  • blobby green style avatar for user Moin M
    Since 10% of all people are left-handed and 12% of all males are left-handed. This means 8% of all females are left-handed. Am I right?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user Martin
      Assuming an even distribution of men and women, yes.

      So for example you have 100 people of which 50 are men and 50 are women, an 10% are left handed, then you 10 left handed people. 12% of those men are left handed. So that's 6 men and 10 - 6 is 4, so you have 4 left handed women, which is 8% of 50.

      In uneven distribution of men in women that wouldn't work like that though.
      (4 votes)
  • leaf orange style avatar for user gurushishya
    This page says that events are independent if: P(A ∣ B) = P(A)
    'and' (B ∣ A) = P(B). But on Exercise 2, only one equation is found to be true, then it declares the events to be independent without doing the 'and' and checking the other direction. Which one is correct?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user cossine
      Theorem:
      P(A ∣ B) = P(A) => P(B|A) = P(B)

      Proving the theorem is straight forward just apply definition of conditional probability (hopefully you know the definition) then make P(A and B) the subject. You will find P(A and B) = p(A)p(B).

      Using this you will find P(B|A) = P(B)
      (1 vote)
  • piceratops tree style avatar for user Daksh Gargas
    As per my understanding, "two events A and B are independent if the probability of occurrence of an event A is not affected by the happening of event B and vice-versa".
    Which is proved in Example 1
    but in Example 2, as per the mathematical formula we have proven that the two events are independent but this is counter intuitive taking Example 1 into consideration because both the cases are similar, aren't they?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user NB
    Hi and thank you Sooo much for these videos Sal.
    Is there a way to downnload the lesson summaries in pdf format? I would like to save them for later reviews.
    (2 votes)
    Default Khan Academy avatar avatar for user
  • boggle blue style avatar for user ninolatimer
    I don't get the p(A) and p(B|A) part of [p(A|B)= p(A) and p(B|A) = p(B)]

    Let's say Example 2: I'm assuming A=income under 20k and B=attended university B

    So the probability of A would equal 60/300=.2
    Probability of B = 120/300 = .4
    (B|A) is they attend uni b given they make under 20k which would be 24/60 which equals .4?
    and so p(A) and p(B|A) is .2+.4 so .6 while p(B) = .4 so they are not equal?

    But instead we just do p(A)=p(A|B)? so p that income under 20k=income under 20 and from uni B?

    Edit: Ohhh! By p(A) and p(B|A), did they mean to multiply p(A) and p(B|A) or to add them? Cause when you multiply them you get the right answer but I assumed "and" meant to add them together
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user jazlyn.trejogonzalez-90533
    confusing but soon i think ill get the hang of it
    (1 vote)
    Default Khan Academy avatar avatar for user
  • winston default style avatar for user Victor Gutierrez
    Is there a relation between dependence-independence and asociation between 2 variables?? I mean, if 2 events are independent, the correlation coeficient will be close to zero right?
    (1 vote)
    Default Khan Academy avatar avatar for user