I'm studying information theory right now and I'm reading about channel capacities. 


I know that there are known expressions for computing the capacities for some well known simple channels such as BSC, the Z channel. 


Could you show me or point me to the source showing how to derive the channel capacity for a binary asymmetric channel? Say that $X$ is input $Y$ is output. $\Pr(x = 0 | y = 1) = p\_1$, $\Pr(x = 1 | y = 0) = p\_2$.


Further, I'm wondering is there any known result for computing the capacity of an arbitrary non-symmetric channel? By arbitrary non-symmetric channel, I mean, X and Y are from the alphabet set {${0, 1, \cdots, q-1}$}, and $\Pr(x = i \mid y = j) = p\_{i, j}$ for $i, j \in$ {$0, 1, ..., q-1$}.



Computing channel capacities for non-symmetric channels
A quick google search for "capacity of binary asymmetric channel" gives a few papers stating a closed form solution (for example [this paper of Stefan Moser](http://moser.cm.nctu.edu.tw/docs/papers/smos-2012-4.pdf)). I've never personally seen a derivation of this, so following on from Dinesh's very nice answer we can attempt to find the capacity exactly using calculus.


The binary entropy function is
$$h(x)=-x\log\_2(x)-(1-x)\log\_2(1-x)$$
which we can check has derivative
$$h'(x)=\log\_2\left(\frac{1}{x}-1\right).$$


So if we use $x$ for $\alpha$, our task is to find the $x$ that maximizes
$$I(x)=h(x(1-p\_1)+(1-x)p\_2)-xh(p\_1)-(1-x)h(p\_2).$$
We rewrite this function as
$$I(x)=h(x(1-p\_1-p\_2)+p\_2)-x(h(p\_1)-h(p\_2))-h(p\_2)$$
and take the derivative to get
$$I'(x)=(1-p\_1-p\_2)\log\_2\left(\frac{1}{x(1-p\_1-p\_2)+p\_2}-1\right)-(h(p\_1)-h(p\_2)).$$
Solving $I'(x)=0$ gives
$$\frac{1}{x(1-p\_1-p\_2)+p\_2}-1=2^{\frac{h(p\_1)-h(p\_2)}{1-p\_1-p\_2}}$$
and thus
$$x=\frac{1}{1-p\_1-p\_2}\left(\frac{1}{2^{\frac{h(p\_1)-h(p\_2)}{1-p\_1-p\_2}}+1}-p\_2\right).$$
Write
$$z=2^{\frac{h(p\_1)-h(p\_2)}{1-p\_1-p\_2}}$$
and then we can simplify this to
$$x=\frac{1-p\_2(1+z)}{(1-p\_1-p\_2)(1+z)}.$$
So the capacity of the binary asymmetric channel is
$$C=h\left(\frac{1-p\_2(1+z)}{1+z}+p\_2\right)-\frac{1-p\_2(1+z)}{(1-p\_1-p\_2)(1+z)}(h(p\_1)-h(p\_2))-h(p\_2)$$
which using the definition of $z$ we can write as
$$C=h\left(\frac{1}{1+z}\right)-\frac{\log\_2(z)}{1+z}+p\_2\log\_2(z)-h(p\_2).$$
Now from the definition of $h$ and some log laws we have
$$h\left(\frac{1}{1+z}\right)=\log\_2(1+z)-\frac{z\log\_2(z)}{z+1}$$
and so
$$C=\log\_2(1+z)-\log\_2(z)+p\_2\log\_2(z)-h(p\_2)$$
which we can rewrite as
$$C=\log\_2(1+z)-\frac{1-p\_2}{1-p\_1-p\_2}(h(p\_1)-h(p\_2))-h(p\_2)$$
and final simplifications give
$$C=\log\_2(1+z)-\frac{1-p\_2}{1-p\_1-p\_2}h(p\_1)+\frac{p\_1}{1-p\_1-p\_2}h(p\_2).$$


