Steply

Two-way table: boys 12 cat 8 dog, girls 10 cat 20 dog; P(girl and…

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: cat or dog?

Boys: 12 cat, 8 dog.

Girls: 10 cat, 20 dog.

One person is picked at random.

Find P(girl and dog) and P(dog 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: 12 plus 8 is 20.

10 plus 20 is 30.

Column totals: 22 and 28.

And 50 people in all.

The totals sit at the edges, in the margins.

totals: at the edges (the margins)

2 One cell over all

Girl and dog: both at once.

That is one cell, 20.

Out of everyone, 50.

So P of girl and dog is 20/50.

P(girl and dog) = 2050

Careful!

And means out of everyone: 50.

Over 28 would be given dog.

Careful: not 2028 ✗

Both 20 and 50 can be divided by 10.

So it is 2/5.

P(girl and dog) = 20 ÷ 1050 ÷ 10 = 25

3 Keep only the given row

Given girl: only this row counts.

In it: 20 dog, out of 30.

So P of dog given girl is 20/30.

P(dog | girl) = 2030

Both 20 and 30 can be divided by 10.

So it is 2/3.

P(dog | girl) = 20 ÷ 1030 ÷ 10 = 23

So: P of girl and dog is 2/5.

P of dog given girl is 2/3.

4 Check

Let's check.

The four cells add up to 50, everyone.

The table is right.

12 + 8 + 10 + 20 = 50 ✓

And the and rule: P of girl, 30/50, times P of dog given girl, 20/30.

The 30s cancel: 20/50.

So the answer is right!

P(girl) × P(dog | girl) = 3050 × 2030 = 2050

Let's look back.

First: make the table.

Then: one cell over all.

Then: keep only the given row.

Last: check.

Answer
P(dog | girl) = 20 ÷ 1030 ÷ 10 = 23

Your turn

Try this one yourself, then check:

Show the answer
P(girl and dog) = 13; P(dog | girl) = 23

More from Two-way tables

The whole lesson: Two-way tables →