Expectation of a cubic transformation of a Bernoulli random variable I was asked the following question: $X$ is a random variable which follows a Bernoulli distribution with parameter $p$ and take $Y=a+bX$. Compute $\mathbb{E}(Y^3)$.
 A: When it comes to computing expectations of discrete variables with a small number of possible values, I have often found it instructive to make a table of values and probabilities.  For instance, a table for the Bernoulli$(p)$ variable $X$ might look like
$$\begin{array}{r | c c | r}
  & X & \text{Probability} &X \times \text{Probability}\\
\hline
  & 0 & 1-p & 0 \\
  & 1 & p & p \\
 \hline \text{Total} & & 1 & \mathbb{E}[X]=p
\end{array}$$
The full information about the variable is contained in the two columns headed "$X$" (the values of $X$) and "Probability" (the chances of each value).  The rightmost column shows the calculation of the expectation: one finds the products of the values and the probabilities, then adds them up.
From this table you can easily compute a table for the random variables $Y = a+bX$ and $Y^3$.
$$\begin{array}{r | c c r r | r}
  & X & \text{Probability} & Y & Y^3 & Y^3 \times \text{Probability}\\
\hline
  & 0 & 1-p & a + b\times 0 = a & a^3 &? \\
  & 1 & p & a + b\times 1 = a + b & (a+b)^3 & ? \\
 \hline \text{Total} & & 1 & & & \mathbb{E}[Y^3]=?
\end{array}$$
I have left it to the interested reader to compute the missing values.
