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.