Expected Value - Maximum net profit I am uncertain about how to calculate the max net profit? Would $X = 0.05n$ ? 
A manufacturer of car radios ships them to retailers in cartons of n radios. The profit per radio is $59.50,$ less shipping cost of $25$ per carton, so the profit is $ (59.5n - 25)$ per carton. To
promote sales by assuring high quality, the manufacturer promises to pay the retailer $200X^2$ if
$X$ radios in the carton are defective. (The retailer is then responsible for repairing any defective
radios.) Suppose radios are produced independently and that $5\%$ of radios are defective. How
many radios should be packed per carton to maximize expected net profit per carton?
 A: The profit for a carton will be $$ P = 59.5n-25 - 200X^2$$ where $X$ is the number of defective radios in the carton, so the expected profit is $$ E(P) = 59.5n-25 - 200 E(X^2).$$
So we need to compute $E(X^2).$ This will not simply be the same thing as plugging in $.05n$ for $X.$ We have $.05n = E(X),$ but, generally $E(X^2) > E(X)^2.$
So you must know the distribution of $X.$ It happens that for independent trials of this sort, $X$ will be binomially distributed with $p=0.05.$ From here, you can look up (or derive) the mean $E(X)$ and variance $\mathrm{Var}(X)$ of the binomial distribution and compute $E(X^2) = \mathrm{Var}(X)+ E(X)^2.$ This will be a function of $n$ that you can plug into your original equation and then maximize.
To check your answer, the equation I get is $$ E(P) = 50n-25 - 0.5n^2$$
A: To solve this problem, we must take into account that the number of defective radios for a single carton follows a binomial distribution with probability $p=0.05$. For a binomial distribution of a variable $X $ the expected value $E (X)$ is given by $np $, while the variance is given by $np (1-p) \,$. In this case, we have $$E (X) = 0.05 n \,\,$$ and $$Var (X)=0.05 \cdot 0.95 \, n=0.0475 n \,\,$$   Since
$$E (X^2)^2=E (X)^2+ Var (X)$$
we have  
$$E (X^2)^2=(0.05 n)^2 +0.0475 n$$
so that the expected net profit per carton is $$59.5 n -25 - 200    [(0.05 n)^2 +0.0475 n]    $$
which simplifying gives
$$-0.5 n^2 +50 n -25$$
Taking the derivative of this and setting it equal to zero we have $-n+50=0\,\,\,$, giving the searched result of 
$$n=50$$
A: You want to find the count of radios per carton, $n$ that will maximise the expectation of the profit minus insurance, $\mathsf E(59.5n-25-200X^2)$, when the defective radios have some distribution depending on the count of radios per carton.  
So what is this distribution ?   That shall tell you $\mathsf E(X)$ and $\mathsf {Var}(X)$ from which you can evaluate $\mathsf E(X^2)$ as a function of $n$ and in turn $\mathsf E(56.5n-25-200\,X^2)$.
Then it is just a matter of determining the value of $n$ which maximises that expectation.
