The random variable X has mass function
$$p(x) = \begin{cases} 1/2 &:& x = 0\\ 1/3 &:& x = 2\\ 1/6 &:& x = 3\end{cases}$$
$E(g(X))$ where $g(x) = x^2 + 2x + 1$
My answer includes the following
I change
x = 0 into 1 since using the formula above I have 0^2 + 2(0) + 1
x = 2 into 9 since 2^2 + 2(2) + 1
x = 3 into 16 since 3^3 + 2(3) + 1
Then to find the expected mean from the mass function, I use this formula $$E(X) = ยต_X = \sum_x x\, P(X = x)$$
$1 * (1/2) + 9 * (1/3) + 16 * (1/6)$
Got it wrong, what is the correct solution and answer