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

Analyzing event probability for independence

Sal uses an example about shirts, scarves, hats, and pants to explain how to use probabilities to figure out if two events are independent. Created by Sal Khan.

Want to join the conversation?

  • blobby green style avatar for user harinarayanan.sree
    Quite confused with Sal's explanation on independent events in this video. Consider a case if there was one more say a Blue Tie....thus P(A) = 4/7; P(B)= 2/7 ; P(A|B)= 1/2; P(B|A)=1/4; P(A and B)=1/7; So as per Sal's explanation here about independent events P(A) not= P(A|B) and P(B|A) not= P(B) and P(A and B) not=P(A)*P(B). Please try to explain this...as adding one more apparel should not make the independent events dependent...Pls explain...thanks
    (19 votes)
    Default Khan Academy avatar avatar for user
    • male robot johnny style avatar for user Thomas B
      The problem is that now you have unbalanced the probabilities, so they are no longer independent. Since shirts only make up 1/4 of blue items, but 1/3 of green items. Knowing that an item is a shirt decreases the chances that the item is blue, since you are only 1/2 instead of 4/7. Likewise, knowing you have a blue item decreases the chances that it is a shirt since it drops from 2/7 to 1/4. If you had added a blue tie and a green tie, then the independence would have been preserved.
      (12 votes)
  • blobby green style avatar for user Sajit Sridharan
    @ Probability of A and B are independent of each other.

    A --> Select a Blue garment
    B --> Select a Shirt

    There is a Blue Shirt in the Sample Space. So if A happens to select the Blue shirt. Then for sure the chance of B selecting a Shirt is impacted since there is one less shirt to select from.

    In this case, how is it that A and B are independent events ?
    (11 votes)
    Default Khan Academy avatar avatar for user
    • hopper cool style avatar for user JPhilip
      Tomas chooses a garment at random. So if he happens to choose the blue shirt, then A and B are true. A and B are groups of possibilities, not selections. To be clearer, Tomas doesn't select a blue garment, and then select a shirt, he simply picks one at random. So A and B can be independent events.
      Tell me if you still have questions, or if this wasn't clear enough, please. :)
      (5 votes)
  • aqualine seed style avatar for user Panda
    I think this is just a coincidence that p(A)=p(A/B) and p(B)=p(B/A) , so it is wrong to say that events A and B are independent events.
    Suppose we have a blue shirt, a blue hat, a green scarf, a blue pants and a green pant. Then p(A)=3/5, p(B)=1/5, p(A/B)=1, p(B/A)=1. So are events A and B independent events?
    Right now, I am completely lost. what is the definition for independent events?
    (8 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user David Chamberlain
      I agree with Thomas B. For example, it will not work if you have 2 blue shirts (7 items total). P(A)=4/7, P(A | B)=2/3. I get that the "events" in the video are formally independent, purely thanks to the numbers of items chosen (as xuyanqun put it, "coincidental"), but it would be good to have some discussion of how this is different from the kind of causal independence described in the bag of marbles example.
      (4 votes)
  • starky seedling style avatar for user jthunter316
    I'm a little confused. Does it require that P(A)= P(A|B), P(B)= P(B|A), AND P(A and B)= P(A) * P(B) to prove that the two events are INDEPENDENT?

    After going through the questions after this video, I seemed to get them wrong even though I had the above situations fulfilled.

    Maybe I did my math wrong, but could someone just make sure I'm right in saying that ALL of the above THREE situations are required to be TRUE to prove that the two events are INDEPENDENT?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leaf blue style avatar for user Dr C
      Yes and no. They do all need to be true, but that's fine, because if one is true, then the others will be true as well.

      If events are independent, then P(A and B)= P(A) * P(B).

      If P(A and B)= P(A) * P(B), then:

      P(A) = P(A and B) / P(A) = P(A) * P(B) / P(A) = P(A).

      And similarly for P(B).
      (5 votes)
  • blobby green style avatar for user InnocentRealist
    It seems as if P(A|B) is not hardly at all defined in this video. E.g. If it meant choosing from the remaining items after 1 shirt is removed, then it could be either 2/5, or 3/5; and it's dependent. It's almost as if Sal left it undefined so he could get the desired answer (which I doubt is true). It's confusing (but I admit, interesting). So, anyhow... What's up with that?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user 90.Percent
      My reading of the question from Joe Mason is that there is confusion over whether one item was selected and removed from the pile, and subsequently another item was selected, or whether only one item was selected in total. In this question, only a single item was selected, however it is easy to misconstrue that fact, as many "conditional probability" questions are depicted as first removing an item, and calculating the probability of the 2nd event due to the first event.

      In your response to Joe, I think its a little confusing to describe P(A|B) as - "... first apply the condition: Take all the shirts out and put them in a separate pile, and then we select from that pile". I agree that that analogy is mathematically correct, however it doesn't fit with the description in the question that the person chose an item at random from the whole pile.

      For this question, might it be clearer to describe P(A|B) as - "given the knowledge that a shirt was chosen at random from the pile (event B), the conditional probability that the shirt was blue, i.e. the probability of (A given B) or P(A|B)". In calculating P(A|B), the sample space is reduced to the items which satisfy condition B only (i.e. shirts), and the question becomes items which satisfy condition A (blue garments) which are found in sample space B (shirts).
      (2 votes)
  • blobby green style avatar for user Tony Greenwood
    So, I'm a little confused about the implication relationships between the statements of independence...

    So, if P(AIB)=P(A) then P(A) is not dependent on P(B), and if P(BIA)=P(B) then P(B) is not dependent on P(A): that much is clear to me.

    What I'm not sure on is this, to prove that P(A) and P(B) are independent, do I have to prove both P(AIB)=P(A) as well as P(BIA)=P(B), or do I just have to show that one of them is true? In other words, does P(BIA)=P(B) imply that P(A) and P(B) are independent? Or does it only show that P(B) is not dependent on P(A)?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user Jesse
      A is independent of B iff B is independent of A. Proof:
      P(AnB) = P(A) * P(B|A) and P(AnB) = P(B) * P(A|B). Thus, P(A) * P(B|A) = P(B) * P(A|B) [1].
      Assume that A is independent of B. Then P(A|B) = P(A).
      Substituting into [1] yields P(A) * P(B|A) = P(B) * P(A).
      Dividing both sides by P(A) yields P(B|A) = P(B).
      Thus, B is independent of A.
      The converse by symmetry. QED.
      (3 votes)
  • duskpin ultimate style avatar for user newtodisworld
    What if there were only one blue shirt and no green shirt?
    In this case, will the two events remain independent?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • piceratops tree style avatar for user Silvers
    I've watched many many videos here in Khan academy, and this is the first time i got so much confused. Seeing the comments i think that other people are confused as well. Maybe it should get reworked or smt?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • starky ultimate style avatar for user horus.scope
    In the "Dependent probability" quiz, there is a question about pirates and battle volleys, in summary:
    captain fires and hits 4/5 of the time unless he's hit, then he misses forever
    pirate fires and hits 2/5 of the time until he's hit
    the Q&A of the real question is irrelevant to my question.
    What I want to know is how do you calculate the victory probability of each combatant toward infinity? I'm assuming there is a short form solution that does not require stepping through a simulation for an absurd amount of times. Rather is there a derived solution? Of course, in an infinite sample space, there could be incredibly long streaks of misses.
    (2 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user robshowsides
      Great question! You are correct that one can derive an exact solution with just a couple lines of algebra. But the fact that you would think of such a good question makes me think you would enjoy figuring out the answer! So for now I'll just give you some hints. :) The thing to realise is that there is a recursive way of writing down an equation that handles the fact that, as you said, there is in theory an infinite space of possible outcomes, since they could each miss an unlimited number of times before one of them finally hits the other. Let's say the Captain (C) shoots first. Either he hits the Pirate (P), and the battle ends, or he misses, and P gets a shot. Then either P hits and wins, or he misses, and it is C's turn. BUT HERE IS THE TRICK: If C misses, then P misses, and it is C's turn to shoot, it is as if we are just starting the game again from the beginning! That is, IF they both miss their first shot, THEN the probability of winning (from that moment forward) is exactly the same as the probability of winning was at the very beginning of the game. So, in a word-equation, it should be something like:
      {probability that C wins a battle} = {probability that C wins with his first shot} + {probability that C wins a battle, AFTER a C miss and a P miss}
      That "AFTER" could also be a "given", which means it's a conditional probability. Can you finish it?
      (2 votes)
  • male robot hal style avatar for user enrique mas
    : the P(A/B) = 1/2?
    the probability of A given that B has happened.....

    what is the probability that B happens:? : 1/3

    what is the probability that A happens once B has happened? 1/2 out of that initial 1/3

    so P(A/givenB) should be 1/6
    (1 vote)
    Default Khan Academy avatar avatar for user

Video transcript

Voiceover:Tomas's favorite colors, Tomas's favorite colors are blue and green. He has one blue shirt, one green shirt, one blue hat, one green scarf, one blue pair of pants, and one green pair of pants. Tomas selects one of these garments at random. Let A be the event that he selects a blue garment. Let B be the event that he chooses a shirt. Which of the following statements are true? And they all, let's see, and before I even read them, they all deal with the probability of event A probability of event B, probability of B given A, probability of A given B, probability of A and B. So actually let's just calculate these things ahead of time before we even look at these right over here. So let's just think about, let's just think about probability of A. The probability of A. That's the probability that he picks a blue, he selects a blue garment. So how many equally likely outcomes are there? Well, there's one, two, three, four, five, six equally likely outcomes. And how many involve selecting a blue garment? Well, there's one, two, three of the equally likely outcomes involve selecting a blue garment. So he has a 3/6 or 1/2 probability of selecting a blue garment. So what's the probability of B? What's the probability of B? And I'll use neutral colors since we're just saying he's B the event that he chooses a shirt. So once again, there's six possible items equally likely outcomes here, and which involve a shirt. Well, there's one, there's two, so it looks like two of the six involve picking a shirt. Or we could say the probability of B is equal to 1/3. Now what's the probability of A given B? Let's write that down. What's the probability of let's use a new color, What's the probability of A given B? I'll do those in the colors. A given that B has happened. So this is saying what's the probability of A given B? The probability of A given B is the probability that he picks a blue garment given that he has picked a shirt. So, this the given B that restricts our outcomes to these two. So the probability that he picks a blue item well, that's one out of the two equally likely ones. So that is a 1/2 probability that he picks a blue garment given that he's picked a shirt, and that's because there is one blue shirt and one green shirt. Let's look at the probability of B given A. Probability of B given A. B given, probability of B given A. So assuming we have picked a blue garment. So assuming we've picked a blue garment. So it's either that one or that one. What's the probability that we have also, What's the probability that we have also chosen a shirt? Well, there's one, two, three possibilities, equally likely possibilities that we have a blue garment. And only one of those involve a shirt. So the probability of B given A is 1/3. And then finally we can think about probability of A and B. So the probability, probability, of A and B, A and B. So this is the probability of picking a blue shirt. So only one out of the six equally likely outcomes is a blue shirt. So this one right over here is going to be one, one over six. So now that we've figured out all of that let's see if we can answer these questions. The probability of A given B equals the probability of A. And that does work out. Probability of A given B is 1/2. And that's the same thing as the probability of A. The probability that Tomas likes a blue garment given that he has chosen a shirt is equal to the probability that Tomas likes a blue garment. Yep, that's exactly. So I guess the words are just rephrasing what they wrote here in a more mathy notation. So this is absolutely true. The probability of B given A is equal to the probability of B. Yep, the probability of B given A is 1/3. The probability of B is 1/3. The probability that Tomas selects a shirt given that he has chosen a blue garment is equal to the probability that Tomas selects a shirt. Yep, that's right. Events A and B are independent events. Independent events. So two events are independent if, well let me write it in math notation. These are independent if the probability of A given B is equal to the probability of A. Then we can say A and B are independent. Because the probability of A, then if this is true then this means the probability of A given B isn't dependent on whether B happened or not. It's the same thing as the probability of A. This would lead to these events being indpendent. So if you had the probability of B given A is equal to the probability of B. Same argument. That would mean they are independent. Or, if we said that the probability of A and B is equal to the probability of A times the probability of B then this also means they are independent. We know that this one is true. The probability of A and B is 1/6. The probability of A times the probability of B is 1/2 times 1/3 which is 1/6. So all of these are clearly true. So we can say that A and B are independent. The probability of A is independent of whether B has happened or not. The probability of B happening is independent of whether A has happened or not. The outcome of events A and B are dependent on each other. No. That's the opposite of saying they are independent. So we can cross that out. Probably of A and B is equal to the probability of A times the probability of B We already said that to be true. 1/6 is 1/2 times 1/3. The probability that Tom selects a blue garment that is a shirt is equal to the probability that tom selects a blue garment multiplied by the probability that he selects a shirt. Yep. That is absolutely right. So actually this is, a lot of these statements are true. The only one that is not is that the outcome of events A and B are dependent on each other.