According to the Law of Conservation of Linear Momentum, the total linear momentum must remain the same before and after the bullet is shoot.
In the beggining, both the gun and the bullet have a momentum equal to 0.
After the bullet is shoot, the linear momentum of the gun is equal to 5kg * V and the linear momentum of the bulltet is equal to 0.01kg*400m/s:
Since the final momentum should be the same as the initial momentum, then:
Solve for V:
Therefore, the recoil speed of the gun is 0.8 meters per second.