方差一瞥

\[\frac{1}{m}\sum\limits_{i=1}^m(a_i-\frac{sum}{m})^2\\=\frac{1}{m}\sum\limits_{i=1}^ma_i^2+\frac{sum^2}{m^2}-2\times a_i\times\frac{sum}{m}\\=\frac{1}{m}\times m\times\frac{sum^2}{m^2}-\frac{2}{m}\times sum\times\frac{sum}{m}+\frac{1}{m}\sum\limits_{i=1}^ma_i^2\\=-\frac{sum^2}{m^2}+\frac{1}{m}\sum\limits_{i=1}^ma_i^2 \]

乘上\(m^2\)后就变成了

\[-sum^2+m\sum\limits_{i=1}^ma_i^2 \]

上一篇:AtCoder Beginner Contest 238题解


下一篇:geotrellis使用(二)geotrellis-chatta-demo以及geotrellis框架数据读取方式初探