# How do you calculate the expected value of a random variable?

E(X) = ${\sum}_{0}^{n} x p \left(x\right)$ where x = 0,1,2,3,... n or ${\int}_{0}^{\infty} x f \left(x\right) \mathrm{dx}$
In this, if the mathematical laws are true, then any number from 1 to 6 can turn up and each number has the same probability $\left(\frac{1}{6}\right)$. When these values are listed, we have a tabular from where the first column has values 1 to 6 listed and the second column has value $\frac{1}{6}$ repeated. Since the mathematical expectation is nothing but the arithmetic mean, we calculate the arithmetic mean here.