Step 1: Start with the formula for potential energy in S.H.M.
The potential energy \( PE \) is given by:
\[
PE = \frac{1}{2} m \omega^2 x^2,
\]
where:
\( m \) is the mass of the particle,
\( \omega \) is the angular frequency,
\( x \) is the displacement.
From the question, the potential energy is given as:
\[
PE = 0.1 \pi^2 x^2.
\]
Equating:
\[
\frac{1}{2} m \omega^2 x^2 = 0.1 \pi^2 x^2.
\]
Cancel \( x^2 \) from both sides:
\[
\frac{1}{2} m \omega^2 = 0.1 \pi^2.
\]
Substitute \( m = 20 \, \mathrm{g} = 0.02 \, \mathrm{kg} \):
\[
\frac{1}{2} (0.02) \omega^2 = 0.1 \pi^2.
\]
Simplify:
\[
0.01 \omega^2 = 0.1 \pi^2.
\]
\[
\omega^2 = 10 \pi^2.
\]
Step 2: Solve for angular frequency and frequency.
Take the square root:
\[
\omega = \sqrt{10 \pi^2} = \pi \sqrt{10}.
\]
The frequency \( f \) is given by:
\[
f = \frac{\omega}{2 \pi}.
\]
Substitute \( \omega = \pi \sqrt{10} \):
\[
f = \frac{\pi \sqrt{10}}{2 \pi} = \frac{\sqrt{10}}{2}.
\]
Using \( \sqrt{10} \approx 3.162 \):
\[
f = \frac{3.162}{2} = 1.581 \, \mathrm{Hz}.
\]
Thus, the frequency of S.H.M is \( \mathbf{1.581 \, \mathrm{Hz}} \).