Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Tree Diagram Visualization

Visualize conditional probabilities with events A and B. Click on intersection probabilities to highlight paths.

P(A) = 0.600P(Aᶜ) = 0.400P(B|A) = 0.700P(Bᶜ|A) = 0.300P(B|Aᶜ) = 0.300P(Bᶜ|Aᶜ) = 0.700AP = 0.6000AᶜP = 0.4000A ∩ BP = 0.4200A ∩ BᶜP = 0.1800Aᶜ ∩ BP = 0.1200Aᶜ ∩ BᶜP = 0.2800

Calculated Probabilities

Click on any joint probability to highlight its path through the tree

Joint Probabilities

A ∩ B = P(A) × P(B|A) = 0.4200
A ∩ Bᶜ = P(A) × P(Bᶜ|A) = 0.1800
Aᶜ ∩ B = P(Aᶜ) × P(B|Aᶜ) = 0.1200
Aᶜ ∩ Bᶜ = P(Aᶜ) × P(Bᶜ|Aᶜ) = 0.2800

Marginal Probabilities

P(A) = 0.6000
P(Aᶜ) = 0.4000
P(B) = P(A∩B) + P(Aᶜ∩B) = 0.5400
P(Bᶜ) = 0.4600

Conditional: Given A

P(B|A) = 0.7000
P(Bᶜ|A) = 0.3000

Conditional: Given Aᶜ

P(B|Aᶜ) = 0.3000
P(Bᶜ|Aᶜ) = 0.7000

Bayes Theorem

P(A|B) = P(B|A) × P(A) / P(B) = 0.7778
P(Aᶜ|B) = P(B|Aᶜ) × P(Aᶜ) / P(B) = 0.2222
How to use: Adjust the sliders to change probabilities. Click on any joint probability block to highlight its path through the tree.




Visualizing Conditional Probability with Tree Diagrams

Tree diagrams display probability relationships as branching paths. Each branch represents a possible outcome with its probability labeled along the path. This tool lets you adjust P(A), P(B|A), and P(B|Aᶜ) to see how joint probabilities, marginal probabilities, and Bayes' theorem calculations change in real time.



Getting Started with the Tree Diagram

This interactive tree diagram visualizes conditional probability as branching paths from left to right. The diagram starts at a single point and splits into branches representing possible outcomes, with probabilities labeled along each path.

The left side displays the tree structure with nodes and connecting branches. The right side shows calculated probabilities organized into panels: joint probabilities, marginal probabilities, and conditional probabilities. All values update instantly as you adjust the input parameters.

Three sliders below the tree control the fundamental probabilities that determine the entire structure. Every other probability in the diagram derives mathematically from these three inputs, demonstrating how a few conditional probability values generate a complete probability model.

Using the Probability Sliders

Three sliders control the tree diagram's probability structure:

• P(A) sets the probability of event A occurring at the first branch. Moving this slider changes how probability mass splits between the upper branch (A) and lower branch (Aᶜ). Values range from 0.01 to 0.99.

• P(B|A) sets the conditional probability of B given that A has occurred. This determines how the A branch splits into outcomes B and Bᶜ on the second level.

• P(B|Aᶜ) sets the conditional probability of B given that A has not occurred. This determines how the Aᶜ branch splits into outcomes B and Bᶜ.

As you adjust any slider, watch how the branch labels update, the node probabilities change, and all calculated values in the right panel recalculate. The complement probabilities P(Aᶜ), P(Bᶜ|A), and P(Bᶜ|Aᶜ) calculate automatically as 1 minus their counterparts.

Reading the Tree Structure

The tree displays events in chronological order. The first level splits into A (event occurs) and Aᶜ (event does not occur). The second level shows what happens next: each first-level outcome leads to either B or Bᶜ.

Four endpoints represent the four possible joint outcomes:

• A ∩ B (upper path): Event A occurred, then event B occurred
• A ∩ Bᶜ (second path): Event A occurred, then event B did not occur
• Aᶜ ∩ B (third path): Event A did not occur, then event B occurred
• Aᶜ ∩ Bᶜ (lower path): Neither event occurred

Each endpoint displays its joint probability, calculated by multiplying along the path. The probability labels on branches show exactly which values multiply together to produce each joint probability.

Clicking to Highlight Paths

Click any probability in the right panel to highlight its corresponding path through the tree. The highlighting system uses distinct colors for each probability type, making it easy to trace calculations visually.

When you click a joint probability like P(A ∩ B), the entire path from start to that endpoint highlights in the matching color. The branch labels and nodes along that path also change color, showing exactly which probabilities multiply together.

Clicking marginal probabilities highlights all paths that contribute. For example, clicking P(B) highlights both paths ending in B (through A and through Aᶜ), demonstrating that P(B) = P(A ∩ B) + P(Aᶜ ∩ B).

Click the same probability again or use the Clear Selection button to remove highlighting and return to the default view.

Understanding Joint Probabilities

The Joint Probabilities panel shows P(A ∩ B) for all four outcome combinations. Each joint probability equals the product of probabilities along its path—this is the multiplication rule for sequential events.

The formulas display explicitly:

P(AB)=P(A)×P(BA)P(A \cap B) = P(A) \times P(B|A)


P(ABc)=P(A)×P(BcA)P(A \cap B^c) = P(A) \times P(B^c|A)


P(AcB)=P(Ac)×P(BAc)P(A^c \cap B) = P(A^c) \times P(B|A^c)


P(AcBc)=P(Ac)×P(BcAc)P(A^c \cap B^c) = P(A^c) \times P(B^c|A^c)


The four joint probabilities always sum to exactly 1, representing the complete sample space. Click any joint probability to see its path highlighted in the tree, visually confirming the multiplication.

Marginal Probabilities from the Tree

The Marginal Probabilities panel shows P(A), P(Aᶜ), P(B), and P(Bᶜ). While P(A) and P(Aᶜ) come directly from the first branch, P(B) and P(Bᶜ) require summing across paths.

P(B) combines two paths reaching outcome B:

P(B)=P(AB)+P(AcB)P(B) = P(A \cap B) + P(A^c \cap B)


This is the law of total probability in action. The tree makes this sum visible—click P(B) to see both contributing paths highlight simultaneously.

Similarly, P(Bᶜ) sums the two paths reaching outcome Bᶜ. The marginal probabilities P(A) + P(Aᶜ) = 1 and P(B) + P(Bᶜ) = 1, as complements must.

Bayes' Theorem in the Tree

The Bayes Theorem panel shows P(A|B) and P(Aᶜ|B)—the reverse conditional probabilities. While the sliders set P(B|A) and P(B|Aᶜ), Bayes' theorem calculates the opposite direction.

The formula:

P(AB)=P(BA)×P(A)P(B)P(A|B) = \frac{P(B|A) \times P(A)}{P(B)}


The tree demonstrates why this works. P(A|B) asks: given we reached outcome B, what fraction came through the A branch? The numerator P(A ∩ B) is one path to B; the denominator P(B) is total probability of B from both paths.

Try this experiment: set P(B|A) = 0.9 and P(B|Aᶜ) = 0.1 with P(A) = 0.5. Then observe P(A|B). The high P(B|A) means most B outcomes came through A, so P(A|B) is high. Adjust the sliders to see how the reverse conditional changes.

Related Tools and Concepts

Tree diagrams connect to several probability concepts and tools on this site:

Theory Pages:

Conditional Probability explains P(A|B) theory in depth

Bayes' Theorem covers the formula for reversing conditionals

Total Probability describes summing across partitions

Joint Probability details probability of combined events

Other Visualizations:

Venn Diagrams show conditional probability through overlapping regions

Contingency Tables display all probabilities in tabular format

Calculators:

Bayes' Theorem Calculator computes reverse conditionals

Conditional Probability Calculator calculates P(A|B) from inputs