I am reading the answer to a Markov Chain question and don't understand the answer.
The question is: "In state $A$, there's a $30\%$ chance we will remain in state $A$ and a $70\%$ we will move to state $B$. Similarly, if we're in state $B$, there's a $70\%$ chance we will remain in state $B$ and a $30\%$ we will move to state $A$. If we are currently in state $A$, how long on average will it take until we reach state $A$ again?" Solution:
We have
$P_{A|A} = 0.3$
$P_{B|A} = 0.7$
$P_{B|B} = 0.7$
$P_{A|B} = 0.3$
The expected number of transitions from state $X$ to state $Y$ is $E_{X|Y}$:
$E_{A|A} = P_{A|A} * 1 + P_{B|A} * (E_{A|B}+1) \implies E_{A|A} = 0.3 + 0.7 * (E_{A|B} + 1)$
$E_{A|B} = P_{A|B} * 1 + P_{B|B} * (E_{A|B}+1) \implies E_{A|B} = 0.3 + 0.7 * (E_{A|B} + 1)$
Then solving for $E_{A|B}$ and substituting, it follows that the average moves to return to state $A$ is $3.33$.
Where do these formulas come from? When I tried solving this, the system of equations that I ended up with had no solution. Thank you.