I need to find the variance of a probability distribution with two vectors, Prize and Probability. The values in Prize are 1000, 100, 20, 10, 4, 2, 1, 0.

The values in Probability are 0.00002, 0.00063, 0.00400, 0.00601, 0.02403, 0.08877, 0.10479, 0.77176.

R Tutorial says this about var()

> duration = faithful$eruptions # the eruption durations

> var(duration) # apply the var function

http://www.r-tutor.com/elementary-st...sures/variance

R Documentation says this:

var(x, y=NULL, na.rm=FALSE,use)

https://www.rdocumentation.org/packa...0-3/topics/var

Neither of those implementations of var() work for me. How do I find the variance of this probability distribution? Thank you. ]]>