To find the probability of randomly selecting a male student from the class, we first need to determine the number of male students.
Given:
- Total number of students in the class = 20
- Number of female students = 12
To find the number of male students, we subtract the number of female students from the total number of students:
\[ \text{Number of male students} = \text{Total students} - \text{Female students} = 20 - 12 = 8 \]
Now, the probability \( P \) of randomly selecting a male student is given by the ratio of the number of male students to the total number of students:
\[ P(\text{male student}) = \frac{\text{Number of male students}}{\text{Total number of students}} = \frac{8}{20} \]
To simplify this fraction, we divide both the numerator and the denominator by their greatest common divisor (GCD), which is 4:
\[ P(\text{male student}) = \frac{8 \div 4}{20 \div 4} = \frac{2}{5} \]
Thus, the probability of randomly selecting a male student from the class is:
\[ \frac{2}{5} \]