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 = ( 3 - 3x/8 + x) litres
Quantity of syrup in new mixture = ( 5 - 5x/8 )litres
So ( 3 - 3x/8 + x ) = ( 5 - 5x/8 )
So 5x + 24 = 40 - 5x
10x = 16
x = 8/5 .
So, part of the mixture replaced = ( 8/5 x 1/8 ) = 1/5