In a certain Algebra 2 class of 24 students, 7 of them play basketball and 13 of them play baseball. There are 9 students who play neither sport. What is the probability that a student chosen randomly from the class plays both basketball and baseball?

Let's denote the number of students who play both basketball and baseball as x.

Then, the number of students who play only basketball is 7 - x, the number of students who play only baseball is 13 - x, and the number of students who play neither sport is 9.

Since there are 24 students in total, we can write the equation:
x + (7 - x) + (13 - x) + 9 = 24
7 + 13 + 9 = 24
29 = 24
x = 5

Therefore, there are 5 students who play both basketball and baseball.

The probability that a student chosen randomly from the class plays both basketball and baseball is:
5/24 = 0.2083

So, the probability is 0.2083 or approximately 20.8%.