Step 1: Energy conservation.
The initial kinetic energy of the mass is converted into potential energy of the spring at maximum compression. The equation is:
\[
\frac{1}{2} m v^2 = \frac{1}{2} k x^2
\]
Step 2: Solving for \( x \).
Substituting the given values:
\[
\frac{1}{2} (0.5) (1.5)^2 = \frac{1}{2} (50) x^2
\]
Solving for \( x \), we get:
\[
x = 0.15 \, \text{m}
\]
Final Answer:
\[
\boxed{0.15 \, \text{m}}
\]