Step 1) Calculate total number of students in the class:
18 students with only a brother
+ 8 students with only a sister
+ 12 students with both a brother and sister
= 38 Total Students
Step 2) Calculate Probability
12 students with both a brother and sister
/ 38 Total Students
= 0.316 or 31.6%