Steply

Two-way table: boys 5 yes 15 no, girls 10 yes 10 no; P(yes), P(girl…

Step by step, with the reason for every step · Two-way tables · Probability

Step by step

The question

Question: A survey asked boys and girls: yes or no?

Boys: 5 yes, 15 no.

Girls: 10 yes, 10 no.

One person is picked at random.

Find P(yes), P(girl or yes) and P(yes given girl).

1 Make the table

One row for each group, one column for each answer, and a total for each.

The four counts go inside.

Row totals: 5 plus 15 is 20.

10 plus 10 is 20.

Column totals: 15 and 25.

And 40 people in all.

The totals sit at the edges, in the margins.

totals: at the edges (the margins)

2 A total over all

All the yes: 15.

Everyone: 40.

So P of yes is 15/40.

P(yes) = 1540

Careful!

The bottom is everyone, 40.

Not only the other 25.

Careful: not 1525 ✗

Both 15 and 40 can be divided by 5.

So it is 3/8.

P(yes) = 15 ÷ 540 ÷ 5 = 38

3 Add, take away the overlap

Girl: 20.

Yes: 15.

But 10 are both.

They are in both totals.

The or rule: add the two, then take away the overlap, so it is counted once.

P(girl or yes) = 2040 + 1540 − 1040

Same bottoms: 20 plus 15 minus 10 is 25.

So it is 25/40.

P(girl or yes) = 2540

Both 25 and 40 can be divided by 5.

So it is 5/8.

P(girl or yes) = 25 ÷ 540 ÷ 5 = 58

4 Keep only the given row

Given girl: only this row counts.

In it: 10 yes, out of 20.

So P of yes given girl is 10/20.

P(yes | girl) = 1020

Both 10 and 20 can be divided by 10.

So it is 1/2.

P(yes | girl) = 10 ÷ 1020 ÷ 10 = 12

So: P of yes is 3/8.

P of girl or yes is 5/8.

P of yes given girl is 1/2.

5 Check

Let's check.

The four cells add up to 40, everyone.

The table is right.

5 + 15 + 10 + 10 = 40 ✓

And the two cells of yes add up to its total: 5 plus 10 is 15.

So the answer is right!

540 + 1040 = 1540 = P(yes)

Let's look back.

First: make the table.

Then: a total over all.

Then: add, take away the overlap.

Then: keep only the given row.

Last: check.

Answer
P(yes | girl) = 10 ÷ 1020 ÷ 10 = 12

Your turn

Try this one yourself, then check:

Show the answer
P(yes) = 25; P(girl or yes) = 23; P(yes | girl) = 25

More from Two-way tables

The whole lesson: Two-way tables →