Conditional probability measures an event within a restricted sample space. A two-way table makes that restriction concrete: choose the row or column named by the condition, then find the fraction of that subgroup satisfying the requested event.
Joint, marginal, and conditional probabilities
Consider 200 applicants classified by preparation-course attendance and exam result:
| Pass | Do not pass | Total | |
|---|---|---|---|
| Course | 72 | 18 | 90 |
| No course | 66 | 44 | 110 |
| Total | 138 | 62 | 200 |
A joint probability uses a cell and the grand total. For example, A marginal probability uses a row or column total:
A conditional probability uses the relevant subgroup total. Among course attendees, the pass probability is These three probabilities answer different questions, even though they come from the same table.
The formula expresses a sample-space restriction
For
Dividing both numerator and denominator of the count ratio by the grand total gives this formula. The condition B must have positive probability; otherwise the usual ratio is undefined.
In the table, The grand-total factors cancel, leaving the within-row proportion.
Example: reverse the condition carefully
Among those who passed, the proportion who attended the course is approximately 52.2%. This is not the same as the 80% pass rate among course attendees.
Both numerators count the same people, but the denominators represent different eligible groups. A high probability of a result given a condition does not automatically imply a high probability of the condition given that result.
This reversal is central to interpreting screening tests, surveys, and selection data. Always translate the probability into a complete sentence before calculating.
Example: combine conditional rates with base rates
Suppose 10% of manufactured items come from machine A and 90% from B. Their defect rates are 4% and 1%, respectively. The overall defect probability is
The probability an item came from A given that it is defective is about 30.8%. Machine A has the higher defect rate, but most production comes from B. Base rates are essential when reversing the condition.
A count model gives the same result: among 10,000 items, expect 40 defective A items and 90 defective B items. Of 130 defective items, 40 came from A. These are model-based expected counts, not guaranteed realized counts.
Among 130 expected defective items in a 10,000-item model, 40 come from A and 90 from B. Conditioning on defect gives A a share of 40/130.
Among 130 expected defective items in a 10,000-item model, 40 come from A and 90 from B. Conditioning on defect gives A a share of .
Describe this figure
Among 130 expected defective items in a 10,000-item model, 40 come from A and 90 from B. Conditioning on defect gives A a share of .
A defective: 40; B defective: 90.
Independence means the condition changes nothing
Events A and B are independent when assuming Equivalently,
In the applicant table, the conditional pass rate for course attendees is 0.80, different from the overall 0.69. Thus attendance and passing are associated in these data. That does not establish causation: attendees may differ in motivation, prior preparation, or other factors.
Compare subgroup percentages when group sizes differ. A larger count of successes may come from a larger group rather than a higher success rate.
Try it yourself
Using the table, find and
Answer: The first is because the eligible group is the 62 who did not pass. The second is because the eligible group is the 110 nonattendees. Their difference illustrates why condition order matters.
What to remember
Joint probabilities use the whole sample; conditional probabilities use the conditioned subgroup. Preserve base rates when reversing a condition, and distinguish observed association from a causal claim.