A physics class has 40 students. Of​ these, 18 students are physics majors and 17 students are female. Of the physics​ majors, seven are female. Find the probability that a randomly selected student is female or a physics major.