For cavities inside a uniform sphere, use superposition:
\[
\text{Field of remaining body}
=
\text{Field of complete sphere}
-
\text{Field of removed parts}.
\]
Also, if the cavity radius is \(\frac{R}{2}\), then its mass is
\[
\frac{M}{8}
\]
because mass is proportional to volume.