Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Waffle Chart Visualization

This waffle chart demonstrates how conditional probability differs from total probability. While the total probability P(Event) considers all possible outcomes equally, conditional probability P(Event | Condition) restricts our view to specific regions. When you know which region you are in, the likelihood of the event changes dramatically.

Region A
0.15
P(
| Region A)
P(
|
)
Region B
0.40
P(
| Region B)
P(
|
)
Region C
0.65
P(
| Region C)
P(
|
)
Region D
0.85
P(
| Region D)
P(
|
)

Adjust Distribution

15/100
40/100
65/100
85/100
Understanding conditional probability: Each region has 100 tiles with equal probability P(Region) = 0.25. The
dark blue tiles represent the same event across all regions. P(
|
)
= (dark tiles in that region) / 100. The total probability P(
)
is calculated using the law of total probability: sum of P(Region) × P(
| Region) across all regions. Notice how conditional probabilities vary by region—knowing which region you are in changes the likelihood of the event.

Total: P(
)

Total probability:
0.512
205 of 400 tiles
Law of Total Probability:
P(
) · P(
|
)
+ P(
) · P(
|
)
+ P(
) · P(
|
)
+ P(
) · P(
|
)
= 0.25·0.15 + 0.25·0.40 + 0.25·0.65 + 0.25·0.85
= 0.512




Visualizing Conditional Probability with Waffle Charts

This waffle chart divides the sample space into four equal regions, each containing a 10×10 grid of tiles. Dark blue tiles represent an event occurring. Adjust the probability sliders to change how the event distributes across regions and observe how conditional probability P(Event|Region) differs from total probability P(Event).



Getting Started with the Waffle Chart

This interactive waffle chart visualizes conditional probability through proportional grid displays. The chart divides the sample space into four equal regions (A, B, C, D), each containing a 10×10 grid of 100 tiles.

Dark blue tiles represent an event occurring within each region. The distribution of dark tiles varies by region, controlled by individual sliders. This creates a scenario where the same event has different conditional probabilities depending on which region you're in.

The layout shows all four grids in a row at the top, with controls and statistics below. Each region header displays its conditional probability P(Event | Region), making it easy to compare across regions. The right panel shows total probability calculated using the law of total probability.

Understanding the Grid Structure

Each region contains exactly 100 tiles arranged in a 10×10 grid. Tiles are either the region's background color (event did not occur) or dark blue (event occurred). The number of dark blue tiles directly represents the percentage probability within that region.

The four regions have equal probability:

• P(Region A) = P(Region B) = P(Region C) = P(Region D) = 0.25

Since there are 400 total tiles (100 per region × 4 regions), each individual tile represents 0.25% of the total sample space. The four grids together represent the complete sample space.

Hover over any tile to see it enlarge slightly. This interaction helps you count tiles visually and understand that each square represents an equally likely outcome within its region.

The Four Grids at Their Opening Rates

Each region is a 10×1010 \times 10 grid, so one tile is one percentage point. The four regions open at 0.150.15, 0.400.40, 0.650.65 and 0.850.85, which the tool renders as 1515, 4040, 6565 and 8585 dark tiles.

The four regions are equally likely, 14\frac{1}{4} each, so P(dark)=15+40+65+85400=205400=0.5125P(\text{dark}) = \frac{15 + 40 + 65 + 85}{400} = \frac{205}{400} = 0.5125.
Region A — P = 0.15Region B — P = 0.40Region C — P = 0.65Region D — P = 0.85
Four 10x10 grids at 0.15, 0.40, 0.65 and 0.85

One tile is one percentage point, so the grids hold 15, 40, 65 and 85 dark tiles. With four equally likely regions, P(dark) = 205/400 = 0.5125. The live tool scatters the dark tiles at random; only the count is fixed, so this still fills them in reading order.

That single fraction is the law of total probability again, in its most countable form. Written the usual way it is iP(darkregioni)P(regioni)=0.15+0.40+0.65+0.854\sum_i P(\text{dark} \mid \text{region}_i) P(\text{region}_i) = \frac{0.15 + 0.40 + 0.65 + 0.85}{4}, and it gives 0.51250.5125 either way — because with equal region weights, a weighted average is just an average.

One honest caveat about the picture. The live tool decides *which* tiles are dark with a random shuffle, so the arrangement is different every time it loads and cannot be frozen. The count is fully determined, and the count is what the probability depends on, so the still below fills tiles in reading order instead. Scattered or blocked, 1515 dark tiles is 1515 dark tiles.

Setting Every Region Equal

Drag all four sliders to the same value — 0.50.5, say — and each grid shows 5050 dark tiles.

P(dark)P(\text{dark}) becomes 200400=0.5\frac{200}{400} = 0.5, the same as every conditional.
Region A — P = 0.50Region B — P = 0.50Region C — P = 0.50Region D — P = 0.50
Every region set to 0.5

Fifty dark tiles in each grid, so P(dark) = 0.5 and every conditional equals it. When the region tells you nothing about the outcome, the two are independent.

This is the degenerate case, and it is worth reaching deliberately. When all the conditionals are equal, the weighted average collapses to that common value and the region tells you nothing: P(darkregioni)=P(dark)P(\text{dark} \mid \text{region}_i) = P(\text{dark}) for every ii. Knowing the region is useless information, which is exactly the definition of independence.

Move any one slider away and the equality breaks immediately. That fragility is the point — independence is a knife edge, not a typical situation, and the four-slider layout makes it easy to see how rarely it holds by accident.

Using the Distribution Sliders

Four sliders in the Adjust Distribution panel control how dark blue tiles distribute within each region:

• Region A slider sets P(Event | Region A)
• Region B slider sets P(Event | Region B)
• Region C slider sets P(Event | Region C)
• Region D slider sets P(Event | Region D)

Moving a slider changes the proportion of dark blue tiles in that region. Tiles redistribute randomly within the region to match the new probability. The count display shows the exact number of dark tiles out of 100.

Try setting different distributions:

• All sliders to 0.50 creates uniform 50% across all regions
• Sliders to 0.80, 0.60, 0.40, 0.20 creates a gradient pattern
• One slider high (0.90) with others low (0.10) concentrates the event in one region

Each configuration produces different insights about conditional versus total probability.

Reading Conditional Probabilities

Each region header displays two equivalent notations for conditional probability:

• P(Dark Blue | Region Name) — verbal form
• P(■ | □) — symbolic form using colored squares

The numerical value shows the exact conditional probability, calculated as:

P(EventRegion)=Dark tiles in region100P(\text{Event} | \text{Region}) = \frac{\text{Dark tiles in region}}{100}


Since each region has 100 tiles, the count of dark tiles directly equals the percentage probability. If Region A has 45 dark tiles, P(Event | Region A) = 0.45.

Compare the conditional probabilities across regions. They typically differ because you've set different distributions with the sliders. This demonstrates that knowing which region you're in changes your probability assessment—the essence of conditional probability.

Total Probability Calculation

The right panel displays total probability P(Event) calculated across all regions. This uses the law of total probability:

P(Event)=iP(Regioni)×P(EventRegioni)P(\text{Event}) = \sum_{i} P(\text{Region}_i) \times P(\text{Event} | \text{Region}_i)


Since each region has equal probability 0.25:

P(Event)=0.25×P(EA)+0.25×P(EB)+0.25×P(EC)+0.25×P(ED)P(\text{Event}) = 0.25 \times P(E|A) + 0.25 \times P(E|B) + 0.25 \times P(E|C) + 0.25 \times P(E|D)


The panel shows each term in the sum, then the final result. The total probability equals the average of the four conditional probabilities (since region probabilities are equal).

The display also shows the raw count: total dark tiles across all regions out of 400. For example, "156 of 400 tiles" corresponds to P(Event) = 0.390.

Conditional vs Total Probability

The key insight from this visualization is how conditional probability differs from total probability. Consider this scenario:

Set Region A to 0.80 and Regions B, C, D to 0.20. The total probability is:

P(Event) = 0.25(0.80) + 0.25(0.20) + 0.25(0.20) + 0.25(0.20) = 0.35

Now imagine you know you're in Region A. Your probability jumps to 0.80—more than double the total probability. If you're in any other region, your probability drops to 0.20—lower than the total.

This demonstrates why conditional information matters. The total probability 0.35 is correct if you don't know which region you're in. But once you know the region (the condition), your probability estimate changes dramatically.

Same Total, Different Distributions

Multiple distributions can produce the same total probability. Compare these two scenarios that both give P(Event) = 0.50:

Uniform distribution:
All regions set to 0.50. Every region has the same conditional probability. Knowing your region provides no information—this is independence.

Concentrated distribution:
Regions A and B set to 0.80, Regions C and D set to 0.20. Total still equals 0.50, but conditional probabilities vary widely.

Both scenarios have the same overall event frequency, but they represent fundamentally different situations. In the concentrated case, the event clusters in certain regions. Knowing which region you're in becomes highly informative.

This illustrates why total probability alone doesn't tell the whole story. The distribution of an event across conditions matters for decision-making and prediction.