POJ 1191
题意是求均方差最小 均方差很麻烦 我们把它化简
设 σ = Σ n i = 1 ( x i − x − ) 2 n 开方 σ 2    =    Σ n i = 1 ( x i − x − ) 2 n =    Σ n i = 1 x i 2 − 2 Σ n i = 1 x i x − + n ∗ x 2 − n 因为 x −    =    Σ n i = 1 x i n 所以 σ 2    =    Σ n i = 1 x i 2 − 2 Σ n i = 1 x i x − + n ∗ x 2 − n    =    Σ n i = 1 x i 2 − Σ n i = 1 x i x − n    = Σ n i = 1 x i 2 n − x 2 − 所以 σ    =    Σ n i = 1 x i 2 n − x 2 − \text{设}\sigma =\sqrt{\frac{\underset{i=1}{\overset{n}{\Sigma}}\left( x_i-\overset{-}{x} \right) ^2}{n}} \\ \text{开方}\sigma ^2\,\,=\,\,\frac{\underset{i=1}{\overset{n}{\Sigma}}\left( x_i-\overset{-}{x} \right) ^2}{n}=\,\, \frac{\underset{i=1}{\overset{n}{\Sigma}}x_i^2-2\underset{i=1}{\overset{n}{\Sigma}}x_i\overset{-}{x}+n*\overset{-}{x^2}}{n} \\ \text{因为}\overset{-}{x}\,\,=\,\,\frac{\underset{i=1}{\overset{n}{\Sigma}}x_i}{n} \\ \text{所以}\sigma ^2\,\,=\,\, \frac{\underset{i=1}{\overset{n}{\Sigma}}x_i^2-2\underset{i=1}{\overset{n}{\Sigma}}x_i\overset{-}{x}+\overset{-}{n*x^2}}{n}\,\,=\,\,\frac{\underset{i=1}{\overset{n}{\Sigma}}x_i^2-\underset{i=1}{\overset{n}{\Sigma}}x_i\overset{-}{x}}{n}\,\,=\frac{\underset{i=1}{\overset{n}{\Sigma}}x_i^2}{n}-\overset{-}{x^2} \\ \text{所以}\sigma \,\,=\,\,\sqrt{\frac{\underset{i=1}{\overset{n}{\Sigma}}x_i^2}{n}-\overset{-}{x^2}} 设σ=ni=1Σn(xi−x−)2开方σ2=n
【P1191 棋盘分割】 dp
最新推荐文章于 2019-05-01 13:25:57 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)