01.07.2013, 12:39
But what about when I need to add to it?
If I have the following:
69
42
55
18
32
The average is 216/5 = 43.2
If I then add 64 to that list:
69
42
55
18
32
64
The average is 280/6 = 46.6
But to increase it, I had to store the count (5) and total (216). How do I do it WITHOUT storing the count and total, and just storing the average? Is that even possible? I think not.
If I have the following:
69
42
55
18
32
The average is 216/5 = 43.2
If I then add 64 to that list:
69
42
55
18
32
64
The average is 280/6 = 46.6
But to increase it, I had to store the count (5) and total (216). How do I do it WITHOUT storing the count and total, and just storing the average? Is that even possible? I think not.