Conditional Probability Notation

A vertical bar reads as the word given.

Reading the bar

The chance of A, given that B has happened, is written P(A | B). The vertical bar is read "given". The event whose chance is wanted goes on the left of the bar, and the event that is known to have happened goes on the right.

In the club of 24 members, the chance that a member plays sport, given that they play music, was 5/12. In the notation that is P(sport | music) = 5/12. The other way round, P(music | sport) = 5/13: the same two events with the roles swapped, and a different answer.

Given B

Call the music players A and the sport players B, so the regions hold 7 in A only, 5 in both, 8 in B only and 4 in neither. To find P(A | B), start from what is given. Only the outcomes inside B are still possible: 5 shared with A and 8 in B alone, so 13 outcomes.

UAB7584

Given B, only the 5 + 8 = 13 outcomes in the shaded circle count. The 7 in A only and the 4 in neither are ruled out.

The overlap out of B

Of those 13 outcomes, the 5 in the overlap are in A as well. So P(A | B) = 5/13.

UAB7584

The overlap holds the 5 outcomes in A and B. Out of the 13 in B, that is 5/13.

The formula

In chances, the overlap has probability 5/24 and the condition has P(B) = 13/24. Dividing one by the other gives the same answer as the counts, because the 24s cancel: (5/24) ÷ (13/24) = 5/13.

So P(A | B) is the chance of both, P(A and B), divided by the chance of the condition, P(B). Multiplying both sides by P(B) turns it round: P(A and B) = P(B) × P(A | B).

Tree branches are conditional

The second branches of a tree are conditional probabilities. For the bag of 3 red and 2 blue counters drawn without replacement, the branch 2/4 after a red is P(second red | first red). Multiplying along the path is the formula turned round: the chance of red then red is the chance of a first red, 3/5, times the chance of a second red given a first red, 2/4, so 3/5 × 2/4 = 3/10.

For independent events, knowing B changes nothing, so P(A | B) = P(A). A dice and a coin are independent, so P(head | six) = 1/2 = P(head). In the club, P(A) = 12/24 = 1/2 but P(A | B) = 5/13, so playing music and playing sport are not independent.

R
R
B
B
R
B

R for a red counter and B for a blue one. The second branch on the colored path, 2/4, is the chance of a second red given a first red. The first branch, 3/5, is the chance of the condition.

From the chances alone

Out of 30 equally likely outcomes, the chance of both A and B is 6/30 and P(B) = 15/30. Then P(A | B) = 6/15 = 2/5: given B, 15 outcomes are left, and 6 of them are in A.

The usual mistakes

Reading the bar the wrong way round. P(A | B) divides by B; P(B | A) divides by A. With the club, 5/13 and 5/12.

Writing P(A and B) for P(A | B). The chance of both, 6/30, is out of every outcome, and no condition has narrowed them yet; P(A | B) is out of the 15 in B.

Counting the part of B that is not in A: 9/15. The question asks for the outcomes in B that are in A as well, the overlap.

Cyclists and helmets

In the application below, a two-way table of 160 cyclists sorts them by age and by helmet. The condition after the bar chooses the row or the column whose total goes underneath.

Worked example: A Survey of Cyclists and Helmets, Where the Given Condition Chooses the Row or the Column

Question A council counted 160 cyclists on a cycle path and recorded their age group and whether they wore a helmet. Of the 48 cyclists under 18, 36 wore a helmet. Of the 112 cyclists aged 18 or over, 70 wore a helmet. (a) A cyclist under 18 is chosen at random. Find the probability that this cyclist wore a helmet, and compare it with the same probability for the older cyclists. (b) A cyclist who wore no helmet is chosen at random. Find the probability that this cyclist is under 18.

  1. 1.Complete the two-way table. Under 18, 48 − 36 = 12 wore no helmet. Aged 18 or over, 112 − 70 = 42 wore no helmet. The column totals are 36 + 70 = 106 with a helmet and 12 + 42 = 54 without.

    HelmetNo helmetTotalUnder 1836124818 and over7042112Total1065416048 − 36 = 12 and 112 − 70 = 4236 + 70 = 106 and 12 + 42 = 54
    HelmetNo helmetTotalUnder 1836124818 and over7042112Total1065416048 − 36 = 12 and 112 − 70 = 4236 + 70 = 106 and 12 + 42 = 54
    Complete the table: 12 and 42 cyclists wore no helmet, and the columns total 106 and 54.
  2. 2.(a) Given under 18, the whole is the Under 18 row, 48 cyclists. P(helmet | under 18) = 3648 = 34. For the older cyclists it is 70112 = 58, so a younger cyclist was more likely to wear a helmet.

    HelmetNo helmetTotalUnder 1836124818 and over7042112Total10654160given under 18: 36/48 = 3/4given 18 and over: 70/112 = 5/8
    HelmetNo helmetTotalUnder 1836124818 and over7042112Total10654160given under 18: 36/48 = 3/4given 18 and over: 70/112 = 5/8
    (a) Given under 18, the whole is that row: 3648 = 34, against 70112 = 58 for the older cyclists.
  3. 3.Given no helmet, the whole is the No helmet column, 54 cyclists, and 12 of them are under 18.

    HelmetNo helmetTotalUnder 1836124818 and over7042112Total10654160given no helmet: the whole is 54
    HelmetNo helmetTotalUnder 1836124818 and over7042112Total10654160given no helmet: the whole is 54
    Given no helmet, the whole is the No helmet column, 54 cyclists.
  4. 4.(b) P(under 18 | no helmet) = 1254 = 29.

    HelmetNo helmetTotalUnder 1836124818 and over7042112Total1065416012/54 = 2/9 are under 18
    HelmetNo helmetTotalUnder 1836124818 and over7042112Total1065416012/54 = 2/9 are under 18
    (b) P(under 18 | no helmet) = 1254 = 29.
  5. 5.This is not the same as P(no helmet | under 18) = 1248 = 14. Both have the same 12 cyclists on top, but the condition changes the whole underneath: 54 in one and 48 in the other.

    HelmetNo helmetTotalUnder 1836124818 and over7042112Total1065416012/54 = 2/9 but 12/48 = 1/4same 12 on top, a different whole
    HelmetNo helmetTotalUnder 1836124818 and over7042112Total1065416012/54 = 2/9 but 12/48 = 1/4same 12 on top, a different whole
    The reverse, P(no helmet | under 18) = 1248 = 14, has a different whole.

Answer: (a) 34, compared with 58 for the cyclists aged 18 or over; (b) 29

Common mistakes

  • Dividing 36 by 160 in part (a). That is the probability that a cyclist from the whole count was under 18 and wore a helmet. Given under 18, only the 48 younger cyclists can be chosen.
  • Answering (b) with 1248. That is the probability that a cyclist under 18 wore no helmet. The question gives no helmet and asks about the age, so the denominator is the 54 cyclists without a helmet.

More probability with several events problems, worked step by step →

Practice Conditional Probability Notation in the app