Answers:
(a) 12 boys play basketball
(b) See figure 2 below
==========================================================
Step-by-step explanation:
Part (a)
You are on the right track so far when you wrote the partial table.
There are 15 girls in the class, and 8 girls that play basketball. That must mean 15-8 = 7 girls do not play basketball.
Focusing on the first row only, we'll have 7 go in the second column and 15 go in the third column. The first row is filled out entirely.
There are 32 students and 15 girls. This means there are 32-15 = 17 boys. We'll write 17 at the end of the second row.
The other missing value of this row is 17-5 = 12 to represent the number of boys who play basketball. This is because of the 5 boys that don't play basketball.
To fill out the missing items in the third row, add the columns straight down.
We have 8+12 = 20 basketball players and 7+5 = 12 people who do not play basketball. Notice how 20+12 = 32 along the bottom row to help confirm the correct values.
Check out figure 1 to see the entire two-way frequency table.
We see that there are 12 boys that play basketball.
------------------------------------------------
Part (b)
The previous part detailed how to set up the two-way frequency table.
For this part, we'll be creating the two-way relative frequency table. The keyword "relative" means that we'll divide each item by the grand total 32.
For instance, in the first row & first column we have 8/32 = 0.25; do the same with the other values. Do not round. The reason for this is because each decimal item is a terminal decimal, meaning the digits stop at some point. If your teacher instructs you to round, then be sure to follow those instructions of course.
Check out figure 2 so you can see the two-way relative frequency table.
A result like 0.25 in the first row & first column tells us that 25% of the class is a girl and plays basketball.