Final answer:
The probability that a randomly chosen student from the class plays either basketball or baseball is 16 out of 21.
Step-by-step explanation:
To solve the problem, we first need to find out how many students play at least one of the sports. Since 5 students play neither, that leaves us with 21 - 5 = 16 students who play either basketball, baseball, or both.We cannot simply add the number of basketball players (12) to the number of baseball players (14) to get the number who play either sport because this would double-count the students who play both sports. To avoid double-counting, we use the principle of inclusion-exclusion:Number of students playing either basketball or baseball = (Number of basketball players) + (Number of baseball players) - (Number playing both)We can find the number of students playing both by subtracting the total who play at least one sport from the sum of basketball and baseball players: 12 + 14 - 16 = 10 students play both sports.Thus, the number playing either basketball or baseball is 12 + 14 - 10 = 16 students.The probability that a randomly chosen student plays basketball or baseball is therefore the number who play either sport (16) divided by the total number of students (21), which gives us a probability of 16/21.