Solution (source code)

= Solution

Exchanging the first and third inputs, together with the corresponding outputs, leaves the channel unchanged. <Concavity> therefore shows that averaging an input distribution with its exchanged distribution cannot reduce <mutual information>. We may take input probabilities $(a,1-2a,a)$.

For $p<1$, put $b=1-p$ and $t=2ab$, so $0\le t\le b$. The output distribution is $(t/2,1-t,t/2)$ and the mean conditional output <Shannon entropy> is $2ah(p)=t h(p)/b$. Hence
$$
I=h(t)+t\left(1-\frac{h(p)}b\right).
$$
Its <strict concavity> gives the unique stationary value $t_*=[1+2^{h(p)/b-1}]^{-1}$. This lies in the allowed interval: for $0<p<1$, the derivative at $t=b$ is $(\log_2p+b)/b<0$, while it tends to positive infinity at zero. At $p=0$ the stationary value is $2/3<1$ directly. Consequently an achieving input distribution is
$$
\boxed{(a,1-2a,a),\qquad a=\frac1{(1-p)(2+2^{h(p)/(1-p)})}}.
$$
The resulting capacity is $C=\log_2(1+2^{1-h(p)/(1-p)})$. In particular at $p=1/2$, $a=1/3$ and
$$
\boxed{C=\log_2(3/2)}.
$$
At $p=1$ all outputs are the middle symbol, so $C=0$ and every input distribution achieves it; the divided formula is not used at that endpoint.

\Image[/past-exam-of-the-communication-theory-course-of-the-university-of-oxford/2007-channel-capacity.png]
{title=The maximizing input and capacity as noise varies}
{description=The two outer input probabilities coincide by symmetry. The formulas apply below p equal to one; at complete collapse every input distribution attains zero capacity.}