Hi. This tutorial covers contingency tables and conditional probability. All right, so let's start with some data. So 150 seventh grade students were asked whether they get an allowance and whether they do chores. So here's the data. So we have to split up into two variables, each with two categories-- allowance, no allowance, chores, no chores.
So remember that this is called a contingency table or a two-way table. So at the 60 means is that there are 60 out of 150 students that get an allowance and also do chores. There were 48 that do chores, but do not get an allowance, 18 that get an allowance, but don't do chores, and 24 that don't do chores and do not get an allowance. And then also, I put down here-- these are all the probabilities that match up with these frequencies.
So like 60 out of 150 is 0.4. 48 out of 150 is 0.32. We're going to primarily use this version of the table, but just know that this came from those frequencies. Let's start by assigning some letters just to simplify things a little bit. So we're going to let event A be the event that a child gets an allowance and event C be the event that a child doesn't-- does their chores, or does chores in general.
All right, so the following probabilities can be calculated directly from the contingency or two-way tables. So if we just want the probability of A-- so the probability that a student gets an allowance-- so the probability of A, probability of somebody-- seventh grade student getting allowance-- would be these two events here-- allowance and chores, allowance and no chores.
So really, all we need to do is just add up those two, so it's 0.4 plus 0.12, which equals 0.52. And sometimes it's nice to write the totals down-- these column totals. Now, if we want the probability of chores, probability of chores would be chores and allowance and then chores and no allowance. So those two added up would be 0.72. So this probability is 0.4 plus 0.32 [INAUDIBLE]
Now, this is probability of allowance. Remember, this symbol means and-- so allowance and chores. Well, that's just this number by itself, so that's just 0.4. So 40% of seventh graders get an allowance and also do chores. And then the probability of A or C-- so remember that this is an inclusive or, so this means allowance, or chores, or both.
So really, we're looking at three outcomes here. We're looking at allowance and chores, allowance and no chores-- then the other outcome could be chores and no allowance. So as long as they either get an allowance, they do chores, or they get-- or they do chores and get an allowance, this probability's satisfied.
So we're going to add up 0.4 plus 0.12 plus 0.32, and that's going to end up being 0.84. There's an 84% chance that, if you select a student, they will either get an allowance, or do chores, or get an allowance and do chores. All right, so all of these numbers can be just basically taken directly off of the table.
Now, what's a more interesting question I could try to answer using this data? So how about this one-- what is the probability of a child getting allowance if we know that he or she does chores? Now, if we know that they do chores, what's the probability that they get an allowance? So this helps answer the question, well, if you do chores, are you more likely to get an allowance? So this would be one of the numbers that might help us.
So before we actually calculate that number, let's notate it. So we want the probability. So this is a conditional probability, so we need to put in this vertical bar. And remember, that vertical bar means given-- so something, given something else. So remember, what comes after the bar is the condition.
So in this case, the condition is if we know he does chores. So we're going to put C as the condition there, and now we want to know-- the probability we're trying to calculate is the probability of getting an allowance, given that he or she does chores. All right, so how can we answer this question? Well, we can calculate this probability.
And remember that this is a conditional probability. And here are the formulas. So probability of A, given B, is the probability of A and B over the probability of B. Or if it's switched around, the probability of A goes on the bottom, instead of the probability of B.
OK, so if we're looking for the probability of A, given C, this is going to be the probability of A and C over the probability of C. So out of all of the students that do their chores, what's the probability that they also get an allowance? And we actually calculated these numbers already. So the probability of A and C was 0.4. The probability of C was 0.72.
So we're going to divide those two numbers. What we're going to end up with is 0.4 divided by 0.72, and that's going to give me about 0.556. So if we know the student does chores, there's a 55.6% chance that they will also get an allowance.
Let's do a couple more examples now of conditional probabilities using the tables here. So now, this one's backwards. Now it's chores, given an allowance. So if we know the student gets an allowance, what's the probability that they also do chores? So using the formula, this would be the probability of C and A over the probability of A.
And that's going to be C and A. That's 0.4 divided by the probability of A. Probability of are these two added up, so that's 0.52. So if we divide those two-- 0.4 divided by 0.52 is about 0.769. So there's almost a 77% chance of somebody doing chores if they get an allowance.
All right, so let's do this one now. This is the probability of not getting an allowance, given they do chores. So on the bottom, we put the condition-- probability of C. On the top, we do the probability of not allowance and chores. So the probability of no allowance and chores, that goes on the top. No allowance and chores is 0.32.
Probability of chores now-- that's going to be this 0.72. That's the row total there. So it's going to be 0.32 divided by 0.72, and that's going to end up being about 0.444. So there's a 44.4% chance of somebody not getting allowance, given they do chores.
Let's try the last one now. So it's the probability of the complement of A, given the complement of C-- so the probability of not getting an allowance, given not doing chores. So if we use the formula, it'd be the probability of complement of A and complement of C divided by probability of the complement of C.
So what's going to go on the bottom is the probability of somebody not doing chores. And what that's going to end up being is 0.28, if we add up 0.12 and 0.16. So that's going to go on the denominator-- 0.28. And then the numerator is going to be the probability of no allowance and no chores. So no allowance and no chores is here-- 0.16.
So let's go ahead and divide those two numbers-- so 0.16 divided by 0.28, and that's 0.571. OK, so of all of the students that do not do chores, there is a 57.1% chance that they also do not get an allowance. So that is just a couple conditional probability examples there. So this has been your tutorial on conditional probability. Thanks for watching.