The correct answer is option (C):
both the statements together are needed to answer the question
Here's a breakdown of why the correct answer is "both the statements together are needed to answer the question."
We need to figure out the total number of students in the class. We are given the information that Mahesh and Ramesh are in the same class and that the difference in their ranks is 8.
Let's analyze each statement:
Statement 1: Mahesh has an equal number of students above and below him in terms of rank. This tells us Mahesh is in the middle of the class. If we let the total number of students be 'n', then Mahesh's rank will be (n+1)/2, because he is in the middle. We don't have enough information about Ramesh's rank to determine the total class strength. Alone, this statement is not sufficient.
Statement 2: The number of students above Ramesh's rank is equal to the number of students between Mahesh and Ramesh's ranks. This information does not tell us what the total number of students in the class is by itself. Thus, it is not sufficient.
Now let's consider both statements together:
From Statement 1, we know Mahesh is in the middle of the class. From the given information, we know that the difference between their ranks is 8. Since Mahesh is in the middle, and we are told that the number of students above Ramesh equals the number of students between Ramesh and Mahesh (Statement 2) and that the rank difference is 8, we can deduce some properties about the ordering of the ranks. We do not know if Mahesh is above or below Ramesh but this doesn't affect our reasoning. Let's assume Ramesh is ranked lower than Mahesh, i.e., Ramesh is at a later rank, lower in the class. Mahesh's rank is 'm'. Since the rank difference is 8, Ramesh's rank is m+8. If the number of students above Ramesh is equal to the number of students between Mahesh and Ramesh, then since the difference in the ranks is 8, the rank difference between the students ranked just above Ramesh and Mahesh must be 4, as the students ranked from Ramesh to Mahesh must be included in the same group of students. Mahesh is in the middle. This means the number of students above Ramesh = 4. The number of students between Ramesh and Mahesh is 4. Mahesh is in position 'm', so there must be 'm-1' students above him. And 'm-1' must equal 4+4. So, m-1=8, so m=9. The total number of students = 2*m-1, which is 17.
If Ramesh is ranked above Mahesh, then let Mahesh be at rank m and Ramesh at rank m-8. Students ranked from Ramesh to Mahesh is 7. If the number of students above Ramesh = number of students between Ramesh and Mahesh. Then the number of students between Ramesh and Mahesh is 7. Total number of students above Ramesh = 7. Thus the number of students below Mahesh is also 7, and Mahesh is at m = 8. And Ramesh is at m-8 = 0. This is not possible. Thus we can conclude that Ramesh is always below Mahesh.
Using both statements together allows us to determine the total number of students.
Therefore, the answer is "both the statements together are needed to answer the question".