Lehet úgyis gondolkodni, hogy: (old_avg*n + value)/(n+1) = old_avg + (value - old_avg)/(n+1) ps.: remélem nem basztam el :)