Let $X$ be a random variable which takes values $0,1,2,3,4,5$, and $6$ with the distribution function $f$. The distribution of $X$ is given below Distribution of X

What is the simplest way to compute mean, variance, etc from distribution presented like this? From the documentation, Variance[] only takes a predefined distribution or a plain list as input.


1 Answer 1

x = {0, 1, 2, 3, 4, 5, 6};
f = {17, 29, 27, 16, 7, 3, 1}/100;

Variance[EmpiricalDistribution[f -> x]]



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.