Expected value

In probability theory and statistics, the expected value of a random variable formula_1 (represented by the symbol formula_2) is the average value the variable will take, that is, assuming that the experiment is repeated an infinite number of times, and the mean (or weighted average) of all the values is calculated along the way. 
By definition, the expected value of a discrete random variable formula_1 is calculated by the formula formula_4, where formula_5 is the probability that formula_6 equals formula_7, and formula_7 ranges over all possible values of formula_1.
The Law of large numbers describes how this happens.
Relationship to weighted average.
It is possible to think of the expected value as a weighted average, where the weights, formula_10 are equal to formula_11. The sum over all probabilities,formula_12 equals one (). This allows us to write the weighted average as:
formula_13