Question: how to compute the variance of x?
Answer: For a discrete random variable X, the variance of X is obtained as follows: var(X)=∑(x−μ)2pX(x), where the sum is taken over all values of x for which pX(x)>0. So the variance of X is the weighted average of the squared deviations from the mean μ, where the weights are given by the probability function pX(x) of X.