In: Statistics and Probability
16.12 Compute the sample mean and sample median for the dataset 1,2,...,N
in case N is odd and in case N is even. You may use the fact that 1+2+···+N = N(N +1) 2 .
MEAN (Formula for mean is same for the both the values of N i.e when N is even or odd, the formula will be same)
Let's take 1,2,3,4......N is Arithmetic Progression
So here, a=1, n=N and d= 1
Then, Sn = n/2{2a + (n - 1)d}
On putting values we get
Sn = N/2{2×1 + (N- 1)×1} = N/2{2 + N - 1} = N/2(N + 1)
Now, Mean = Sum of all observations/ Total no of observaobservaobservation
Therefore : Mean = Sn/ N
N/2(N+1)/N = (N+1)/2
NOW MEDIAN
NOTE : We have to arrange the observations in ascending order
CASE 1 When the number of observations (N) is odd, the median is the value of the {(N+1)/2}th observation.
For example: if N=9, the value of the {(9+1)/2}th i.e the median is the 5th observation.
(ii) When the number of observations (N) is even, the median is
the mean of the
(N/2)th and {(N/2)+ 1}th observations
For example: If N= 10, the mean of the values of the
(10/2)thth and the {(10/2)+1}th observations i.e
the mean of the 5th and 6th term.