An object floats when its average density is less than or equal to the density of the liquid. Density is defined as the mass per unit volume of a substance. If an object's average density is less than that of the liquid, it will displace an equal amount of the liquid with a weight greater than its own weight, resulting in a net upward force that keeps the object afloat.
Mathematically, this concept can be expressed using Archimedes' principle, which states that the buoyant force on an object submerged in a fluid is equal to the weight of the fluid displaced by the object. In other words:
Buoyant force = Weight of displaced fluid
If the buoyant force is greater than the weight of the object, it will float. If the buoyant force is less than the weight of the object, it will sink. If the buoyant force is equal to the weight of the object, it will remain suspended in the liquid.
Therefore, an object will float in a liquid when its average density is less than or equal to the density of the liquid, ensuring that the buoyant force is sufficient to counteract the object's weight and keep it afloat.