# In a certain test with k questions, a_1 students gave at least one wrong answer, a_2 students gave at least 2 wrong answers, etc. What was the total number of wrong answers?

Jun 12, 2016

${\sum}_{i = 1}^{k} {a}_{i}$

#### Explanation:

This is like the total area of a histogram with the $x$ and $y$ axes flipped. The area is unchanged by flipping the axes, but the perspective is.

Jun 12, 2016

The total number of wrong answer is given by
${a}_{1} + {a}_{2} + \ldots + {a}_{k} = {\sum}_{i = 1}^{k} {a}_{i}$

#### Explanation:

Note first that if a student gave at least $m$ wrong answers, and $m > n$, then the student gave at least $n$ wrong answers as well. So, for example, if a student gave $k$ wrong answers, then that student also gave at least $k - 1$ wrong answers and at least $k - 2$ answers and so on.

With the above in mind, we can tell that the number of students who got exactly $i$ answers wrong is ${a}_{i} - {a}_{i + 1}$ for $i < k$ and ${a}_{k}$ for $i = k$.

With that, we can find the total number of wrong answers by taking the sum over $i$ of the number of students who got exactly $i$ answers wrong multiplied by $i$. That is,

$\text{Total wrong} = \left[{\sum}_{i = 1}^{k - 1} i \left({a}_{i} - {a}_{i + 1}\right)\right] + k {a}_{k}$

$= {a}_{1} - {a}_{2} + 2 {a}_{2} - 2 {a}_{3} + \ldots + \left(k - 1\right) {a}_{k - 1} - \left(k - 1\right) {a}_{k} + k {a}_{k}$

$= {a}_{1} + \left(2 - 1\right) {a}_{2} + \left(3 - 2\right) {a}_{3} + \ldots + \left(k - \left(k - 1\right)\right) {a}_{k}$

$= {a}_{1} + {a}_{2} + \ldots + {a}_{k}$

$= {\sum}_{i = 1}^{k} {a}_{i}$

We could also arrive at the result more quickly by noting that if a student got exactly $m$ answers wrong, then they increase the value of ${a}_{i}$ by $1$ for each $i = 1 , 2 , \ldots , m$. Then, if we sum all of the ${a}_{i}$'s, that student will be counted in $m$ of them, meaning their contribution is equal to the number of their wrong answers. As this is true for each student, the total wrong answers given by all of them must be ${\sum}_{i = 1}^{k} {a}_{i}$