Example Stream a,b,c,b,d,a,c,d,a,b,d,c,a,a,b Let’s keep three variables, X 1 , X 2 , and X 3 “At random” we pick the 3 rd , 8 th and 13 th positions to define these three variables. When we reach position 3, we find element c, set X 1 .element = c and X 1 .value = 1. At position 7, X 1 .element = c and X 1 .value = 2 At position 8, X 2 .element = d and X 2 .value = 1 At position 13, X 3 .element = a and X 3 .value = 1 At position 14, X 3 .element = a and X 3 .value = 2 Final value : X 1 .value = 3, X 2 .value = 2, X 3 .value = 2 We can derive an estimate of the second moment from any variable X = n(2X.value − 1) * Mining of Massive Datasets, http://www.mmds.org ‹#›