Suppose the vessel initially contains 8 litres of liquid.
Let x litres of this liquid be replaced with water.
Quantity of water in new mixture =
litres.
Quantity of syrup in new mixture =
litres.
=> 5x + 24 = 40 - 5x
=> 10x = 16 => x = 8/5
So, part of the mixture replaced =
= 1/5.