Winning an unfair game. I read the solution but I don't understand how the author came up with 2 inequalities and why he said P(2n) = P(2n+2) 
A game consists of a sequence of plays; on each play either you or your opponent scores a point, you with probability p (less than 1/2), your opponent with probability 1-p.  The number of plays is to be even - 2 or 4 or 6 and so on. To win the game you must get more than half the points.  You know p, say 0.45, and you get a prize if you win.  You get to choose in advance the number of plays.  How many do you choose?

I read the solution but I don't understand how the author came up with 2 inequalities and why he said P(2n) = P(2n+2) if those two possibilities do not happen.
Could you anyone give me some explanation or another ways to solve this question? Thank you so much.

 A: What is says is "Unless Player A has won either $n$ or $n+1$ times in the $2n$ game, his status as a winner of a loser cannot differ in the $2n+2$ game from that in the $2n$ game."  If player A has won fewer than $n$ of the first $2n$ games, he cannot win in the $2n+2$ game even if he wins both the remaining games.  Similarly, if he has won $n+2$ of the first $2n$ games, he cannot lose.
So, what he is doing is figuring out what events can change A from a winner to a loser (or vice versa), as the result of these two games. In all other cases, the result is the same in the $2n$ and $2n+2$ games, so these two terms account for the difference between $P(2n)$ and $P(2n+2).$
Now he says, suppose $2n$ is the optimum value.  Then it must be beneficial (to A) to switch from $2n-2$ to $2n$ and it must be prejudicial to switch from $2n$ to $2n+2$.  These two observations presumably give the two inequalities. I haven't verified them; that's up to you.  
A: See Ryan's answer to see how we arrived at the two inequalities. 
We start by evaluating
$$q^2 {2n-2 \choose n}p^n q^{n-2} \leq p^2 {2n-2 \choose n-1}p^{n-1} q^{n-1}$$
where $p=.45$ and $q=.55$.
$$\begin{align*}
.55^2 \frac{(2n-2)!}{n!(n-2)!} .45^n .55^{n-2} \leq .45^2 \frac{(2n-2)!}{(n-1)!(n-1)!}.45^{n-1} .55^{n-1}
&\iff .45^n .55^n (n-1) \leq .45^{n+1} .55^{n-1} n \\\\
&\iff .55(n-1) \leq .45n \\\\
&\iff 0.1n-0.55 \leq 0\\\\
&\Rightarrow n\leq 5.5
\end{align*}$$
Next we evaluate 
$$q^2 {2n \choose n+1}p^{n+1} q^{n-1} \geq p^2 {2n \choose n}p^{n} q^{n}$$
where $p=.45$ and $q=.55$.
$$\begin{align*}
.55^2 \frac{2n!}{(n+1)!(n-1)!} .45^{n+1} .55^{n-1} \geq .45^2 \frac{(2n)!}{n!n!}.45^{n} .55^{n}
&\iff .45^{n+1} .55^{n+1} n \geq .45^{n+2} .55^{n} (n+1) \\\\
&\iff .55n \geq .45(n+1) \\\\
&\iff 0.1n-0.45 \geq 0\\\\
&\Rightarrow n\geq 4.5
\end{align*}$$
Since $n\geq 4.5$ and $n\leq 5.5$ then $n=5$ and so $N=2n=10$
Check:
In R statistical software, I have calculated the probabilities of winning for trials going from $2$ to $100$ using the following program:
n=seq(2,100,by=2)
p.win = pbinom(n,n,.45)-pbinom(n/2,n,.45)
plot(n,p.win,xlab="Number of Plays",ylab="Probability of Winning")
abline(v=10,col="green2")


It looks like it peaks at $n=10$
A: We have that:
\begin{equation}
P_{2n} = \sum_{x=n+1}^{2n} \binom{2n}{x}p^xq^{2n-x}
\end{equation}
Because the number of times you win is binomial distribution. This is the probability that you win more than $n$ games out of $2n$ games. Similarly:
\begin{equation}
P_{2n+2} = \sum_{x=n+2}^{2n+2} \binom{2n+2}{x}p^xq^{2n+2-x}
\end{equation}
Which is the probability of winning at more than $n+1$ games out of $2n+2$ games. 
The main idea behind the proof is that $P_{2n+2}$ has a specific relationship with $P_{2n}$, in that, there are two possible events that can occur in the $2n$ game which can have different outcomes in the $2n+2$ game.
The first is that you win $n$ out of $2n$, then win $n+2$ out of $2n+2$. In this setting the event $\{\textrm{Win $n$ out of $2n$ then win the next 2}\}$ occurs with probability $p^2 \binom{2n}{n}p^nq^n$, increasing your probability of $P_{2n+2}$ from $P_{2n}$ by that amount.
The second is that you win $n+1$ out of $2n$, then lose the next two and win $n+1$ out of $2n+2$. In this setting the event $\{\textrm{Win $n+1$ out of $2n$ and lose the next 2}\}$ occurs with probability $q^2 \binom{2n}{n+1}p^{n+1}q^{n-1}$, decreasing your probability of $P_{2n+2}$ from $P_{2n}$ by that amount.
This gives us that
\begin{equation}
P_{2n+2}= P_{2n} + p^2 \binom{2n}{n}p^nq^n - q^2 \binom{2n}{n+1}p^{n+1}q^{n-1}
\end{equation}
Plugging this into the equality for $P_{2n} \geq P_{2n+2}$ gives us:
\begin{equation}
\begin{split}
P_{2n+2} & \leq P_{2n}\\
P_{2n} + p^2 \binom{2n}{n}p^nq^n - q^2 \binom{2n}{n+1}p^{n+1}q^{n-1} & \leq P_{2n}\\
p^2 \binom{2n}{n}p^nq^n & \leq q^2 \binom{2n}{n+1}p^{n+1}q^{n-1}\\
\end{split}
\end{equation}
The same thing can be done for the inequality $P_{2n} \geq P_{2n-2}$ by thinking of $2n$ as $2n-2+2$, which gives us the inequality:
\begin{equation}
\begin{split}
p^2 \binom{2n-2}{n-2}p^{n-1}q^{n-1} & \geq q^2 \binom{2n-2}{n}p^{n}q^{n-2}\\
\end{split}
\end{equation}
