I find this question can be explained by this, there are 27 students who do Chemistry and 21 students doing Physics. Now, suppose we add them together we have 48 students. However, 48 students studying these 2 sciences and adding the 8 will be unrealistic, thus we have to remove 8 students from the 48 students to make 40 students. At this point, we are told that there were 50 students surveyed so automatically 50-40=10 and that is 10 students do neither.
Fun fact: Inclusion-Exclusion principle will trivialise this question. If not allowed one can just show that the shape for Venn Diagram can be formed from two circles which are the choices and take away the intersection which is doing both and there you will get the total who did one or both options.