Nothing was added to the tap water. 12 Volts was used. There was no barrier in the electrolyte between the electrodes. The electrodes were coiled strips of magnesium metal. It was done in a plastic tub and the gas from the electrodes was collected in plastic bottles.
I am not interested in improving the apparatus. (It's not mine) I just want to know what happened. (I only saw a video of the experiment) The basic chemistry books that I can find never explain anything this complex. They use nonreactive electrodes and barriers or salt bridges and use known electrolytes. I need help figuring out what reactions occurred at the anode.
It seems to me that water would be reduced at the Cathode to produce hydrogen gas.Cathode
(-): 2 H₂O(l) + 2 e-
H₂(g) + 2 OH-
It seems to me that the metallic anode would go into solution as magnesium ions.Anode
Wouldn't the magnesium ions form insoluble magnesium hydroxide at the anode? Where did the gas come from that was produced at the anode?