# How the sample mean changes when you add a new observation

I don't know how to solve in my statistics homework problem

Sample

In a class of 6 students, their average age is 21. When the teacher joins the class, the avg age becomes 26. What's the age of the teacher ?

Is there a formula to do this or a series of substitutions ?

-
Please add the homework tag to homework questions. –  joriki Sep 18 '12 at 11:08
yes I think there is one: $\frac{1}{N}\sum_{i=1}^N x_i$. In your problem $N=6$ when the teacher joins then $N=7$. –  Seyhmus Güngören Sep 18 '12 at 11:12
@SeyhmusGungoren could you explain your formula ? I don't understand very well –  Lucas_Santos Sep 18 '12 at 11:14
In the formula $x_i$ is the age of each person and $N$ is the total number of persons. For example if there are $6$ persons, then you have $\frac{1}{6}(x_1+x_2+...+x_6)=21$ becase $N=6$. If a new person comes $N$ will be $7$ and the result will be $26$. Can you do the rest? I think you can!! –  Seyhmus Güngören Sep 18 '12 at 11:18
@SeyhmusGungoren Thanks a lot! it helps a lot. –  Lucas_Santos Sep 18 '12 at 11:30

You have this relationship between sample means of size n and n+1.

∑X$_i$/(n+1)= n(∑X$_i$/n)/(n+1) +X$_n$$_+$$_1$/(n+1)

26= 6(21)/7 + X$_7$/7.

So solve for X$_7$ =7[26-6(21)/7]=7 (26) -6(21).

-

Hint: Do you know the relationship between the average age, the total age and the number of people? How could you use this in two steps to get from the average age and number of people in one case to the age of an additional person that gets added to the total?

-
No, could explain it or give me a reference ? –  Lucas_Santos Sep 18 '12 at 11:12
"No", just like that? No you do not know any of these? –  Did Sep 18 '12 at 12:59
@Lucas: I was referring to the formula that Seyhmus gave in a comment shortly thereafter. –  joriki Sep 18 '12 at 15:27

If you have the sample average based on $n$ samples, $\overline{x}_n$, and add a new observation, $x$, then the new sample average is

$$\overline{x}_{n+1} = \frac{ n \overline{x}_n + x }{n + 1}$$

using the data you provided, $\overline{x}_n = 21$, $n = 6$ and $\overline{x}_{n+1} = 26$, so you know 3 out of 4 unknowns:

$$26 = \frac{ 6 \cdot 21 + x }{6 + 1}$$

and you can solve for the last unknown, $x$, which I'll leave to you. I hope this helps!!

-

If the teacher's age was $21$, the average would be $21$. But the average is $26$, so the teacher's age must be $(7)(26-21)$ more than $21$.

-