Answer
a) After the rock is thrown forward, the speed of the wagon is $0.45m/s$.
b) After the rock is thrown backward, the speed of the wagon is $0.55m/s$.
Work Step by Step
At the start, the wagon, rider and the rock act as a system, whose mass $M=95kg$ and initial velocity $V_0=+0.5m/s$ (we take the system's direction of velocity to be positive).
a) In situation a, the person throws the rock forward, whose mass $m_r=0.3kg$, with velocity $v_r=+16m/s$. The person and wagon are left, whose mass $m_w=95-0.3=94.7kg$ and velocity $v_w$
We assume total momentum is conserved, so we can find $v_w$: $$MV_0=m_rv_r+m_wv_w$$ $$v_w=\frac{MV_0-m_rv_r}{m_w}=+0.45m/s$$
So the speed of the wagon is $0.45m/s$.
b) In situation b, the person throws the rock backward with velocity $v_r=-16m/s$. Again, we will find the velocity of the wagon $v_w$
We assume total momentum is conserved, so we can find $v_w$: $$MV_0=m_rv_r+m_wv_w$$ $$v_w=\frac{MV_0-m_rv_r}{m_w}=+0.55m/s$$
So the speed of the wagon is $0.55m/s$.