I have to test the quality of the pseudorandom number generators on the different samples. I understand that the good way is to select dispersion as a quality metrics.
I'm trying to find dispersion using the following formula:
$$ \mathop{\mathbb{D}}(x) = \mathop{\mathbb{E}}(x^2) - \mathop{\mathbb{E}}(x)^2 $$
To get mathematical expectation I am using:
$$ \mathop{\mathbb{E}}(x) = \frac{1}{l}\sum_1^lx $$
$$ \mathop{\mathbb{E}}(x^2) = \frac{1}{l}\sum_1^lx^2 $$
Are these methods correct? Can I use these approximations of math expectation for the pseudorandom number generator and why?