Tom: you can use the supscript (sup) and subscript(sub) button fyi.
Usually, the salt with the lower solubility product constant will precipitate preferentially.
Ba2+(aq) + CO32-(aq) <-> BaCO3(s)
Mg2+(aq) + CO32-(aq) <-> MgCO3(s)
when [ CO32- ] = 0.001,
Ionic Product for MgCO3
= (1.0X10^-3)(0.001)
= 1.0X10^-6 (< Ksp)
Ionic Product for BaCO3
= (1.0X10^-3)(0.001)
= 1.0X10^-6 (< Ksp)
Since in both cases, the respective ionic products are less than their respective Ksp, precipitation of neither carbonate occurs.