The indicator. Red cabbage juice contains anthocyanins, pigments that change colour with the hydrogen-ion concentration. They are red in strong acid, purple around pH 5 to 7, blue near pH 8, green around pH 10 to 11 and yellow in strong base (pH 12 and up). The colours in this lab are approximate; real shades depend on the cabbage and the juice strength.
pH. pH = -log10[H+]. Each step of 1 means 10 times more or less H+. Pure water is pH 7.
[H+] + [Na+] = [OH-] + [Cl-] + ฮฃ(charge of each acid's anion)
How the lab computes pH. It keeps the amount (in millimoles) of every ingredient in each glass, divides by the volume, and solves the charge balance above by bisection. Acids are weak and partly split up: acetic acid (vinegar) pKa 4.76; citric acid (lemon) three steps pKa 3.13, 4.76, 6.40; carbonate (baking soda, washing soda) pKa 6.35 and 10.33. Each household liquid is a fixed recipe: lemon juice 0.3 mol/L citric acid, vinegar 0.83 mol/L acetic acid (about 5%), baking soda water 0.3 mol/L, washing soda water 0.5 mol/L, soapy water a very weak carbonate solution.
Neutralising. An acid and a base react: H+ + OH- becomes water. Baking soda takes H+ from lemon juice and makes CO2 gas (the fizz). It takes about as many moles of baking soda as there are acid H+ to neutralise, which the experiment compares with the model.
Independent checks (closed-form formulas against the bisection solver):
Honest simplifications. Ideal solutions (no activity corrections); the cabbage juice itself is treated as water at pH 7 and does not buffer; temperature 25 C; CO2 stays dissolved instead of escaping, so the model's pH after neutralising with baking soda stays a little lower than a real fizzing glass; real lemon juice and vinegar vary from bottle to bottle; soapy water is a loose model (real soaps are about pH 9 to 10); the pour is always 10 mL; liquid sizes and the glass are not to scale. Real colour needs the strong base of drain cleaners to turn yellow, which is not safe, so the lab uses washing soda, a milder one that still needs a grown-up.