0
$\begingroup$

This is for a programming exercise. I have:

  • the last average value
  • the last standard deviation
  • the total number of values

I need to be able to add a new value to my average without knowing the preceding ones but I can't figure out how to do this.

Can anybody help me on this?

$\endgroup$
  • $\begingroup$ Do you also need to calculate the new standard deviation, or only the new average? $\endgroup$ – Trevor Wilson May 19 '13 at 15:38
1
$\begingroup$

Hint: If you know the number of preceding values and also their average, then you know their sum. Then you can calculate the new sum.

(Note that the standard deviation is irrelevant to all of this.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.