Answer
$30$ times.
Work Step by Step
$E(n)=-\frac{1}{90}n^2+\frac{2}{3}n$
In this case, we need to find $n$ so that $E(n)$ has the maximum value. Normally, we would use the formula $n=-b/2a$ to deal with the problem. We couldn't do this in this case, however, as the function has a restricted range; using the formula may make $E(n)$ fall out of our desired range.
Instead, we shall use the maximum value in the given range, which is $10$. Thus:
$\frac{-1}{90}n^2+\frac{2}{3}n=10$
$\frac{-1}{90}n^2+\frac{2}{3}n-10=0$
Using the Quadratic Formula:
$x=\frac{-2/3+\sqrt {4/9-4*(-1/90)*(-10)}}{-1/45}$ or $x=\frac{-2/3-\sqrt {4/9-4*(-1/90)*(-10)}}{-1/45}$
$x=45*\frac{2}{3}-45\sqrt 0$ or $x=45*\frac{2}{3}+45\sqrt 0$
$x=30$ ($x$ only has one value)
In conclusion, a viewer should view a commercial $30$ times to maximize its effectiveness.