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

Dependent probability

Sal finds dependent probabilities like P(A | B) using an example rolling dice. Created by Sal Khan.

Want to join the conversation?

  • leafers ultimate style avatar for user John Holmes
    The name of the video is Analyzing dependent probability,
    Does the math indicate the events are independent?
    P(A) = P(A|B)
    P(B) = P(B|A)
    P(A and B) = P(A) x P(B)
    are all true.
    (50 votes)
    Default Khan Academy avatar avatar for user
    • piceratops ultimate style avatar for user Ole Drews Jensen
      @xMcBrennanx:

      The fact that they are rolled simultaneously has nothing to do with that. You could have rolled the 6-sided die first, watched a movie, and then rolled the 4-sided die next.

      The thing to look for is that the outcome of the 4-sided die has nothing to do with the outcome of the 6-sided die. Whatever the 6-sided die shows, does not make a difference in what the 4-sided die is capable of showing.

      I agree with D.A.P. that the title should have been different.
      (10 votes)
  • piceratops ultimate style avatar for user Kevin George Joe
    so all these formulas:
    P(A) = P(A|B)
    P(B) = P(B|A)
    P(A and B) = P(A) x P(B)
    only work for independent events am i right in saying that? and they should not work for dependent events, right?!
    (11 votes)
    Default Khan Academy avatar avatar for user
    • starky sapling style avatar for user Naobotic24
      Let's have an example:
      S= {1,2,3,4,5,6,7}
      A is a subset of S including even numbers: 2,4,6
      B is a subset of S, B= {1,2,3}
      P(A)= 3/7
      P(B)= 3/7
      P(A|B)=1/3 => P(A) is not equal to P(A|B), that means B effects the probability of A. oR you can say: when B happens, the probability of A changes. Therefore, A and B are dependent events.
      P(B|A)= 1/3 is also not equal to P(B), because A and B are dependent events. (A effects the probability of B)
      P(A and B)= P(A).P(B|A) OR P(A).P(B)?
      If I calculate the probability of A first, that means i let A happen first. Remember that A effects the probability of B. So when A happens first, the probability of B must be calculated in the condition of A, so it must be multiplied by P(B|A), not P(B) (the probability of B, doesn't care for A happening or not)
      The right formula for P(A and B) when A and B are dependent events is P(A and B)=P(A).P(B|A) = P(B).P(B|A)
      In independent events, we don't have to care if A happens first or not happen, because even A happens or not, the probability of B does not change. That's why we have the formula: P(A and B)=P(A).P(B) (A and B are independent)
      Hope this helps
      (8 votes)
  • duskpin ultimate style avatar for user Evron Gene James Barber
    Has anyone else noticed that simplifying each answer as they are completed (within Dependent Probabilities) makes the proceeding problems more confusing? For instance, there's a difference between the answers for questions 1 and 2 simplified and the answers for 3 and 4. Even though they both have the same fractions (1/6 and 1/4).

    The trouble I have is using the visual dice chart while solving a problem that requires me to reference the preceding simplified answers. One has to remember that the answer to 1 is always 4/24 (The whole visual dice chart) even if you simplify it to 1/6. While answer 3 is always 1/6 because it is only dealing with the bottom most horizontal line on the visual dice chart. I think if the answers are kept unsimplified until the very end, it will make the visual dice chart clearer, and the previous questions more helpful as a reference.
    (7 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user joshua.cearley
    Why isn't the uniform distribution mentioned at all? Its very tedious having to count tiles out repeatedly for the same question over and over, when simple dice probabilities can be less tediously done with a simple formula.
    (1 vote)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user Kate
    What is the conceptual reasoning behind multiplying the simple probabilities with the dependent probabilities I.E.: P(A) x P(A | B) ? I'm having trouble rationing out the reason behind the equations when the problem is independent. What would it do when it's dependent?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • leaf blue style avatar for user Dr C
      Probably a better way to understand it is going the other way. The definition of conditional probability is:

      P(A|B) = P( A ∩ B) / P(B)

      In this, we are scaling the intersection by the probability of B. Think of a Venn Diagram with two circles for events A and B. Then, when we add the condition on B, we are saying that we know B already happened. So we want to consider ONLY the area that is inside of B. From that perspective, the probability of A, given that B occurred, is just the proportion of the B circle which also contains A.

      This is nothing more than a ratio, the same thing you'd do if you were to calculate, say, the percentage of girls in a Stat class: We'd count how many girls are in the class, and divide that by how many people are in the class. So in the case of conditional probability, we'd find the probability of the intersection, and divide by the probability of the full circle of B, to get that formula up above.

      The idea of multiplying the conditional probability by the probability of the condition is simply doing this process in reverse. Look back up at that formula. The denominator, P(B), is just a probability, just a number. We can rearrange that formula by, say, multiplying both sides of the equation by P(B). When we do that, we get:

      P(A|B) x P(B) = P( A ∩ B)

      Or put another way: We obtained the conditional probability in the first place by scale the probability of the intersection by the probability of B. To get the probability of the intersection, all we have to do us "upscale" the conditional probability.
      (9 votes)
  • blobby green style avatar for user StebbyCarrotarrow
    Is it a coincidence that in the example, P(A) = P(A | B) and P(B) = P(B | A)?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Hinklet Everest
    As to or so, if she's rolling simultaneously, it seems to me that the question "what is the probability that she rolls doubles given that the 4 sided die is 4?" just means "What is the probability that she rolls a 4 and a 4?", which is 1/24, being 1 outcome out of 24.

    Same for all the following questions.

    Ie, it's one outcome out of 24 possible ones.

    If she was rolling the dice one after the other, THEN given that she rolled a 4 first (a probability of 1/4, which is no longer relevant because it is a certainty), then the probability of getting a 4 on the 6 sided die is the only question, and THAT is 1/6.
    (2 votes)
    Default Khan Academy avatar avatar for user
    • cacteye blue style avatar for user Jerry Nilsson
      It doesn't matter whether the dice are rolled simultaneously or not, the given premise is that the four-sided die lands 4.

      One way of viewing this is that we keep rolling the two dice until the four-sided lands 4, and then we calculate the probability that we rolled doubles, which would be 1∕6.
      (2 votes)
  • aqualine ultimate style avatar for user giacomo
    why my brain thinks that rolling these two dies are independent events?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • winston default style avatar for user Shayaan Qureshi
    Can P(A|B) * P(B) and P(B|A) * P(A) ever be different in any two cases?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • leafers tree style avatar for user nikita.jakkam
    Quick question, at when Sal is talking about P(A | B), the calculation would be
    P (A and B) = P(A) * P(A | B) or
    P (1/6 * 1/4) = 1/6 * P(A | B) or
    P (1/24) = 1/6 * P(A | B) and then dividing both sides by 1/6
    You get: 1/4 = P(A | B) or the answer is 1/4, but the real answer is 1/6... Am I doing the formula wrong? Why is this not working?
    (0 votes)
    Default Khan Academy avatar avatar for user

Video transcript

Voiceover:Suppose that Erika simultaneously rolls a 6-sided die and a 4-sided die. Let A be the event that she rolls doubles, let me write this, A be the event that she rolls doubles and B be the event that the 4-sided die is a 4. Use the sample space of possible outcomes below to answer each of the following questions. Fair enough. What is probability of A, the probability that Erika rolls doubles? Over here, we have our sample space of possible outcomes. Each of these are equally likely, and so let's see how many of them there are. There are 1, 2, 3, 4 by 1, 2, 3, 4, 5, 6, so there are 24 possible outcomes, which makes sense. There's 4 possible outcomes for the 4-sided die and 6 possible outcomes for the 6-sided die, so you have a total of 24 equally likely outcomes, so probability of, let me write it here, so probability of A is going to be the fraction of the 24 equally likely outcomes that involve event A, that she rolls doubles. Let's think about that. This is she has rolled doubles, 1 and a 1. They don't look the same but they're both 1s. Let's see. We have a 2 and a 2. We have a 3 and a 3, and we have a 4 and a 4. And it's impossible to have a 5 and a 5 because the 4-sided die only goes up to 4. So there's 4 possibilities, 4 of the 24 equally likely possibilities involve rolling doubles. There is a 4/24 probability, or if we divide the numerator to the denominator by 4, it is a 1/6 probability that Erika, a 1/6 probability that Erika rolls doubles. What is probability of B, the probability that the 4-sided die is a 4? The probability of B, well, once again, there's 24 equally likely possibilities, and how many of them involve the 4-sided die being a 4? You have all of these right over here involve a 4-sided die being a 4. So this is 1, 2, 3, 4, 5, 6 of the 24 equally likely possibilities, or you could say 1/4 of the equally likely possibilities or the probability is 1/4, which makes sense because probability of B, it ignores the 6-sided die, and it just says what's the probability that the 4-sided die is 4? Well, that's 1 one of the 4 possible outcomes for that 4-sided die. What is the probability of A given B, the probability that Erika rolls doubles given that the 4-sided die is a 4? Let's just think about this a little bit, probability of A given that B has happened, given that B has happened. Essentially, we are restricting our equally likely possibilities now to the situation where B has happened. Given B means we're assuming that B has happened. Now, we're restricting our sample space of possible outcomes where B has happened to this right over here. Now there are 1, 2, 3, 4, 5, 6 equally likely outcomes. How many of them involve A happening? This one right over here that we had already circled, this is the one out of the 6 equally likely outcomes that involve doubles, so there is a 1/6 probability. Now that makes sense. Let me just write this down. This is 1 over 6. Why does this make sense? Because with a 4-sided die we're assuming is a 4. So essentially, this is analogous to saying when you roll a 6-sided die, what's the probability that you get a 4 as well, because that's the only way you're going to get doubles, given that the 4-sided die is 4. And we see that right over here. The 6-sided die has to be a 4 as well in order for this to be doubles because we're assuming it's given that B, we're given event B, we're restricting our sample space with event B. What is the probability of B given A, the probability that the 4-sided die is 4 given that Erika rolls doubles? Let's just think about that a little bit. The probability of B given A, B given that A is true. So what's this going to be? This means we're going to restrict our sample space to essentially 4 equally likely outcomes that A has happened so where A is true, I guess I could say. So there's 1, 2, 4. And how many of them involve event B being true? Well, the only one of these 4 that involve event B being true is this one right over here, where we've got our doubles. So there is a 1/4 probability that if we assume, given that we've gotten doubles, the probability that the 4-sided die is a 4. This is a 1/4 probability, and that makes sense. If we've got doubles and one of them is a 4-sided die, we either have doubles at 1, doubles at 2, doubles at 3, or doubles at 4. You see that here, doubles 1, doubles 2, doubles 3, doubles 4. Well, given that, what's the probability that the 4-sided die is 4? Well, that means that's one out of these 4 outcomes where it's a double 4 is right over here. All right. What is the probability of A and B, the probability that Erika rolls doubles and the second die is 4? This means both A and B happened. Let's look at this. Actually let me write it here. Let me do it in a new color. The probability of, and I'll write "and" here in a neutral color, the probability of A and B. Probability of A and B is equal to. Well, now, we're looking at once again, we have 24 equally likely outcomes. We have 24 equally likely outcomes. How many of them involve A and B? To get A and B, you have to have doubles and the 4-sided die needs to be a 4. Essentially, you have to have doubles 4. Well, there's only one outcome out of the 24 equally likley outcomes that meets that situation, this one right over here, so there is a 1/24 probability, 1/24. What is probability of A times probability of B given A? Here, we could just go back to our numbers right over here. Probability of A, that's going to be 1/6. Let me do that in a magenta color. I like to keep my colors, be careful about my colors. That's 1/6 times the probability of B given A. So the probability of B given A is 1/4 right over here, times 1/4, which is, curious enough, 1/24, 1/24. What is probability of B times probability of A given B? Probability of B, we figured out, is 1/4, 1/4, and the probability of A given B is 1/6, times 1/6, which is equal to 1/24. Now does it make sense that the probability of A and B is 1/24, the probability of A times probability of B given A is 1/24, and the probability of B times probability of A given B, they're all 1/24? Is this always going to be the case? Well, sure. Think about what probability of A and B means. What I mean is that they both happened. But that's the same way as saying what's the probability of, let's just say A is happening. Well now, for B and A to happen, it's just going to be that times the probability that B is true given that A is true, because you could say, well, are you constraining it. We're already multiplying by the probability of A being true, and now we're multiplying by the probability that B is true given A is true. I actually often like to swap these around just so it gets a little bit clearer in my head. This one, let's just write it like this, the probability of B given A times the probability of A. This is the probability that event A is true, and this is the probability that event B is true given that we know that A is true. It completely makes sense that this is going to be the same thing as the probability of A and B. Clearly, this is a probability of both of these, both A and B happening. You can go the other way around. The probability of A given B times the probability of B, that would also be, so B ... We're saying B needs to be true, and that given that B is true, that A needs to be true as well, so it makes complete sense that this is going to be the probability of A and B as well.