Strange as it may seem, the statement in the question appears to be <em>TRUE</em>.
-- Before the shot, neither the cannon nor the ball is moving, so their combined momentum is zero.
-- Since momentum is conserved, we know immediately that their combined momentum AFTER the shot also has to be zero.
-- (20g is rather puny for a "cannonball" ... about the same weight as four nickels. But we'll take your word for it and just do the Math and the Physics.)
-- Momentum = (mass) x (velocity)
After the shot, the momentum of the cannonball is
(0.02 kg) x (100 m/s ==> that way)
Momentum of the ball = 2 kg-m/s ==> that way.
-- In order for both of them to add up to zero, the momentum of the cannon must be (2 kg-m/s this way <==) .
Momentum of cannon = (5 kg) x (V m/s this way <==)
2 kg-m/s this way <== = (5 kg) x (V m/s this way <==)
Divide each side by (5 kg):
V m/s = (2/5) m/s this way <==
Speed of recoil of the cannon = <em>-- 0.4 m/s</em>