Here in the below image, from the question, it looks like there are two variables, one is class type (X,Y) and other is Marks of students. I thought here we must apply Correlation between numerical and categorical variable, but it turns out in solution he used correlation between two numerical variables. Its very confusing when to use one over the other. Will it be specified when to use which?