Conditional probability: the formula, information protocols, and worked examples

Original publication: Updated:

The formula changes the reference set

For events A,BA,B with P(A)>0P(A)>0,

P(B∣A)=P(A∩B)P(A).\boxed{P(B\mid A)=\frac{P(A\cap B)}{P(A)}.}

The denominator restricts attention to outcomes where AA occurs. The numerator counts those restricted outcomes where BB also occurs. The notation PA(B)P_A(B) used in some Japanese textbooks means the same thing.

For example, among ten tickets with one winning ticket, a second person's unconditional winning probability is 1/101/10 when tickets are drawn uniformly without replacement. Given that the first person already took the winner, the second person's conditional winning probability is zero.

The difficult step is often recognizing which event is given, rather than remembering how to divide.

Independence and conditioning

If P(A)>0P(A)>0, the equality P(B∣A)=P(B)P(B\mid A)=P(B) says that learning AA does not change the probability of BB. Equivalently,

P(A∩B)=P(A)P(B).P(A\cap B)=P(A)P(B).

The latter equation defines independence even when one event has probability zero, whereas the conditional quotient is undefined for a zero-probability conditioning event.

Chronological order does not establish independence. Information about later draws can alter what we infer about an earlier draw, without changing what actually happened.

Example 1: the two-child question needs a precise information rule

Use a toy model in which each child is independently a boy or a girl with probability 1/21/2. Label the older and younger child. The four equally likely outcomes are:

  • Boy, boy.
  • Boy, girl.
  • Girl, boy.
  • Girl, girl.

Question. Given the event that at least one child is a boy, what is the probability that both are boys?

The condition excludes only the girl-girl outcome. Three equally likely outcomes remain, and one is boy-boy. Thus

P(both boys∣at least one boy)=1/43/4=13.\boxed{P(\text{both boys}\mid\text{at least one boy})=\frac{1/4}{3/4}=\frac13.}

Why another version can have answer one-half

If we are instead told that the older child is a boy, only boy-boy and boy-girl remain, giving probability 1/21/2 for the younger child to be a boy. Randomly encountering one selected child and observing a boy is also a different information protocol from conditioning families on the event “at least one boy.”

The original problem's intended answer 1/31/3 assumes the at-least-one event. A sentence merely saying “you learn that one child is a boy” can be ambiguous unless the way information was obtained is specified. Conditioning requires a defined random experiment, not just an intuition about the words.

Example 2: information from later departures

Problem. A group contains 50 men and 50 women. People are selected uniformly one at a time without replacement and leave. The first person's category is not observed, but the second, third, and fourth people selected are all men. What is the probability that the first was a man?

Let AA mean that departures two through four are men, and BB that departure one is a man. The numerator is

P(A∩B)=50100499948984797=12⋅4799⋅97.P(A\cap B)=\frac{50}{100}\frac{49}{99}\frac{48}{98}\frac{47}{97}=\frac{12\cdot47}{99\cdot97}.

To calculate P(A)P(A), split on the first departure:

P(A)=50100499948984797+50100509949984897=1299.\begin{aligned} P(A)={}&\frac{50}{100}\frac{49}{99}\frac{48}{98}\frac{47}{97}\\ &+\frac{50}{100}\frac{50}{99}\frac{49}{98}\frac{48}{97}\\ ={}&\frac{12}{99}. \end{aligned}

Therefore

P(B∣A)=4797.\boxed{P(B\mid A)=\frac{47}{97}.}

The first term used in the denominator is already the numerator, so there is no need to calculate it twice.

A shorter exchangeability explanation

Conditioning on three specified later positions being men leaves 47 men and 50 women available for the other 97 positions. The first position is uniformly filled from those remaining people, giving 47/9747/97 directly. The later information changes our inference; it does not retroactively cause the first selection.

Exam example 1: assess four probability statements

The source uses the following statements from the 2020 Center Test Mathematics I/A. For the coin statements, use the fair-coin assumption adopted in the source explanation.

  1. A fair coin is tossed five times. If pp is the probability of at least one head, then p>0.95p>0.95.
  2. A bag contains eight red or white balls. In five draws with replacement, red appears three times. Therefore the actual probability of red on a draw is 3/53/5.
  3. Five cards bear labels A,B,B,C,CA,B,B,C,C. Drawing two simultaneously, the probability of different labels is 4/54/5.
  4. Two robots independently report a coin's face, each correctly with probability 0.90.9 and incorrectly with probability 0.10.1. If both report heads, the probability that the face really is heads is at most 0.90.9.

Statement 1 is true: p=1−(1/2)5=31/32>0.95p=1-(1/2)^5=31/32>0.95.

Statement 2 is false. An observed frequency is not a determination of the unknown underlying probability. In particular, a uniform draw from eight balls has red probability r/8r/8 for an integer rr, not automatically 3/53/5.

Statement 3 is true. Of (52)=10\binom52=10 pairs, only the pair of two BB cards and the pair of two CC cards have matching labels. Thus the probability is (10−2)/10=4/5(10-2)/10=4/5.

Statement 4 is false for a fair coin:

P(H∣both report H)=(1/2)(0.9)2(1/2)(0.9)2+(1/2)(0.1)2=8182>0.9.P(H\mid\text{both report }H)=\frac{(1/2)(0.9)^2}{(1/2)(0.9)^2+(1/2)(0.1)^2}=\frac{81}{82}>0.9.

The two correct statements are therefore 1 and 3 in this English numbering. If the prior heads probability is qq rather than 1/21/2, the posterior is 0.81q/(0.81q+0.01(1−q))0.81q/(0.81q+0.01(1-q)). Without a prior or symmetry assumption, the robot error rates alone do not determine a numerical posterior.

Exam example 2: infer a bag color after observing a ball

In the 2019 Center Test experiment, a red bag contains two red balls and one white ball, while a white bag contains one of each. Balls are replaced. The first bag is chosen by a fair die: white for a multiple of three, red otherwise. Each later bag matches the previous drawn ball's color.

Given a white ball on operation two, the probability that the selected bag was white is

P(W1∩W2)P(W2)=(7/18)(1/2)43/108=2143.\frac{P(W_1\cap W_2)}{P(W_2)}=\frac{(7/18)(1/2)}{43/108}=\boxed{\frac{21}{43}.}

Given a white ball on operation three, the probability that no earlier white ball appeared is

P(R1∩R2∩W3)P(W3)=(11/18)(2/3)(1/3)259/648=88259.\frac{P(R_1\cap R_2\cap W_3)}{P(W_3)}=\frac{(11/18)(2/3)(1/3)}{259/648}=\boxed{\frac{88}{259}.}

The complete bag-problem explanation derives every probability used here.

Exam example 3: a three-team tournament

This problem is from the University of Tokyo's 2016 science-track paper.

Teams A,B,CA,B,C play until one wins two consecutive games. First AA plays BB. The winner next plays CC. Thereafter, if no champion has been decided, the previous winner plays the team that just waited. Each game is independent, each competing team wins with probability 1/21/2, and there are no draws.

  1. For n≥2n\ge2, find the probability that AA becomes champion exactly on game nn.
  2. Given that AA becomes champion within 3m3m games, where mm is a positive integer, find the probability that its last opponent was BB.

Part 1: the winner sequence before the last game

Before the final game, the winner must change every time; otherwise two consecutive wins would already have ended the tournament.

If AA wins game one, the changing-winner sequence is A,C,B,A,C,B,…A,C,B,A,C,B,\ldots. It can end with a repeated AA on games n≡2(mod3)n\equiv2\pmod3.

If BB wins game one, the sequence is B,C,A,B,C,A,…B,C,A,B,C,A,\ldots. A repeated AA ends it on games n≡1(mod3)n\equiv1\pmod3.

For each allowed nn, exactly one sequence of nn game results produces that outcome, with probability 2−n2^{-n}. Thus

P(A wins on game n)={2−n,n≡1,2(mod3),0,n≡0(mod3),n≥2.\boxed{P(A\text{ wins on game }n)=\begin{cases}2^{-n},&n\equiv1,2\pmod3,\\0,&n\equiv0\pmod3,\end{cases}\qquad n\ge2.}

Part 2: condition on both the champion and the time bound

A final opponent BB occurs in the second sequence, so the possible final games are 4,7,…,3m−24,7,\ldots,3m-2. Let r=1/8r=1/8. The joint probability in the numerator is

N=∑j=1m−12−(3j+1)=114(1−81−m),N=\sum_{j=1}^{m-1}2^{-(3j+1)}=\frac1{14}(1-8^{1-m}),

where the sum is empty and zero when m=1m=1.

The probability that AA wins within 3m3m games also includes final games 2,5,…,3m−12,5,\ldots,3m-1:

D=∑j=0m−12−(3j+2)+N=5−12⋅8−m14.D=\sum_{j=0}^{m-1}2^{-(3j+2)}+N=\frac{5-12\cdot8^{-m}}{14}.

Consequently the required conditional probability is

ND=8m−85⋅8m−12.\boxed{\frac ND=\frac{8^m-8}{5\cdot8^m-12}.}

At m=1m=1 it is zero, which matches the fact that AA can only win by game three by winning the first two games, with CC as its final opponent.

A checklist before dividing

Name the conditioning event precisely, including any observation protocol or time bound. Confirm that it has positive probability. Split the denominator into disjoint cases and reuse the numerator if it is already one of them. Finally, ask whether independence was established or merely assumed from the order in which events occurred.

Related articles

About the author

Koki Saito

Physician and graduate of the University of Tokyo Faculty of Medicine. Drawing on his entrance-exam experience, he explains how to choose mathematical methods and construct complete solutions.

Full profile →

Have a question or spotted an error? Contact us.