= Solution
The spin commutators are
$$
[S_i,S_j]=i\hbar\varepsilon_{ijk}S_k,
\qquad [S^2,S_i]=0.
$$
Set
$$
r_i=\frac{2\langle S_i\rangle_\psi}{\hbar}.
$$
Purity gives $r_x^2+r_y^2+r_z^2=1$, so the supplied sign determines
$$
r_y=\operatorname{sgn}\langle S_y\rangle_\psi\,
\sqrt{1-r_x^2-r_z^2}.
$$
For $r_z\ne-1$, choose the overall phase so that the upper component is nonnegative. The normalized state is
$$
\boxed{
|\psi\rangle=
\sqrt{\frac{1+r_z}{2}}\,|+\rangle_z+
\frac{r_x+ir_y}{\sqrt{2(1+r_z)}}\,|-\rangle_z}.
$$
If $r_z=-1$, it is simply $|-\rangle_z$ up to phase.
Back to article page