22. Toss a uniformly distributed coin, if the first toss is heads, then toss again: if the second toss is heads, record 0; if the second toss is tails, record 1. If the first toss is tails, record any random real number in the closed interval $[0,1]$. Using this method for two independent experiments, we get two real numbers $x$ and $y$, then the probability that $|x-y|>\frac{1}{2}$ is
(A) $\frac{1}{3}$
(B) $\frac{7}{16}$
(C) $\frac{1}{2}$
(D) $\frac{9}{16}$
(E) $\frac{2}{3}$
22. B.

Consider four cases.
(1) $x=0$ or $1, y=0$ or 1.

By $|x-y|>\frac{1}{2}$, then $x=0, y=1$ or $x=1$, $y=0$, the probability is $\frac{1}{2}$.
(2) $x=0$ or $1, y \in[0,1]$.
By $|x-y|>\frac{1}{2}$, then
$x=0$ when, $y \in\left(\frac{1}{2}, 1\right]$;
$x=1$ when, $y \in\left[0, \frac{1}{2}\right)$.
The probability is $\frac{1}{2}$.
(3) $x \in[0,1], y=0$ or 1.
Similarly, the probability is $\frac{1}{2}$.
(4) $x \in[0,1], y \in[0,1]$.
At this point, $\left\{\begin{array}{l}|x-y|>\frac{1}{2}, \\ 0 \leqslant x \leqslant 1, \\ 0 \leqslant y \leqslant 1 .\end{array}\right.$
By geometric probability, the probability is $\frac{1}{4}$.
In summary, $p=\frac{1}{4}\left(\frac{1}{2}+\frac{1}{2}+\frac{1}{2}+\frac{1}{4}\right)=\frac{7}{16}$.