How to add a number to a list to make that number equal to the mean of the list?

125 Views Asked by At

I have numbers: $1, 2, 3, 4, 6, 7, 8, 9, 10$

Number of int $= 9$

Total $= 50$

Mean $= \frac{50}{9} = 5.55555\cdots$


If I were to add the number 5 to the list, I get:

Number of int $= 10$

Total $= 55$

Mean $= \frac{55}{10} = 5.5$

However, $5.5$ is not equal to $5.$

What number do I add to the list that is also equal to the mean?

I tried Brute forcing it with Python. No luck:

main = 50
numbers = 10

magic = 5
for each in range(100000):
  x = (main + magic)/numbers
  if(x == magic):
    print('********************', magic)
  magic = magic + 0.00001

The closest I get is: $5.555549999978968$

2

There are 2 best solutions below

0
On BEST ANSWER

Let the number be $x$ .

Then ,the new mean $ = \frac{\text{Total Sum}}{\text{Total Numbers}} = \dfrac{50+x}{10}$. Since this must be equal to the number , We have:

$$\dfrac{50+x}{10} = x \implies 50 =9x \implies x=\dfrac{50}9$$

So the required number is $\dfrac{50}9$.

0
On

The mean of the existing numbers in the list will have this property.

To see this, suppose you already have the $n-1$ numbers $a_1, a_2, \dots, a_{n-1}$. You want to find a number $\mu$ such that the mean of the augmented list of $n$ numbers is equal to this number: $$\frac{a_1 + a_2 + \cdots + a_{n-1} + \mu}{n} = \mu$$ $$a_1 + a_2 + \cdots + a_{n-1} + \mu = n\mu$$ $$a_1 + a_2 + \cdots + a_{n-1}= (n-1)\mu$$ $$\mu = \frac{a_1 + a_2 + \cdots + a_{n-1}}{n-1}$$ which is the mean of the original list.

The same reasoning shows that you can throw in as many copies of the original mean as you want, the the mean of the resulting longer list will be unchanged.