0
$\begingroup$

I'm given variance V, expectation E and number n - amount of values random variable takes. Is there any general algorithm to construct discrete random variable with such variance and expectation? (probabilies of each outcome is a rational number)

Code implementation is allowed too :)

$\endgroup$
0

1 Answer 1

2
$\begingroup$

Take any discrete random variable $X$ which takes $n$ different values with mean $\mu$ and variance $\sigma^2$. For instance you can take $X$ uniformly distributed on $\{0,1,\cdots,n-1\}$ which has mean $\mu=\frac{n-1}{2}$ and variance $\sigma^2=\frac{n^2-1}{12}$.

Then $Y=E+\sqrt V\frac{X-\mu}{\sigma}$ has mean $E$, variance $V$ and takes $n$ different values.

$\endgroup$
2
  • $\begingroup$ Thank you, but is probabilty of each outcome for Y is rational number? $\endgroup$
    – regina
    Commented Mar 17 at 13:26
  • 1
    $\begingroup$ In the example of the uniform distribution yes, as each will be $1/n$. $\endgroup$
    – Will
    Commented Mar 17 at 13:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .