The rectangular piece of wood measures 40 cm by 6 cm by 8cm and having a mass of 20 g is of density 0.010416666.... and it will float in water.
The density of water: 1 g/cm3
The density of piece of wood: m/v, where m is the mass of the wood and v is the volume.
v=40x6x8=1920
m=20g
density=20/1920=0.010416666....
Now, we know that If an object is more dense than water it will sink when placed in water, and if it is less dense than water it will float.
So, the wood will float as it's density is less than that of the water.