In a class of 30 students, 18 students play soccer, 12 students play basketball, and 5 students play both soccer and basketball. If a student is chosen randomly from the class, what is the probability that the student plays only soccer or only basketball?
The probability is 19/30.

Here's the reasoning:
1. We know that 18 students play soccer, 12 students play basketball, and 5 students play both sports.
2. The total number of students playing only soccer is 18 - 5 = 13 (subtracting those who play both sports).
3. Similarly, the total number of students playing only basketball is 12 - 5 = 7.
4. So, there are 13 + 7 = 20 students who play only one of the two sports.
5. However, we've made an error by counting one student twice (the one who plays both sports). Therefore, there are actually 20 - 1 = 19 students who play only soccer or only basketball.
6. Since there are 30 students in the class, the probability of choosing a student who plays only soccer or only basketball is 19/30.