A bullet of mass m leaves a gun of mass M kept on a smooth horizontal surface. If speed of the bullet relative to the gun is v, then recoil speed of the gun will be:
mM+mv
No external force acts on the system (gun + bullet) during the impact (till the bullet leaves the gun). Therefore the momentum of the system remains constant. Before the impact the system (gun + bullet) was at rest. Hence its initial momentum is zero. Therefore just after the impact, its momentum of the system (gun + bullet) will be zero.
⇒ m→vb+M→vg=0 ⇒m[→vbg+→vg]+M→vg=0
⇒ →vg=−m→vbgM+m, where |→vbg| = Velocity of bullet relative gun = v
⇒ Vg=mvM+m Opposite to the direction of v