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 :)