and he would like to find the *variance* of each consecutive subsequences of length m.
Bobo learnt that the *variance* of a sequence a_1, a_2, dots, a_n a 1 ,a 2 ,…,a n is sqrt{frac{sum_{i = 1}^n (a_i - bar{a})^2}{n - 1}} n−1 ∑ i=1 n (a i − a ˉ ) 2 where bar{a} = frac{sum_{i = 1}^n a_i}{n}. a ˉ = n ∑ i=1 n a i . Bobo has a sequence a_1, a_2, dots, a_n a 1 ,a 2 ,…,a n , and he would like to find the *variance* of each consecutive subsequences of length m. Formally, the i-th ( 1 leq i leq n - m + 1 1≤i≤n−m+1) rolling variance r_i r i is the *variance* of sequence {a_i, a_{i + 1}, dots, a_{i + m - 1}} {a i ,a i+1 ,…,a i+m−1 }.
