Getting Average

How excatly do I calculate the average? Can somebody explain step by step process of how to get an average?

If I have an array of numbers (5, 3, 4, 3, 1) and so on. And I need to get the average of these numbers on a scale of 5 what is the equation of doing this?

-
There are many averages. Regular average is known as arithmetic mean, obtain by summing elements of your array and dividing over its length. –  Sasha Aug 23 '11 at 19:51

1 Answer

To average a list of numbers, add up all the numbers and then divide by the size of your list.

For your example, we'd get $$\frac{5+3+4+3+1}{5} = \frac{16}{5} = 3.2.$$

-
Ok, so for a little explanation. The first division by 5 is the number of votes? The second being the number of possible choices? –  Howdy_McGee Aug 23 '11 at 20:12
There is only one division by 5. The leftmost expression is the setup. The middle one is where I added up all the numbers in the numerator (the numbers in the list). The rightmost is when I divided the sum by 5 (the size of the list). –  Austin Mohr Aug 23 '11 at 20:16
Ok cool, I see where that is coming from! What if I want to go deep than that though and only have the average between 0 and 5? I have a survey where a user votes 1-5. I want to find the average vote between 1 and 5 for all the users combined. Do I need to average the average? Divide the average by 5? sum/number of vote / number of voting options? –  Howdy_McGee Aug 23 '11 at 20:21
You don't need to consider the range that the votes come from. Just add up all the votes and divide by the number of votes cast. The average will automatically fall within the desired range. –  Austin Mohr Aug 23 '11 at 20:24
It's because the average can never be smaller than the smallest number in the list or bigger than the biggest number in the list. For example, average the numbers 2, 3, and 4. It's definitely larger than the average of 2, 2, and 2, which is $\frac{2 + 2 + 2}{3} = \frac{3 \cdot 2}{3} = 2$. On the other hand, it's definitely smaller than the average of 4, 4, and 4, which is $\frac{4 + 4 + 4}{3} = \frac{3 \cdot 4}{3} = 4$. –  Austin Mohr Aug 23 '11 at 20:56