Partition trees and the law of total probability
Many probability questions involve an event \(B\) that can happen in different “scenarios.” A clean way to organize those scenarios
is to split the sample space into a partition \(\{A_1,A_2,\dots,A_n\}\). A partition means two things:
(1) the events are mutually exclusive (\(A_i\cap A_j=\varnothing\) for \(i\neq j\)), and (2) they are exhaustive
(\(\bigcup_i A_i=\Omega\)). In a finite partition, this implies the normalization rule
\[
\sum_{i=1}^{n} P(A_i)=P(\Omega).
\]
Most elementary problems take \(P(\Omega)=1\), but the same idea works if you are working inside a restricted universe where \(P(\Omega)\) is given.
From a partition to a probability tree
A tree diagram turns the partition into a picture. From the root \(\Omega\), draw a branch to each \(A_i\) and label it with \(P(A_i)\).
Then, from each \(A_i\), draw a branch to \(B\) labeled with the conditional probability \(P(B\mid A_i)\). Each route from \(\Omega\) to a leaf is a
path. The probability of a path is found by multiplying along the path:
\[
P(A_i\cap B)=P(A_i)\,P(B\mid A_i).
\]
This is the multiplication rule in action, and it is exactly what the tree visualization is designed to highlight.
Law of total probability (the key sum)
Because the events \(A_i\) are disjoint and cover the sample space, the pieces \(A_i\cap B\) are also disjoint and their union is \(B\).
That is why you can add the path probabilities to recover \(P(B)\):
\[
P(B)=\sum_{i=1}^{n} P(A_i\cap B)=\sum_{i=1}^{n} P(B\mid A_i)\,P(A_i).
\]
Each term \(P(B\mid A_i)P(A_i)\) is the “contribution” of scenario \(A_i\) to the overall chance of \(B\). If one scenario is common
(large \(P(A_i)\)) and \(B\) is likely inside it (large \(P(B\mid A_i)\)), that scenario will dominate the total.
Consistency checks and optional normalization
In practice, input numbers may be rounded or may not form a perfect partition. A simple diagnostic is to compare
\(\sum_i P(A_i)\) against \(P(\Omega)\) with a small tolerance. If the sum is close enough, you can treat it as consistent.
Some workflows also allow normalization, which rescales the \(P(A_i)\) values so that they sum exactly to \(P(\Omega)\).
This is useful if you entered unscaled weights, but keep in mind that normalization changes the model: it is an adjustment, not a proof that the original numbers were correct.
How to use this tool
Enter the partition probabilities \(P(A_i)\) (one per line) and the matching conditional probabilities \(P(B\mid A_i)\).
Click Calculate to see each path product \(P(A_i\cap B)\) and the final total \(P(B)\).
The interactive canvas draws the tree; you can pan and zoom for readability and press Play to animate probability flowing through branches and accumulating into the total.
As an advanced note, university probability extends the same idea to countably infinite partitions and to continuous cases using integrals and \(\sigma\)-additivity.