If the random variable $X$ is binomially distributed with parameters $n=6$ and $p=0.3$, what is $$E(4+3X^2)$$
I know $E(X) = np = 1.8$. I solved this problem by finding $P(X)$ of all $X$ using $(^6_x)(0.3)^x(0.7)^{6-x}$ and then apply them with $4+3X^2$ to solve for $E(4+3X^2)$. But this takes too long and I think there should be a formula or another way to solve this.
Can anyone tell help me out with this? Thank you in advance!
Since $X$ is binomial you also know that $Var(X)=np(1-p)$. So, use that (this holds in general) $$Var(X)=E[X^2]-E[X]^2\implies E[X^2]=Var(X)+E[X]^2$$ and linearity of expectation to obtain that
\begin{align}E[4+3X^2]&=E[4]+E[3X^2]=4+3E[X^2]=4+3(Var(X)+E[X]^2)\\[0.2cm]&=4+3(np(1-p)+(np)^2)\end{align}