Conditional entropy This is really annoying me: Two players A and B play a best-of-three squash match and the first player to win two games wins the match. A wins a game with probability $p$, B wins with probability $1-p$. Let $X$ be the number of games won by A, let $Y$ be the number of matches played. Show $H(Y|X=x)$ takes its maximum value when $p=\frac{1}{2}$ for all $x$.
I think that $$P(Y=2|X=0)=0$$ and $$P(Y=3|X=1)=1,$$ so $H(Y|X=0)=0$ and $H(Y|X=1)=0$. Then $$P(Y=2|X=2)=\frac{p^2}{p^2+p^2(1-p)}=\frac{1}{2-p}$$ and $$P(Y=3|X=2)=\frac{p^2(1-p)}{p^2+p^2(1-p)}=\frac{1-p}{2-p}$$and therefore $$H(Y|X=2)=\frac{log(2-p)}{2-p}-\frac{1-p}{2-p}log\left(\frac{1-p}{2-p}\right)$$$$=log(2-p) + \left(\frac{1}{2-p}-1\right)log(1-p).$$ Differentiating this gives $$\frac{log(1-p)}{(2-p)^2}$$ which is non-zero at $p=\frac{1}{2}$. Where have I gone wrong?

$\mathsf P(Y=2\mid X=0)$ is the probability that two games in a best out of three match were played, given that player A won no games.   It is in face certain that player B will have won two games in a row if Player A won none of the games in a best of three match.   Let's examine the possible outcomes and their probability measures.
$$\begin{array}{ccc| c c | l}
~ & ~ & ~ & X & Y & P(X=x, Y=y)
\\ \hline A & A & ~ & 2 & 2 & p^2
\\ A & B & A & 2 & 3 & p^2(1-p)
\\ A & B & B & 1 & 3 & p(1-p)^2
\\ B & A & A & 2 & 3 & p^2(1-p)
\\ B & A & B & 1 & 3 & p(1-p)^2
\\ B & B & ~ & 0 & 2 & (1-p)^2
\end{array}$$
Thus we have:
$$\begin{align}\mathsf P(Y=2 \mid X=0) & = 1
\\ \mathsf P(Y=3 \mid X=1) & = 1
\\ \mathsf P(Y=2 \mid X=2) & = \frac{1}{3-2p} \tag{$\bigstar$}
\\ \mathsf P(Y=3 \mid X=2) & = \frac{2-2p}{3-2p} 
\end{align}$$
