Probability Minimization I'm having trouble starting this question:
You have two opponents with whom you alternate play. Whenever you play A, you win with probability $p_{A}$; whenever you play B, you win with probability $p_{B}$, where $p_{B}>p_{A}$. If your objective is to minimize the expected number of games you need to play to win two in a row, should you start with A or B?
Hint: Let E[$N_{i}$] denote the mean number of games needed if you initially play i. Derive an expression for E[$N_{A}$] that involves E[$N_{B}$]; write down the expression for E[$N_{B}$] and then subtract. 
How do I set up the expression for E[$N_{A}$]? I tried but ended up with a very long and complicated mess that I am lost in. 
Thanks in advance for any help.
 A: Hint
Let $m_i = \mathbb{E}[N_i]$, then note that if you start with $A$, 3 things are possible:


*

*you lost first round, in which case you are now starting as $B$, so your number of steps to destination is $1 + m_B$ -- this happens with probability $1-p_A$.

*you won first round and won the second round, so you took 2 steps -- this happens with probability $p_A p_B$

*you won first round and lost second round -- 2 wasted steps, restarting as A, so need $2+m_A$ steps, with probability $p_A (1-p_B)$.


In total you get
$$
m_A = (1-p_A)(1+m_B) + 2p_A p_B  + p_A(1-p_B)(2+m_A)
$$
Can you write one down for $m_B$ and solve the resulting system?
A: In this case $B$ is the weaker opponent. Now, using the hint:
If you condition; on winning and losing:
$$E[N_A] = E[N_A | w] p_A + E[N_A | l] (1 - p_A)$$
Now, it is important to derive better expressions for the expectations. One is that $E[N_A | l] = 1 + E[N_B]$. The other is more complicated, this problem requires one more conditional expectation:
$$
  \begin{array}{rcl}
    E[N_A|w] & = & E[N_A | w \cap l] (1 - p_B) + E[N_A | w \cap w] p_B\\
    & = & (2 + E[N_A])(1 - p_B) + 2p_B \\
  \end{array}
  $$
And therefore plugging into the previous equation for $E[N_A]$
$$
  \begin{array}{rcl}
    E[N_A] & = & ((2 + E[N_A])(1 - p_B) + 2p_B) p_A +  (1 - p_A) (1 + E[N_B]) \\
    & = & (2 - 2p_B + E[N_A] - p_BE[N_A] + 2p_B) p_A + (1 - p_A) E[N_B] + 1 -p_A \\
    & = & 2p_A - {2p_Ap_B} +  p_AE[N_A] -  p_Ap_BE[N_A] + {2 p_Ap_B} + (1 - p_A) E[N_B] + 1 - p_A \\
    & = & 1 + p_A + (p_A - p_Ap_B) E[N_A] + (1 - p_A) E[N_B]\\
  \end{array}
  $$
And by reflection we also get:
$$E[N_B] =1 + p_B + (p_B - p_Ap_B) E[N_B] + (1 - p_B) E[N_A]$$
So, 
$$
  \begin{array}{rcl}
    E[N_A] - E[N_B] & = & p_A + (p_A - p_Ap_B) E[N_A] + (1 - p_A) E[N_B] - p_B - (p_B - p_Ap_B) E[N_B] - 
    (1 - p_B) E[N_A]\\
    & = & p_A - p_B + (p_A - p_Ap_B - 1 + p_B) E[N_A] + (1 - p_A - p_B + p_Ap_B) E[N_B]  \\
    & = & p_A - p_B + (p_A - p_Ap_B - 1 + p_B) (E[N_A] - E[N_B]) \\
  \end{array}
  $$
And so: $$(- p_A + p_Ap_B + 2 - p_B) (E[N_A] - E[N_B])  = p_A - p_B$$
Since $p_A, p_B < 1$. We have that $p_A + p_B < 2$ and therefore the expression $(- p_A + p_Ap_B + 2 - p_B)$ is always positive.  Since $p_B > p_A$, then $E[N_A] - E[N_B] < 0$ and thus $E[N_A] < E[N_B]$. So it's better to play A first.
Which did not make sense to me at first. :)
