# Contingency table

Carrying out a telephone poll, we have asked $$1000$$ persons if they believed it necessary to have more lighting in the street at night.

The poll was answered by $$480$$ men, of whom $$324$$ answered yes, and $$156$$ no, and $$520$$ women, of whom $$351$$ answered yes, and $$169$$ no. We wonder if men and women have a different opinion, or whether this is irrelevant to the question.

To begin to solve the problem, what we have done is to put the information in a table:

 Yes No Men 324 156 Women 351 169

This is a limited version of a contingency table. We can do a complete contingency table if we write on every side of the table the sums of every row and every column:

 Yes No Total (M/W) Men 324 156 480 Women 351 169 520 Total (Sí/No) 675 325 1000

Namely on the right, $$480 = 324+156, \ 520 = 351+169$$$On the other hand, in the lower row, $$324+351=675, 156+169=325$$$

These are the entire partial ones: in our case, on the right we have the total number of men who have answered $$(480)$$ and the total number of women $$(520)$$, and below, the total number of people who have answered yes $$(675)$$, and the total number that have answered no $$(325)$$.

Finally, in the lower right-hand corner, which remains free, normally we put the sum of the entire partial ones, which corresponds, in our case, to the whole number of people who have answered the poll.

If we do things properly, it does not matter whether we add the total partials of the right or the ones in the lower row. In our case, $$1000= 480+520 = 675+325$$\$

The table turns out to be very useful to deduce information that we lack. Let's see an example:

In a class of $$35$$ students there are $$4$$ left-handed boys, $$20$$ girls, and a total of $$26$$ right-handed ones.

What is the probability of being a girl, and right-handed?

Note: suppose, to simplify, that one can be only either right-handed or left-handed.

First, we introduce the information of the statement in the contingency table.

 Right-handed Left-handed Total Boys 4 Girls 20 Total 26 35

Since there are a total of $$35$$ students, and $$20$$ are girls, then $$35-20=15$$ are boys. Then, since out of the $$15$$ boys, $$4$$ are left-handed, $$15-4=11$$ are right-handed. We introduce it in the table.

 Right-handed Left-handed Total Boys 11 4 15 Girls 20 Total 26 35

Since there are $$26$$ right-handed people, and $$11$$ are boys, then there are $$26-11=15$$ right-handed girls. Therefore, the probability of being girl and right-handed is $$15/35$$.

If we want, we can complete the table.

 Right-handed Left-handed Total Boys 11 4 15 Girls 15 5 20 Total 26 9 35