# i am not able to solve the highlighted que. in the image .plz help me to get the solution!

+1 vote
3.2k views

A class has 100 students. Let ai, 1 ≤ i ≤ 100, denote the number of friends the i-th student has in the class. For each 0 ≤ j ≤ 99, let cj denote the number of students having at least j friends.

by (65.0k points)

This is the way you can get the solution.

Let us Consider the number of times a specific student contributes to the sum on the RHS.

If a student has i friends, then he will contribute one to the total in C1, again in C2, again in C3, up until again in Ci. I.e. it will contribute a total of i to the overall sum (broken up over multiple parts of the summation).

Let

We have then the total sum is equal to:

Now, Notice that Ai is equal to the sum of the ith row whereas Cj is equal to the sum of the jth column. Stopping at 99 for the sum for Cj is fine since C100=0 since no one can possibly be friends with 100 people (there are only 99 people for each person to be friends with).

So, the LHS summation is adding everything row by row whereas the RHS summation is adding everything column by column.