Solution
= Solution
Write the stationary probabilities as $(\pi_1,\pi_2)$. The equation $\pi P=\pi$ reduces to $a\pi_1=b\pi_2$. Together with $\pi_1+\pi_2=1$, this gives
$$
\boxed{\pi=\left(\frac b{a+b},\frac a{a+b}\right).}
$$
The positive transition probabilities make the two states communicate, so the <stationary distribution> is unique.