Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Venn Diagram Visualization

The sample space Ω is partitioned into compartments. Event A (indigo ellipse) overlaps these compartments differently. Click on any compartment to see P(A | Bᵢ) - the probability of A given that specific compartment.

ΩB₁B₂B₃AArea(A) = 68Area(Ω) = 100Area(A∩B₁) = 18Area(A∩B₂) = 32Area(A∩B₃) = 18
Click on any compartment to see the conditional probability

How This Visualization Works

Interactive Elements: The diagram shows a sample space Ω divided into compartments (B₁, B₂, B₃, etc.). Event A is represented by an indigo ellipse that overlaps multiple compartments. When you click on a compartment, the visualization highlights only the portion of A that intersects with that compartment, showing you the region A ∩ Bᵢ.

Conditional Probability Definition: The conditional probability P(A | Bᵢ) asks: Given that we know event Bᵢ has occurred, what is the probability that A also occurs? This is calculated as P(A | Bᵢ) = P(A ∩ Bᵢ) / P(Bᵢ). When we condition on Bᵢ, we restrict our view to only that compartment, treating it as our new sample space.

Why Probabilities Differ: Notice how P(A | B₁) ≠ P(A | B₂) ≠ P(A | B₃). This happens because event A overlaps each compartment to different degrees. Compartments where A has more overlap will have higher conditional probabilities. This demonstrates that knowing which compartment we are in (the condition) significantly affects the probability of event A.

Law of Total Probability: The total probability P(A) can be computed by summing the contributions from each compartment: P(A) = P(B₁)·P(A|B₁) + P(B₂)·P(A|B₂) + P(B₃)·P(A|B₃) + ... This formula shows that the overall probability of A is a weighted average of its conditional probabilities across all possible conditions (compartments), where each weight is the probability of that compartment.

Total Probability

P(A)
0.68
How Area(A) is calculated:
Area(A∩B₁) = 18
Area(A∩B₂) = 32
Area(A∩B₃) = 18
Area(A) = 18 + 32 + 18
= 68
P(A) from total area:
Area(A) = 68
Area(Ω) = 100
P(A) = 68 / 100
= 0.68
Verification (Law of Total Probability):
P(B₁)·P(A|B₁) = 0.33·0.54 = 0.18
P(B₂)·P(A|B₂) = 0.33·0.96 = 0.32
P(B₃)·P(A|B₃) = 0.33·0.54 = 0.18
Sum = 0.18 + 0.32 + 0.18
= 0.68

Settings

Conditional Probabilities

P(A | B₁)0.54
Step 1: Areas
Area(A ∩ B₁) = 18
Area(B₁) = 33.33
Area(Ω) = 100
Step 2: Convert to probabilities
P(A ∩ B₁) = 18/100 = 0.18
P(B₁) = 33.33/100 = 0.33
Step 3: Calculate conditional
P(A|B₁) = P(A∩B₁)/P(B₁)
= 0.18 / 0.33 = 0.54
P(A | B₂)0.96
Step 1: Areas
Area(A ∩ B₂) = 32
Area(B₂) = 33.33
Area(Ω) = 100
Step 2: Convert to probabilities
P(A ∩ B₂) = 32/100 = 0.32
P(B₂) = 33.33/100 = 0.33
Step 3: Calculate conditional
P(A|B₂) = P(A∩B₂)/P(B₂)
= 0.32 / 0.33 = 0.96
P(A | B₃)0.54
Step 1: Areas
Area(A ∩ B₃) = 18
Area(B₃) = 33.33
Area(Ω) = 100
Step 2: Convert to probabilities
P(A ∩ B₃) = 18/100 = 0.18
P(B₃) = 33.33/100 = 0.33
Step 3: Calculate conditional
P(A|B₃) = P(A∩B₃)/P(B₃)
= 0.18 / 0.33 = 0.54

Law of Total Probability

P(A) =
P(B₁)·P(A|B₁)
+
P(B₂)·P(A|B₂)
+
P(B₃)·P(A|B₃)




Visualizing Conditional Probability with Venn Diagrams

This Venn diagram displays event A as an ellipse overlapping a partitioned sample space. The sample space divides into compartments B₁, B₂, B₃ (and optionally B₄). Click any compartment to see how P(A|Bᵢ) is calculated from the intersection area divided by the compartment area.



Getting Started with the Venn Diagram

This interactive Venn diagram visualizes conditional probability through geometric regions. The rectangular sample space Ω is divided into vertical compartments (B₁, B₂, B₃, etc.), while event A appears as an indigo ellipse that overlaps these compartments to different degrees.

The left side displays the diagram with labeled areas. The middle column shows the total probability P(A) with calculation breakdowns. The right column displays conditional probabilities P(A|Bᵢ) for each compartment with step-by-step formulas.

Click any compartment to highlight the intersection A ∩ Bᵢ and see exactly how conditional probability is calculated from areas. The visualization demonstrates that knowing which compartment you're in changes the probability of event A.

Understanding the Sample Space Partition

The sample space Ω (the entire rectangle) is partitioned into equal-width vertical compartments. Each compartment represents a mutually exclusive event—you can only be in one compartment at a time, and together they cover all possibilities.

With 3 compartments:

• B₁ (blue region) covers the left third
• B₂ (yellow region) covers the middle third
• B₃ (red region) covers the right third

Since compartments have equal area, each has probability P(Bᵢ) = 1/n where n is the number of compartments. With 3 compartments, P(B₁) = P(B₂) = P(B₃) = 0.33.

Use the Settings slider to switch between 2, 3, or 4 compartments. Watch how the ellipse A maintains its shape while the partition changes, creating different intersection patterns and conditional probabilities.

Reading Event A and Intersections

Event A appears as an indigo ellipse positioned to overlap multiple compartments. The ellipse has a fixed shape but intersects each compartment differently based on their positions.

Labels inside the diagram show:

• Area(A) = 68 — the total area of the ellipse (normalized for clean calculations)
• Area(Ω) = 100 — the total sample space area
• Area(A ∩ Bᵢ) — the intersection area for each compartment

The intersection areas vary because the ellipse overlaps each compartment differently. A compartment near the ellipse center has larger intersection than one at the edge. These area differences create the variation in conditional probabilities.

Probability equals area ratio: P(A) = Area(A) / Area(Ω) = 68/100 = 0.68. Similarly, joint probability P(A ∩ Bᵢ) = Area(A ∩ Bᵢ) / Area(Ω).

The Three-Compartment Partition

The tool opens with the sample space cut into three equal vertical compartments B1B_1, B2B_2, B3B_3, each of probability 13\frac{1}{3}, and the event AA drawn as an ellipse lying across all three.

The tool normalises areas so that the sample space is 100100 and AA is exactly 6868, giving P(A)=0.68P(A) = 0.68.
ΩB₁B₂B₃A
Three equal compartments with event A across them

Areas normalised so the sample space is 100 and A is 68. The three pieces are 18, 32 and 18 - the middle is largest because the ellipse is widest there, not because B2 is bigger.

The three pieces of AA come out as 1818, 3232 and 1818 out of 100100, so P(AB1)=0.18P(A \cap B_1) = 0.18, P(AB2)=0.32P(A \cap B_2) = 0.32 and P(AB3)=0.18P(A \cap B_3) = 0.18. They add back to 0.680.68.

This is a partition in the technical sense: the compartments are disjoint and together they cover everything. That is exactly the condition the law of total probability needs, and the picture is what the law looks like before it is written down — AA chopped into as many pieces as there are compartments.

The middle piece is largest because the ellipse is widest at its centre, not because B2B_2 is bigger. All three compartments have the same area.

Selecting a Compartment: Conditioning as Restriction

Clicking B2B_2 fades the whole ellipse and redraws only the part inside that compartment at full strength. That solid region is AB2A \cap B_2.

P(AB2)=P(AB2)P(B2)=0.321/3=0.96P(A \mid B_2) = \frac{P(A \cap B_2)}{P(B_2)} = \frac{0.32}{1/3} = 0.96.
ΩB₁B₂B₃A
Compartment B2 selected

The ellipse fades and only the part inside B2 stays solid. P(A|B2) = 0.32 / (1/3) = 0.96 - conditioning redraws the frame, so A now fills 96% of a smaller world.

Conditioning is a change of denominator, and the picture shows it as a change of *frame*. Before selecting, the whole rectangle was the world and AA filled 68%68\% of it. After selecting, only B2B_2 is the world and AA fills 96%96\% of that.

The three conditionals are 0.540.54, 0.960.96 and 0.540.54, and they do not sum to anything meaningful — they are three separate answers to three separate questions. What does add up is the weighted combination: 13(0.54)+13(0.96)+13(0.54)=0.68=P(A)\frac{1}{3}(0.54) + \frac{1}{3}(0.96) + \frac{1}{3}(0.54) = 0.68 = P(A).

Note that P(AB2)=0.96P(A \mid B_2) = 0.96 is far above the unconditional 0.680.68. Learning that you are in the middle compartment makes AA much more likely; learning you are in an outer one makes it less likely. That is what it means for the partition to carry information about AA.

Four Compartments: More Pieces, Same Total

Dragging the compartment count to four re-cuts the same ellipse into four pieces of 1111, 2323, 2323 and 1111.

P(A)P(A) is still 0.680.68. The partition changed; the event did not.
ΩB₁B₂B₃B₄A
The same event A over four compartments

Pieces of 11, 23, 23 and 11 - still 68 in total, so P(A) is unchanged at 0.68. The conditionals spread wider, 0.44 / 0.92 / 0.92 / 0.44, but average back to 0.68.

The conditionals do change, and they spread further apart: 0.440.44, 0.920.92, 0.920.92, 0.440.44 against the three-way case's 0.540.54, 0.960.96, 0.540.54. Finer compartments distinguish more sharply between "near the middle of the ellipse" and "near its edge", so the extreme conditionals move further from 0.680.68.

Their weighted average is unchanged, though: 14(0.44+0.92+0.92+0.44)=0.68\frac{1}{4}(0.44 + 0.92 + 0.92 + 0.44) = 0.68. Any partition of the sample space reconstructs P(A)P(A) exactly, however many pieces it has and however unequal the conditionals are.

The two-compartment case is worth trying for the opposite reason. It gives P(AB1)=P(AB2)=0.68P(A \mid B_1) = P(A \mid B_2) = 0.68 — both halves cut the symmetric ellipse identically, so knowing which half you are in tells you nothing at all about AA. That is independence, arrived at by geometry.

Clicking Compartments to Explore

Click any compartment to see conditional probability in action. When you click B₂ (for example):

• The compartment highlights with its color
• The intersection A ∩ B₂ shows as a darker region within the ellipse
• The rest of event A fades to show only the relevant portion
• The conditional probability panel for B₂ expands with full calculation

This visualization demonstrates what "given B₂" means geometrically. When we condition on B₂, we restrict our view to only that compartment. The conditional probability P(A|B₂) asks: what fraction of B₂'s area is covered by A?

Click the same compartment again or click elsewhere to deselect and return to the full view showing all intersections simultaneously.

Understanding Conditional Probability Calculations

Each compartment's panel shows the three-step calculation for conditional probability:

Step 1: Areas
• Area(A ∩ Bᵢ) — intersection area from the diagram
• Area(Bᵢ) — compartment area (equal for all compartments)
• Area(Ω) — total sample space area (100)

Step 2: Convert to Probabilities
• P(A ∩ Bᵢ) = Area(A ∩ Bᵢ) / Area(Ω)
• P(Bᵢ) = Area(Bᵢ) / Area(Ω)

Step 3: Calculate Conditional

P(ABi)=P(ABi)P(Bi)P(A|B_i) = \frac{P(A \cap B_i)}{P(B_i)}


Notice how the conditional probabilities differ across compartments even though P(Bᵢ) is the same for all. The variation comes entirely from different intersection areas—compartments with more overlap have higher P(A|Bᵢ).

Total Probability from Intersections

The Total Probability panel shows how P(A) can be calculated by summing contributions from each compartment. This demonstrates the law of total probability:

P(A)=iP(Bi)×P(ABi)P(A) = \sum_{i} P(B_i) \times P(A|B_i)


The panel displays this calculation two ways:

From areas directly:
Area(A) = Area(A ∩ B₁) + Area(A ∩ B₂) + Area(A ∩ B₃)

From probabilities:
P(A) = P(B₁)·P(A|B₁) + P(B₂)·P(A|B₂) + P(B₃)·P(A|B₃)

Both methods yield P(A) = 0.68. The verification section confirms the law of total probability by showing each term and their sum. This demonstrates that total probability is a weighted average of conditional probabilities, weighted by the probability of each condition.

Why Conditional Probabilities Differ

The key insight from this visualization is that P(A|B₁) ≠ P(A|B₂) ≠ P(A|B₃), even though the compartments have equal probability. The difference arises because event A overlaps each compartment to different degrees.

Consider a medical example: A represents having a disease, and B₁, B₂, B₃ represent age groups. If the disease affects middle-aged people most, the "ellipse" of disease overlaps the middle compartment more than the edges. Knowing someone's age group (which compartment) changes the probability estimate.

This is the essence of conditional probability—additional information (which compartment) updates our probability assessment. Independence would mean P(A|Bᵢ) = P(A) for all compartments, which happens only if A overlaps all compartments equally.