Probability

Conditional Probability: How to Find P(A Given B)

Find conditional probability with P(A given B) = P(A and B)/P(B). Read a two-way table, reverse the condition correctly, and check calculator input direction. This guide explains the reasoning, not just the keystrokes.

Published · Updated · 6 min read

Read the condition as a smaller reference group

Conditional probability asks how likely A is within the cases where B is already known to occur. Write it as P(A|B), read A given B, and calculate P(A|B) = P(A ∩ B) / P(B), provided P(B) > 0. The intersection A ∩ B means both events occur. Conditioning changes the denominator from all cases to the B cases; it does not merely attach a descriptive label to the original overall probability of A.

The order matters. P(A|B) and P(B|A) generally use different reference groups and need not match. In a count table drawn from one consistent collection, divide the number meeting both conditions by the number meeting the condition after the vertical bar. Write those two counts in words before dividing. This habit is often more reliable than trying to memorize a rearranged equation without identifying which group the question describes.

Build a complete original two-event count example

Imagine a hypothetical collection of 120 workshop registrations. Let A mean a participant selected a morning session and B mean the participant requested a workbook. There are 24 registrations meeting both conditions, 36 selecting morning only, 16 requesting a workbook only, and 44 meeting neither condition. These four disjoint counts sum to 120, so every registration belongs to exactly one cell. The numbers illustrate arithmetic rather than a claim about real workshop behavior.

Morning registrations total 24 + 36 = 60, and workbook requests total 24 + 16 = 40. Thus P(A) = 60/120 = 0.5, P(B) = 40/120 = 1/3, and P(A ∩ B) = 24/120 = 0.2. These marginals and overlap all refer to the same 120 registrations. Mixing one event's rate from a different collection would not produce a valid single joint table without further modelling assumptions.

Hypothetical workshop registrations: disjoint counts
CombinationCountMeaning
A and B24Morning and workbook
A only36Morning without workbook
B only16Workbook without morning
Neither44Neither selection

Total 120; A total 60 and B total 40. P(A|B) = 24/40, while P(B|A) = 24/60.

Find A given B using the workbook group

The question What fraction of workbook requesters selected morning? restricts the reference group to the 40 workbook requests. Among them, 24 selected morning, so P(A|B) = 24/40 = 0.6, or 60%. The probability-form equation gives the same answer: 0.2 / (1/3) = 0.6. Keep the unrounded one-third during this calculation; substituting an early 0.33 creates a small artificial difference.

Notice what did not change: the overlap still contains the same 24 registrations. What changed was its denominator. Dividing 24 by all 120 gives 20%, the joint probability, not the requested conditional probability. Dividing 60 by 120 gives 50%, the overall morning probability. A sentence naming the restricted group makes it easier to distinguish those three correct arithmetic results and select the one answering the actual question.

Reverse the condition without reversing a fraction blindly

Now ask What fraction of morning participants requested a workbook? The reference group is the 60 morning registrations. Therefore P(B|A) = 24/60 = 0.4, or 40%. This is different from 60% because the denominators differ, not because one answer is wrong. Reversing a condition does not mean taking the reciprocal of a conditional probability; 1/0.6 would exceed one and would not be a valid probability here.

If only P(A|B) is known, reversing the direction requires additional information about the marginal probabilities. For positive P(A), the relationship is P(B|A) = P(A|B)P(B)/P(A). In this example, 0.6 × (1/3) / 0.5 = 0.4. A conditionally stated percentage by itself does not reveal the size of the restricted group, so it cannot generally determine the probability in the opposite direction.

Enter the correct conditional direction in the calculator

The Probability Calculator's conditional input is P(B|A), not P(A|B). To reproduce this table, enter P(A) = 0.5, P(B) = 1/3 as an adequate decimal representation, and conditional value P(B|A) = 0.4 in decimal-probability mode. The calculator reconstructs overlap as P(A) × P(B|A) = 0.2 and reports P(A|B) near 0.6. Use the intersection mode with overlap 0.2 when that is the information you already know.

If you instead enter 0.6 in the P(B|A) field, you assert a different relationship. The calculator can evaluate that different valid model, but it will not reproduce the workshop table. Match decimal mode to values between zero and one; in percentage mode the corresponding values are 50%, approximately 33.333333%, and 40%. The input label defines the direction, so reading it is part of checking the result.

Check zero denominators and impossible joint claims

P(A|B) is undefined under this elementary ratio formula when P(B) = 0. Reporting zero would confuse no reference cases with a positive reference group containing no A cases. If P(B) is positive but the overlap is zero, then the conditional probability is genuinely zero. Those are distinct situations and should remain distinct in an explanation, a table and a calculator output.

The overlap must also fit the marginals: max(0, P(A) + P(B) − 1) ≤ P(A ∩ B) ≤ min(P(A), P(B)). A claimed overlap larger than either event is impossible. For the workshop probabilities, 0.2 is below both 0.5 and 1/3 and satisfies the lower bound. These checks detect inconsistent data before a conditional percentage is interpreted. A probability outside zero to one is not an unusual finding; it signals invalid inputs or arithmetic.

Avoid assuming independence or causation

Independence would imply P(A|B) = P(A) whenever the condition is defined. Here 0.6 differs from 0.5, so the hypothetical table does not describe independent events. Multiplying the marginals would give overlap 1/6, approximately 0.166667, rather than the observed-table value 0.2. Independence is a statement about the event relationship, not a convenient default to fill missing overlap information when only two overall percentages are available.

A conditional difference also does not establish causation. Workbook requesters selecting morning more often within this constructed table does not show that requesting a workbook causes a morning choice. Other factors, selection processes or the way events were defined may matter. For sampled real data, the ratios are descriptive empirical estimates with uncertainty, not automatically known population probabilities. This educational two-event calculation does not provide a medical prediction, causal analysis or a fitted statistical model.

Report the numerator, denominator and direction together

A clear result reads: among 40 workbook requesters, 24 selected morning, so P(morning | workbook) = 24/40 = 60%. That sentence names the restricted group and prevents the answer from being mistaken for 20% of all registrations or 40% of morning participants. Where useful, include the full four-cell table and both marginals so another reader can reproduce the calculation without guessing how the groups were defined.

Use the related independent-events guide to decide whether an independence shortcut is justified, and the sampling guide when changing draws alter the reference group. Keep a zero denominator visible as undefined and preserve enough precision until the final percentage is rounded. The central skill is choosing the correct denominator. Once the reference group is clear, the formula becomes an auditable count ratio rather than an unexplained percentage attached to two event names.

Frequently asked questions

What does the vertical bar in P(A|B) mean?

It means given B. Restrict the reference group to cases where B occurs before finding the share also meeting A.

Is P(A|B) the same as P(B|A)?

Not generally. They share an overlap numerator but usually use different denominators.

What if the probability of B is zero?

The elementary conditional ratio P(A ∩ B)/P(B) is undefined. Do not report that undefined ratio as zero.

Which conditional direction does the tool accept?

Its conditional input is P(B|A). Use the intersection input mode if you already know P(A ∩ B) instead.

Sources

References used to support definitions and interpretation in this guide.

  1. OpenStax — Two Basic Rules of Probability
  2. OpenStax — Independent and Mutually Exclusive Events