A class of students was asked about their favorite type of pet. The results are shown in the following bar graph:
The graph indicates that 10 students prefer dogs, 6 prefer cats, 4 prefer birds, and 8 prefer fish. If a student is selected at random from the class, what is the probability that the student prefers a dog?