Marginal and Conditional Probabilities
When data are classified by two variables (for example, gender and opinion), the counts are often summarized in a
two-way table (also called a contingency table). Each numbered box in the table is a cell, representing the
frequency for a pair of characteristics.
Two-way table and totals
Probability properties used in this topic
- Range: every probability satisfies
0 ≤ P(event) ≤ 1.
- Sum-to-1 for a complete set: probabilities of all simple outcomes of the same experiment add to
1.
Marginal probability
A marginal probability (also called simple probability) is the probability of a single event without considering
any other event. In a two-way table, marginal probabilities come from the row totals or column totals divided by the
grand total.
\[
P(\text{row category}) = \frac{\text{row total}}{\text{grand total}},
\quad
P(\text{column category}) = \frac{\text{column total}}{\text{grand total}}
\]
For the example table:
\[
\begin{aligned}
P(\text{male}) &= \frac{60}{100} = 0.60 \\
P(\text{female}) &= \frac{40}{100} = 0.40 \\
P(\text{in favor}) &= \frac{19}{100} = 0.19 \\
P(\text{against}) &= \frac{81}{100} = 0.81
\end{aligned}
\]
Conditional probability
A conditional probability is the probability of an event occurring given that another event has already occurred.
If A and B are events, then the conditional probability of A given B is written
P(A | B) and read as “the probability of A given that B has occurred.”
\[
P(A \mid B) = \frac{\text{number in }(A \cap B)}{\text{number in }B}
\]
Examples from the same table:
\[
\begin{aligned}
P(\text{in favor} \mid \text{male})
&= \frac{\text{males who are in favor}}{\text{total males}}
= \frac{15}{60}
= 0.25 \\
P(\text{female} \mid \text{in favor})
&= \frac{\text{females who are in favor}}{\text{total in favor}}
= \frac{4}{19}
\approx 0.2105
\end{aligned}
\]
Tree diagram connection
A tree diagram visualizes how probabilities split in stages. The first level typically shows a set of marginal
probabilities, and the second level shows conditional probabilities “within” each first-level branch.
The probability at a leaf corresponds to the joint event represented by that path.
This calculator draws the tree in either order (Row→Column or Column→Row) and highlights the branch for the conditional probability you select.