Variance formula: square of d = square of (x1-e) * p1+(x2-e) * square of p2 +(x3-e) *P4+.
Square of +(Xn-E) *Pn