Final answer:
The probability that a student chosen randomly from the class plays both basketball and baseball is 6.9%.
Step-by-step explanation:
To find the probability that a student chosen randomly from the class plays both basketball and baseball, we need to determine the number of students who play both sports and divide it by the total number of students in the class.
Given that there are 5 students who play basketball, 19 students who play baseball, and 7 students who play neither sport, we can use the principle of inclusion-exclusion to calculate the number of students who play both sports.
Let's denote the number of students who play both basketball and baseball as x.
Then, we can set up the following equation: 5 + 19 - x + 7 = 29.
By simplifying this equation, we get x = 2.
Therefore, there are 2 students who play both basketball and baseball.
To calculate the probability, we divide the number of students who play both sports by the total number of students:
2/29 = 0.069
= 6.9% (rounded to the nearest tenth).