Answer:
40
Step-by-step explanation:
It can help to make a diagram of some sort. Here is a sort of Karnaugh map. A Venn diagram can also work, or something like the one in the second attachment.
In the attachment of the first diagram, the rows and columns are labeled with 00, 01, 11, 10 — all the possible combinations of the two "likes" on that side of the diagram. A 0 indicates no like; 1 indicates a 'like to play'. Thus the "01" ro on the chess/soccer side of the board indicates "don't like to play chess and do like to play soccer." The numbers on this row will contribute to the number who like to play soccer, but not to the number who like to play chess.
Similarly, the "10" column on the hiking/biking side of the diagram indicates "like hiking but don't like biking." Numbers in this column will contribute to the counts of boys that like hiking, but will not contribute to the numbers who like biking.
For a problem of this nature, it often works well to start with the number who like all four activities. That "3" goes into the square on the "11" row and the "11" column, indicating all four activities are liked.
The total for "like chess, soccer, and hiking" is also 3, so the number in the 11 row and 10 column must be 0. That is, "like chess, soccer, and hiking" includes both those who do and those who don't like biking. If all three like biking, then there will be 0 who like chess, soccer, and hiking, but don't like biking.
The numbers at the right side or bottom of the main array are totals for rows, columns, or pairs of them.
The numbers in black are given in the problem statement. The numbers in red are derived by addition or subtraction to make the totals come out.
The colored squares have the totals indicated at lower right. In each case, the corresponding color in the main array is at the lower left of a 4-square block.
__
Once all the numbers are figured out, they can be totaled to find the number of boys in the class. That total is 40 boys.