Let be a countable measurable partition of the sample space, with positive probabilities. For any event , the law of total probability givesThe pieces are disjoint events, so add their masses and use the definition of conditional probability. Zero-mass partition pieces can be omitted without changing the answer.
For the coin selection in probability, let mean the -head coin was selected and let mean the first toss was heads. Then . Each conditional answer describes one possible hidden situation; its weight describes how often that situation occurs under the model. This decomposition is useful whenever a simple conditional model sits behind a more complicated marginal probability distribution.