What causes an boiled egg to float?

A boiled egg floats because of changes in density. Here's how it works:

* Raw Egg: A raw egg has a dense yolk and a less dense white. The overall density of a raw egg is greater than water, causing it to sink.

* Boiling: When you boil an egg, the heat causes the proteins in the egg white to coagulate and solidify. This causes the white to expand and trap air pockets within the egg.

* Density Change: The air pockets introduced during boiling decrease the overall density of the egg. When the egg's density becomes less than the density of the water, it floats.

In simpler terms:

The air pockets inside the cooked egg make it lighter than the water, causing it to float.