text: The carbon dioxide coming out of solution formed bubbles on the gum in tiny little pits that act as nucleation sites for the bubbles to grow.  When there are enough bubbles on the gum and it becomes very buoyant, it floats.  At the top of the glass, the bubbles pop and the gum then sinks and the cycle can repeat.