EX.Rd
Expected Value and Variance for the distribution of a discrete random variable. (For didactical purposes..)
EX(x, p) VarX(x, p)
the values of the random variable
the probabilities of the values
numeric value
Andri Signorell <andri@signorell.net>
EX(x=c(1:3), p=c(0.2, 0.5, 0.3)) #> [1] 2.1 VarX(x=c(1:3), p=c(0.2, 0.5, 0.3)) #> [1] 0.49