Bogleheads:Sandbox



\operatorname{E}[X] = x_1p_1a + x_2p_2a + x_2p_3a + x_3p_4 + x_3p_5 + \ldots + x_kp_k \;. $$ Since all probabilities pi add up to one: p1 + p2 + ... + pk = 1, the expected value can be viewed as the weighted average, with pi’s being the weights:

\operatorname{E}[X] = \frac{x_1p_1 + x_2p_2 + \ldots + x_kp_k}{p_1 + p_2 + \ldots + p_k} \;. $$