For an event with $n$ possible outcomes, each outcome corresponds to an assigned value and a probability as shown in the following table.
$\begin{array}{|c|c|c|c|c|} \hline
\mbox{Outcome} & 1 & 2 & \ldots & n \\ \hline
\mbox{Corresponding value} & x_1 & x_2 & \ldots & x_n \\ \hline
\mbox{Corresponding probability} & p_1 & p_2 & \ldots & p_n \\ \hline
\end{array}$
\mbox{Outcome} & 1 & 2 & \ldots & n \\ \hline
\mbox{Corresponding value} & x_1 & x_2 & \ldots & x_n \\ \hline
\mbox{Corresponding probability} & p_1 & p_2 & \ldots & p_n \\ \hline
\end{array}$
\begin{eqnarray*}
\mbox{Expected value} & = & \sum_{i=1}^n x_ip_i \\
& = & x_1p_1+x_2p_2+\cdots +x_np_n
\end{eqnarray*}