In a math class with 18 students, a test was given the same day that an assignment was due. There were 9 students who passed the test and 10 students who completed the assignment. There were 7 students who passed the test and also completed the assignment. What is the probability that a student chosen randomly from the class passed the test or completed the assignment?