How can I get this limits of the Expected value A,B are two coins with $\theta_{A} $ and $\theta_{B}$ possibility for head side after throwing up every time.$(0<\theta_{A},\theta_{B}<1)$. we choose a coin to throw randomly and change to the other coin when the former throw got a tail side. we follow this rule and throw the coins for n times. I have to get:
$$ \lim_{n->\infty}\frac{H(n)}{n}$$
which H(n) is the expected value of the times of head side.
I hope to divide the problem by define the times when we choose A and get a head side and tail side as unknown number to calculate the probability, and then to sum them up to get the H(n), but the outcome is too complex. I choose to assumpt that $n = \infty$, and use the expected value of the sustain time of each coin(the times a coin can persist before being changed to the other coin) to construct a expected ratio of A,B's times. and minus 1 to get the ratio of A,B's head times ratio. I finally get:
$$H(n)=\frac{n\theta_{A}\theta_{B}}{2-\theta_{A}-\theta_{B}}(\frac{1}{1-\theta_{A}}+\frac{1}{1-\theta_{B}})$$
I don`t know whether it is right or wrong(i think it might be wrong), if its wrong, how can I solve the question? if it is happended to be right, how can I explain this more reasonalbe? thank you very much!
 A: Let $P_n(A)$ be the probability that the nth flip is using coin A, and $P_n(B)$ be the probability that it is using coin B. Then in the limit $P_n(A)=P_{n-1}(A)=P(A)$.
$P_n(A)$ can be expressed as
$$P_n(A)=\theta_A*P_{n-1}(A)+(1-\theta_B)*P_{n-1}(B)$$
The coin used for the Nth flip is either A or B, so
$$P_k(B)=1-P_k(A)$$
In the limiting case, we can treat these probabilities (the case where $\theta_A=\theta_B=0$ shows that this isn't always true; the math works out to get the right answer anyways, but this definitely isn't a rigorous proof) as
$$P_n(X)=P_{n-1}(X)=P(X)$$
Therefore, we can write
$$P(A)=\theta_AP(A)+(1-\theta_B)(1-P(A))$$
Rearranging yields
$$P(A)(1-\theta_A+1-\theta_B)=(1-\theta_B)$$
$$P(A)=(1-\theta_B)/(2-\theta_A-\theta_B)$$
And similarly
$$P(B)=(1-\theta_A)/(2-\theta_A-\theta_B)$$
In the limiting case, the proportion of heads goes to the probability that a given flip is heads, so
$$H(n)/n=H_n=\theta_AP(A)+\theta_BP(B)=(\theta_A(1-\theta_B)+\theta_B(1-\theta_A))/(2-\theta_A-\theta_B)=(\theta_A+\theta_B-2\theta_A\theta_B)/(2-\theta_A-\theta_B)$$
