A solution contains 0.50M Nh3 and 1.50 M Nh4cl. What is the maximum concentration of mg2+ that can be present in such a solution without precipitating Mg(oh)2?

NH4Cl is a salt that ionizes completely; therefore, (NH4^+) = 1.50 M.

NH3 is a weak base that has a Kb.
...........NH3 + H2O ==> NH4^+ + OH^-
I.........0.50............0.......0
C..........-x.............x.......x
E.......0.50-x............x.......x

Kb = look it up = (NH4^+)(OH^-)/(NH3)
For NH4^+ use 1.5 + x (then x can be ignored)
(OH^-) = x (this x can't be ignored.
(NH3) = 0.5-x and this can be ignored.

Solve for OH^-, then
Ksp = (Mg^2+)(OH^-). Plug in (OH^-) from the previous equation and solve for (Mg^2+).