a)
The mean is the sum of all the responses (∑x) divided by the number of responses (n).
Here, n=20.
∑x=1+0+4+6+2+5+0+1+7+8+8+8+0+2+5+4+0+7+2+5=75.
Therefore we calculate the mean
¯x=∑xn=7520=3.75.
b)
The median is the middle value. We need to sort the list in order:
[Math Processing Error]
There is an even number of responses, so there are two numbers in the middle (10th and 11th place). To find the median, we need to find the mean of these two numbers \var{as[9]} and \var{as[10]}:
\begin{align} \frac{\var{as[9]} + \var{as[10]}}{2} &= \frac{\var{as[9] + as[10]}}{2} \\ &= \var{median} \text{.} \end{align}
c)
The mode is the value that occurs the most often in the data.
To find a mode, we can look at our sorted list:
\var{as[0]}, \var{as[1]}, \var{as[2]}, \var{as[3]}, \var{as[4]}, \var{as[5]}, \var{as[6]}, \var{as[7]}, \var{as[8]}, \var{as[9]}, \var{as[10]}, \var{as[11]}, \var{as[12]}, \var{as[13]}, \var{as[14]}, \var{as[15]}, \var{as[16]}, \var{as[17]}, \var{as[18]}, \var{as[19]}.
We notice that \var{mode1} occurs the most (\var{modetimes[mode1]} times) so \var{mode1} is the mode.
d)
Range is the difference between the highest and the lowest value in the data.
To find this, we subtract the lowest value from the highest value:
\var{max(a)} - \var{min(a)} = \var{range} \text{.}