Solution (source code)

= Solution

The transmitted P wave travels in the <sandstone>. Conservation of the <seismic ray parameter> gives
$$
\sin t_P=\frac{2000}{2500}\sin20^\circ,\qquad \boxed{t_P=15.88^\circ}.
$$
It bends toward the vertical because its <seismic velocity> is smaller.