Running Mean

Often there is a need to calculate the mean of a list of values of indeterminate length. This can be done by keeping a running sum and a count separately, but this may risk overflows. Instead, it's possible to derive an expression for the new mean in terms of the previous mean.