why does an air bubble rise to the surface of a glass of water

And your answer is?

It has less density

That's right. The lower density material USUALLY (but there are exceptions) floats on the higher density material. Exceptions are boats and such where the construction is designed to make more dense objects float by displacing a large volume of water.

thanks

it has less density

An air bubble rises to the surface of a glass of water due to the phenomenon of buoyancy. Buoyancy is the upward force exerted on an object immersed in a fluid (in this case, water), which opposes the force of gravity pulling it downward.

When an air bubble is trapped beneath the water's surface, it experiences buoyant force due to the difference in density between air and water. The density of air is much lower than that of water; hence, the air bubble is less dense than the surrounding water.

According to Archimedes' principle, any object submerged in a fluid experiences a buoyant force equal to the weight of the fluid it displaces. In this case, the air bubble displaces an equivalent volume of water. Since the buoyant force exerted on the air bubble is greater than the force of gravity acting on it, it rises towards the surface.

To understand this further, you can perform a simple experiment. Take a transparent glass, fill it with water, and carefully introduce an air bubble by blowing through a straw or pouring in carbonated water. Observe how the air bubble initially moves upward and gradually reaches the water's surface.

In summary, an air bubble rises to the surface of a glass of water because it is less dense than the water and experiences an upward buoyant force that exceeds the downward force of gravity.