Solution (source code)

= Solution

<Pairwise independent events> satisfy $\mathbb P(A_i\cap A_j)=\mathbb P(A_i)\mathbb P(A_j)$ for every distinct pair. <Independent events> satisfy
$$
\mathbb P\!\left(\bigcap_{i\in I}A_i\right)=\prod_{i\in I}\mathbb P(A_i)
$$
for every nonempty subset $I$ of the indices. For three events this includes the triple intersection, not just the three pairwise intersections.

Write $A_i=B_i\cup C$. Disjointness gives $\mathbb P(A_i)=p+q$, while every intersection of two or three distinct $A_i$ is exactly $C$. Thus <pairwise independence> is equivalent to $q=(p+q)^2$. Since $p+q\ge0$,
$$
\boxed{p=\sqrt q-q.}
$$
For $0\le q\le1/16$, this is an admissible nonnegative $p$: putting $u=\sqrt q\in[0,1/4]$ gives $3p+q=3u-2u^2\le5/8<1$. The four disjoint events can therefore have the stated probabilities, with the remaining probability assigned to their complement. This also covers $q=0$.

Full <independence> would additionally require $q=(p+q)^3$. Together with $q=(p+q)^2$, this forces $p+q$ to be zero or one. The first case gives $p=q=0$; the second gives $q=1,p=0$. Neither allows positive $p,q$. \b[There are no such mutually independent events with $p>0$ and $q>0$.]