The statistics of ternary complex formation. Inclusion of ligand protonation