Here if we consider bullet and gun as a system then we can say that momentum of the system will remain conserved
so we will have
[tex]m_1v_{1i} + m_2v_{2i} = m_1v_{1f} + m_2v_{2f}[/tex]
now we know that
[tex]m_1 = 50 g = 0.050 kg[/tex]
[tex]m_2 = 3 kg[/tex]
[tex]v_{1i} = v_{2i} = 0[/tex]
[tex]v_{1f} = 400 m/s[/tex]
now we will have
[tex]0.050(0) + 3(0) = 0.050(400) + 3(v)[/tex]
[tex]20 + 3v = 0[/tex]
[tex]v = - \frac{20}{3} = - 6.67 m/s[/tex]
so gun will recoil with speed 6.67 m/s