Step 1: Use the formula for acceleration due to gravity.
Acceleration due to gravity on the surface of a planet is
\[
g=\frac{GM}{R^2}
\]
For the new planet,
\[
g'=\frac{GM'}{R'^2}
\]
Given,
\[
M'=8M
\]
Also, density of the new planet is
\[
\rho'=27\rho
\]
Step 2: Relate mass, density, and radius.
Density is given by
\[
\rho=\frac{M}{V}
\]
For a spherical planet,
\[
V=\frac{4}{3}\pi R^3
\]
So,
\[
\rho=\frac{M}{\frac{4}{3}\pi R^3}
\]
Hence,
\[
\rho \propto \frac{M}{R^3}
\]
For the new planet,
\[
\frac{\rho'}{\rho}
=
\frac{M'/R'^3}{M/R^3}
\]
Substituting the given ratios,
\[
27=
\frac{8M}{R'^3}\cdot \frac{R^3}{M}
\]
\[
27=8\frac{R^3}{R'^3}
\]
\[
\frac{R'^3}{R^3}=\frac{8}{27}
\]
Taking cube root,
\[
\frac{R'}{R}=\frac{2}{3}
\]
Thus,
\[
R'=\frac{2R}{3}
\]
Step 3: Find the ratio of accelerations due to gravity.
Now,
\[
\frac{g'}{g}
=
\frac{\frac{GM'}{R'^2}}{\frac{GM}{R^2}}
\]
\[
\frac{g'}{g}
=
\frac{M'}{M}\cdot \frac{R^2}{R'^2}
\]
Substituting,
\[
\frac{M'}{M}=8
\]
and
\[
\frac{R'}{R}=\frac{2}{3}
\]
So,
\[
\frac{R^2}{R'^2}
=
\left(\frac{R}{R'}\right)^2
=
\left(\frac{3}{2}\right)^2
=
\frac{9}{4}
\]
Therefore,
\[
\frac{g'}{g}=8\times \frac{9}{4}
\]
\[
\frac{g'}{g}=18
\]
Hence,
\[
g'=18g
\]
Step 4: Final conclusion.
Therefore,
\[
\boxed{g'=18g}
\]