Welcome to our next lesson on probability. In our previous session, we focused on the union of events, learning how to calculate the probability of "A or B" using the addition rule. We saw that the key was to handle the overlap, or intersection, between the events correctly to avoid double-counting.
Today, we shift our focus directly to that intersection. We'll explore how knowing that one event has occurred can change the probability of another. This concept is called conditional probability, and it is one of the most fundamental ideas in all of statistics and machine learning. By the end of this lesson, you will be able to calculate conditional probabilities and use them to determine whether two events are independent—that is, whether they influence each other at all.
The Idea of a Reduced Sample Space
Imagine you roll a standard six-sided die. The probability of rolling a 2 is . But what if I tell you that I've already rolled the die and I can confirm the result is an even number? Does the probability of it being a 2 change?
Of course it does. The original sample space was . With the new information, we can discard the odd numbers. Our "universe" of possible outcomes has shrunk; the new, reduced sample space is now just . Within this new reality, the probability of the outcome being a 2 is now .
This is the core intuition of conditional probability: new information restricts the sample space, which can alter the probabilities of events within it. The following video provides an excellent introduction to this idea.
An Introduction to Conditional Probability
This video from jbstatistics, "An Introduction to Conditional Probability," starts with the exact die-rolling scenario we just discussed to build your intuition.
Please watch the segment from the start of the example. Notice how the narrator explicitly defines the "reduced sample space" and recalculates the probability based on this new, smaller set of possibilities.
This idea of restricting the sample space can be visualized effectively. If we think of our sample space as a large area, and events as regions within it, conditioning on an event B means we are now only concerned with the area inside B.

The Formal Definition of Conditional Probability
Our intuitive understanding—that we're looking at the fraction of the "new" sample space B that also corresponds to A—leads directly to the formal definition. The "part of B that is also A" is the intersection, . The size of our new sample space is simply the probability of B, .
Therefore, the conditional probability of A given B, written as , is defined as:
This formula holds provided that , as we cannot condition on an event that has no chance of happening.
The next resource provides a concise, formal definition and solidifies the concept using Venn diagrams and a clear mathematical derivation.
An Introduction to Conditional Probability
Let's return to the same video, which now formalizes the intuition we've built.
Watch the section from where the narrator introduces the definition. Pay close attention to how the Venn diagram is used to justify why the formula divides the probability of the intersection by the probability of the given event.
To see this formula in action, let's work through a classic example. The MIT OpenCourseWare notes below provide a clean, step-by-step application of the formula.
[PDF] Conditional Probability, Independence and Bayes' Theorem
These notes from an MIT course on Probability and Statistics offer a rigorous yet clear walkthrough of conditional probability.
Read from the top of the document down to the end of the first page. Focus on two main parts: The initial coin-tossing example, which starts here. Notice how it first solves the problem intuitively with a reduced sample space, and then again using the formal definition. The explanation of the formal definition and the Venn diagram, found under the heading "Formal definition".
The Multiplication Rule
A simple rearrangement of the conditional probability formula gives us another crucial tool: the multiplication rule. If we multiply both sides of the definition by , we get:
This rule is our primary method for calculating the probability of the intersection of two events, especially in sequential processes. It essentially states that the probability of A and B happening is the probability of B happening, multiplied by the probability of A happening given that B already happened.
The MIT notes you just reviewed introduce this rule right after the definition of conditional probability. It's a direct and important consequence.
Independence: When Information Doesn't Matter
We began by seeing how information can change probability. But what if it doesn't?
Let's go back to the deck of cards.
- The unconditional probability of drawing a Jack is .
- Now, I give you some information: the card drawn is red. What is the new probability?
The reduced sample space is the 26 red cards. Among them, there are 2 Jacks (the Jack of Hearts and the Jack of Diamonds). - So, the conditional probability is .
The probability didn't change! . The information that the card was red was irrelevant to the probability of it being a Jack. When this happens, we say the two events are independent.
Formally, two events A and B are independent if the occurrence of one does not affect the probability of the other. This gives us two equivalent ways to define independence:
- Using Conditional Probability: A and B are independent if (and equivalently, ).
- Using the Multiplication Rule: If we substitute into the multiplication rule, we get a simple and powerful test for independence: This is the most common technical definition of independence.
Let's explore this concept with a couple of clear examples.
[PDF] Conditional Probability, Independence and Bayes' Theorem
We return to the MIT notes for a formal definition of independence.
Read Section 6: Independence (page 7). Pay attention to the distinction between the informal definition ("do not influence one another") and the formal mathematical definitions. Work through Examples 7, 8, and 9 to see how to test for independence in different scenarios.
Testing for Independence with Data
In data science, you often won't know the true theoretical probabilities. Instead, you'll have experimental data, typically organized in a table (what you might call a contingency table or a confusion matrix in other contexts). We can use this data to calculate experimental probabilities and test for independence.
The Khan Academy video below provides an excellent walkthrough of this exact process, which is a core skill in exploratory data analysis.
Conditional probability and independence | Probability | AP Statistics | Khan Academy
This video, "Conditional probability and independence," uses data from a table about train delays to test if the events "delayed" and "snowy" are independent.
Watch the full video from start to finish. As you watch, follow these steps in your mind: How is the overall probability of a delay, P(\text{Delayed}), calculated from the table totals? How is the sample space "reduced" to calculate the conditional probability P(\text{Delayed} | \text{Snowy})? Why does the large difference between these two probabilities lead to the conclusion that the events are not independent (i.e., they are dependent)?
Visualizing with Probability Trees
When dealing with a sequence of events, a probability tree is an invaluable tool for organizing your thoughts and calculations.
- The first level of branches represents the outcomes of the first event, with probabilities on the branches.
- The second level of branches represents the outcomes of the second event, but the probabilities here are conditional probabilities.
- To find the probability of a complete path (e.g., event A followed by event B), you multiply the probabilities along the branches. This is a direct application of the multiplication rule: .

This structure makes calculating the probabilities of complex sequences much more manageable.
Conclusion
In this lesson, we've explored the powerful concepts of conditional probability and independence. These ideas are the bedrock for more advanced topics like Bayes' theorem and are used constantly in machine learning models, from simple classifiers to complex probabilistic systems.
Key Takeaways:
- Conditional probability, , is the probability of event A occurring, given that event B has already occurred. It involves reasoning about a reduced sample space.
- The formal definition is .
- The Multiplication Rule, , is used to find the probability of the intersection of two events.
- Two events A and B are independent if knowing one has occurred does not change the probability of the other.
- The two key tests for independence are and the more general .
- Probability trees are an excellent way to visualize and calculate probabilities for sequential events.
In our next lesson, we will put all of our new probability tools—the addition rule, the multiplication rule, and conditional probability—to work by solving more complex applied problems that require combining these rules in a structured way.