Consider the following table representing the distribution of the discrete random variable x: $$\begin{array}{|c|c|c|c|c|}\hline X & -4 & 0 & 1 & 4 \\ \hline f(x)=P(X=x) & 0.1& 0.3 & 0.2 & 0.4 \\\hline\end{array}$$
Compute:
a) \begin{array}E(x)&=\sum_x xf(x)\\&=(-4\cdot 0.1)+0+(1\cdot 0.2)+(4\cdot0.4) \\ 
    &=-0.4+0.2+1.6 \\
    &=1.4 \end{array} 
b)\begin{align}E(X^2-X+1)&=\sum_x (x^2-x+1)f(x)\\&=((-4)^2-(-4)+1)\cdot0.1+(0^2-0+1)\cdot 0.3+(1^2-1+1)\cdot 0.2+(4^2-4+1)\cdot 0.4 \\ 
  \\&=2.1+0.3+0.2+5.2 
  \\&=7.8 \end{align}  
c) \begin{align}V(X)&=\sum x^2p-\mu^2\\&=(1.6+0+0.2+6.4)-(1.4)^2 
\\&=8.2-1.96  
\\&=6.24 \end{align}
d) \begin{align}\sigma_X&=\sqrt{\operatorname{Var}(X)}\\&=\sqrt{6.24}\\&=\frac{2\sqrt{39}}5\\&=2.497999199\end{align}
This is the work I did I was wondering if I did someone could reassure me or give me any tips if I did something wrong. Thanks in advance! P.S. Feel free to fix/adjust any symbols in the formating.

There is an error in part $c$, when you compute $\mathbb{E}[X^2]$.
$1.6+0+0.2+6.4=8.2 \neq 5$.
After obtaining $E(X^2)$ in part $c$, I will use it to check my answer in part $b$. Notice that $$E(X^2-X+1)=E(X^2)-E(X)+1$$
