21

Lets say, we're calculating averages of test scores:

Starting Test Scores: 75, 80, 92, 64, 83, 99, 79

Average = 572 / 7 = 81.714...

Now given 81.714, is there a way to add a new set of test scores to "extend" this average if you don't know the initial test scores?

New Test Scores: 66, 89, 71

Average = 226 / 3 = 75.333...

Normal Average would be: 798 / 10 = 79.8

I've tried:

Avg = (OldAvg + sumOfNewScores) / (numOfNewScores + 1)

(81.714 + 226) / (3 + 1) = 76.9285

Avg = (OldAvg + NewAvg) / 2

(81.714 + 79.8) / 2 = 80.77

And neither come up the exact average that it "should" be. Is it mathematically possible to do this considering you don't know the initial values?

thepip3r
  • 2,855
  • 6
  • 32
  • 38

3 Answers3

43

You have to know the number of test scores in the original set and the old average:

newAve = ((oldAve*oldNumPoints) + x)/(oldNumPoints+1)
duffymo
  • 305,152
  • 44
  • 369
  • 561
7

Say, you have 2 blocks of scores:

1st: n scores with average = a1 
2nd: m scores with average = a2

then average of total scores equals:

a1*(1.0*n/(m+n))+a2*(1.0*m/(m+n))

In case you want just add 1 score (a2) to existing set formula becomes

a1*(n/(n+1))+ a2/(n+1)
Vladimir
  • 170,431
  • 36
  • 387
  • 313
6

The standard approach is to store the count and the sum of the values.

They can be updated easily, and from them the average can be computed without loss of precision.

starblue
  • 55,348
  • 14
  • 97
  • 151