In this segment, I will discuss conditional probability, and Bayes' theorem. Bayes' theorem is the theoretical underpinning of most of what we do within the Bayesian statistical framework. Conditional probability is when we're trying to consider two events that are related to each other. So we can ask, what is the probability of event A given that we know event B happened? This is defined as the probability that both events A and B happened divided by the probability that event B happens. For example, consider a class of 30 students Suppose within this class, there are 9 female students. Suppose also, we have 12 computer science majors. And of which, 4 are female. So then, we can ask questions about probabilities of the segment population. We can say the probability that someone's female is 9 in 30 or 3 in 10. The probability of someone, who is a computer science major is 12 over 30, or 2 in 5. The probability that someone is both female, and a computer science major, we have the 4 out of 30. So now we can ask conditional probability questions. What's the probability that someone is female given they're a computer science major? So if we think about the definition, we can work with that. This is the probability that someone is female, and they're a computer science major divided by the probably their computer science major. Probability that someone is female, and computer science is right up here, this is 2 out of 15, and probably their computer science major is 2 in 5. You can simplify this down, to get this probability is 1 in 3. We can also think about that in the original framework here of the 12 computer science majors, what fraction are female, that's exactly what this probability is saying. The probability that they're female given they're computer science. And so there we could just look at the 4 over 12, that would give us the same answer of 1/3. It's an intuitive way to think about a conditional probability is that we're looking at a sub segment of the original population, and asking a probability question within that segment. We can also look in the other direction, suppose we want to know what's the probability that someone's female given they're not a computer science major, or I might denote that, as CS compliment. In this case, we can say it's a probability female, and not computer science over the probability of not computer science, and this is 5 in 30 over 18 in 30, or 5 over 18. There's a concept of independence, which is when one event doesn't depend on the other. When two events are independent, we have that the probability of A given B is equal to just the probability of A, it doesn't matter whether, or not B occurred. When this is true, we also get that the probability of A and B happening is just the probability of A times the probability of B. This is a useful equality that we'll use throughout this course. In this case, we can see that the probability of being a female given they're computer scientist is not equal to the marginal probability that they're female. And so, being female and being computer science are not independent.