Gnocchi is a kind of pasta made with flour, potatoes and eggs. They are cooked in boiling water and when they are ready to be eaten they float.
Why do they float when they are cooked?
I found two quite different answers on the web:
1) "The buoyancy is responsible for the water vapor generated from boiling water as it creates bubbles that stick to the gnocchi surface bringing them to the waterline." (first answer)
2) "when you cook or boil it, the water inside of the gnocchi will evaporate. As the water evaporate, the water will turn into air and the air will be trapped inside of the gnocchi. It is indicated by the size expansion of the gnocchi. Those trapped air will make the gnocchi relative lighter to the water which resulting it to float above the water."(second answer)