The real numbers $x, y$, and $z$ satisfy both of the equations below.

$$
\begin{array}{r}
x+y+z=2 \\
x y+y z+x z=0
\end{array}
$$

Let $a$ be the minimum possible value of $z$ and $b$ be the maximum possible value of $z$. What is the value of $b-a$ ?
Squaring both sides of the equation $x+y+z=2$ gives $x^{2}+y^{2}+z^{2}+2(x y+y z+z x)=4$. Substituting $x y+y z+z x=0$ into the above equation gives $x^{2}+y^{2}+z^{2}=4$.

From $x+y+z=2$, we get $x+y=2-z$, and from $x y+y z+x z=0$, we get $x y=-z(x+y)$. Substituting $x+y=2-z$ into $x y=-z(x+y)$, we get $x y=z(z-2)$.

Regardless of the values of $x$ and $y,(x-y)^{2} \geq 0$. Using this observation as well as $x^{2}+y^{2}+z^{2}=4$ and $x y=z(z-2)$, we get the following equivalent inequalities.

$$
\begin{aligned}
0 & \leq(x-y)^{2} \\
0 & \leq x^{2}-2 x y+y^{2} \\
2 x y & \leq x^{2}+y^{2} \\
2 x y+z^{2} & \leq x^{2}+y^{2}+z^{2} \\
2 z(z-2)+z^{2} & \leq 4 \\
3 z^{2}-4 z-4 & \leq 0 \\
(3 z+2)(z-2) & \leq 0
\end{aligned}
$$

If $z2$, then $3 z+2$ and $z-2$ are both positive, so their product is positive.

Therefore, in order for $(3 z+2)(z-2) \leq 0$, we need that $-\frac{2}{3} \leq z \leq 2$.

We have shown that $z$ is at least $-\frac{2}{3}$ and at most 2 , but to be sure these are the actual minimum and maximum possible values of $z$, we must show that there are solutions to the system of equations that have $z$ taking each of these two values.

If $z=2$, the equations become $x+y+2=2$ or $x+y=0$ and $x y+2 y+2 x=0$ which can be factored as $x y+2(x+y)=0$. Substituting $x+y=0$ gives $x y=0$, so $x=0$ or $y=0$.

Since $x+y=0$ and at least one of $x$ and $y$ is 0 , it must be the case that they are both 0 . This gives the solution $(x, y, z)=(0,0,2)$.

If $z=-\frac{2}{3}$, then the first equation gvies $x+y-\frac{2}{3}=2$ or $x+y=\frac{8}{3}$. The second equation gives $x y-\frac{2}{3}(x+y)=0$. Substituting $x+y=\frac{8}{3}$ into this equation and rearranging gives $x y=\frac{16}{9}$. Multiplying $x+y=\frac{8}{3}$ through by $x$ gives $x^{2}+x y=\frac{8}{3} x$, and after substituting $x y=\frac{16}{9}$ gives $x^{2}+\frac{16}{9}=\frac{8}{3} x$ which is equivalent to $9 x^{2}-24 x+16=0$.

Factoring, we get $(3 x-4)^{2}=0$ so $3 x=4$, which means $x=\frac{4}{3}$. Substituting this into $x+y=\frac{4}{3}$ and solving leads to $y=\frac{4}{3}$.

Therefore, $(x, y, z)=\left(\frac{4}{3}, \frac{4}{3},-\frac{2}{3}\right)$ is a soluton.

We have shown that in any solution, we must have $-\frac{2}{3} \leq z \leq 2$ and that there are solutions with $z=-\frac{2}{3}$ and $z=2$. Thus, $b=2$ and $a=-\frac{2}{3}$, so $b-a=2-\left(\frac{2}{3}\right)=\frac{8}{3}$.