*Answer:* Conservation of momentum implies that the net horizontal momentum
of the system is the same before and after the cannon is fired. The momentum before
the cannon is fired is zero, since nothing is initially moving. Hence, we can also set the momentum after
the cannon is fired to zero, giving

where is the recoil velocity of the carriage. It follows that

The minus sign indicates that the recoil velocity of the carriage is in the opposite direction to the direction of motion of the cannonball. Hence, the recoil

Suppose that, after the cannonball strikes the far wall of the carriage, both
the cannonball and the carriage move with common velocity . Conservation
of momentum implies that the net horizontal momentum of the system is the same
before and after the collision. Hence, we can write

However, we have already seen that . It follows that : in other words, the carriage is brought to a complete halt when the cannonball strikes its far wall.

In the frame of reference of the carriage, the cannonball moves with velocity
after the cannon is fired. Hence, the time of flight of the cannonball is

The distance moved by the carriage in this time interval is

Thus, the carriage moves in the opposite direction to the direction of motion of the cannonball.