Mermaid · No signup · Nothing uploaded

Probability tree diagram generator

Map a random experiment stage by stage: write the probability on each branch and the outcome with its joint probability on each leaf. Edit a template, check the numbers, export — nothing leaves your browser.

load example
Preview

Build it stage by stage

A probability tree reads left to right: the root is the experiment, each column of branches is one stage, and each leaf is a final outcome. Write the probability of a branch on the branch itself with a label like -->|0.5|, and put the joint probability on the leaf — the product of every branch probability along the path from the root.

Second-stage probabilities are conditional: they assume the first stage already happened. That is why the without-replacement example changes its denominators from 5 to 4 on the second draw — one ball is already gone.

Two rules keep the tree honest

First: the branches leaving any node must sum to 1 — if they do not, an outcome is missing or double-counted. Second: multiply along a path for the probability of that exact sequence (an AND), and add across paths when several sequences produce the same event (an OR). In the bag example, P(one of each colour) = P(red then blue) + P(blue then red) = 6/20 + 6/20 = 12/20.

Those two checks catch nearly every classroom mistake, and having the tree in front of you makes both of them mechanical.

The medical-test tree, or why base rates bite

The Bayes example above is the classic surprise: a condition affecting 1% of people, a test that catches 99% of true cases but false-alarms on 5% of healthy people. The tree shows P(positive) = 0.0099 + 0.0495 = 0.0594 — and only 0.0099 of that comes from real cases. So P(condition given positive) = 0.0099 / 0.0594 ≈ 17%: a one-in-six chance, despite the “99% accurate” test.

Reading joint probabilities straight off the leaves and summing the relevant ones is exactly what a probability tree is for — it makes base rates impossible to ignore.

Frequently asked questions

How do I draw a probability tree diagram?

Start with "graph LR", add a root node for the experiment, then one arrow per outcome with the probability in the label, like S -->|0.5| H["Heads"]. Put the joint probability in each leaf label. The tree renders live and exports as SVG or PNG.

Do I multiply or add the probabilities?

Multiply along a path — this happens AND then that. Add across different paths that produce the same event — this way OR that way. A leaf value is always the product of the branch probabilities leading to it.

Do the branches have to add up to 1?

Yes. At every node, the probabilities on the branches leaving it must total exactly 1, because those branches cover all possible outcomes of that stage. It is the quickest self-check before handing work in.

Can I use fractions instead of decimals?

Yes — branch labels are plain text, so 3/5 works as well as 0.6. Fractions stay exact for without-replacement problems; decimals read better for measured rates. Pick one style per tree.

What changes when drawing without replacement?

The second-stage probabilities become conditional: denominators shrink because the first item is not put back. In the bag example, after a red is drawn the second draw becomes 2/4 red and 2/4 blue.

Is it free, and is my work uploaded?

Free with no signup or watermark, and the tree renders in your browser — homework and worked examples never leave your device.