The probability that the party $2$ will be in power after the next two elections,given that the party $1$ is in power,is

There are three main political parties namely $1,2,3$.If $p_{ij}$denote the probability that the party $j$ wins the general elections contested when party $i$ is in the power.The probability that the party $2$ will be in power after the next two elections,given that the party $1$ is in power,is
$(A)0.27\hspace{1cm}(B)0.24\hspace{1cm}(C)0.14\hspace{1cm}(D)0.06$

$p_{11}=0.7,p_{12}=0.2,p_{13}=0.1,p_{21}=0.5,p_{22}=0.3,p_{23}=0.2,p_{31}=0.3,p_{32}=0.4,p_{33}=0.3$

I suspect,Bayes should be applied here.But since this is asking probability after next two elections,i am confused how to handle this question.Please help me.

If we assume that the chance winning the actual election depend only on the actual party in power and not on the previous results of elections then we are talking about a Markov chain with the following state transition matrix:

$$\mathbb P=\begin{bmatrix} p_{11}&p_{12}&p_{13}\\ p_{21}&p_{22}&p_{23}\\ p_{31}&p_{32}&p_{33} \end{bmatrix} =\begin{bmatrix} 0.7&0.2&0.1\\ 0.5&0.3&0.2\\ 0.3&0.4&0.3 \end{bmatrix}.$$

Here $$p_{ij}=P(\text{ party } j \text{ wins } \mid \text{ party } i \text{ in power}).$$

If we don't assume this independence from the past then the problem cannot be solved based on the data given.

The state transition probabilities considering two elections is $\mathbb P^2$.

$$\mathbb P^2 =\begin{bmatrix} 0.7&0.2&0.1\\ 0.5&0.3&0.2\\ 0.3&0.4&0.3 \end{bmatrix}^2 = \begin{bmatrix} 0.62&\color{red}{0.24}&0.14\\ 0.56&0.27&0.17\\ 0.5&0.3&0.2 \end{bmatrix} .$$

The second element of the first row ($0.24$ / answer B) tells the probability that party $2$ will be in power after the second election from now assuming that party $1$ is in power today.

Elementary solution

Let $P_0^i, P_1^i, P_2^i$ denote that party $i$ is in power today, after the next election, and after the second election from now, respectively.

The question is the value of the following conditional probability:

$$P(P_2^2\mid P_0^1)=\frac{P(P_2^2\cap P_0^1)}{P(P_0^1)} \tag 1.$$

Obviously

$$P(P_2^2\cap P_0^1)=P(P_2^2\cap P_1^1\cap P_0^1)+P(P_2^2\cap P_1^2\cap P_0^1)+P(P_2^2\cap P_1^3\cap P_0^1)=$$

$$P(P_2^2\mid P_1^1\cap P_0^1)P(P_1^1\cap P_0^1)+P(P_2^2\mid P_1^2\cap P_0^1)P(P_1^2\cap P_0^1)+P(P_2^2\mid P_1^3\cap P_0^1)P(P_1^3\cap P_0^1)=$$

$$=P(P_2^2\mid P_1^1)P(P_1^1\cap P_0^1)+P(P_2^2\mid P_1^2)P(P_1^2\cap P_0^1)+P(P_2^2\mid P_1^3)P(P_1^3\cap P_0^1)=$$

$$=P(P_2^2\mid P_1^1)P(P_1^1\mid P_0^1)P(P_0^1)+P(P_2^2\mid P_1^2)P(P_1^1\mid P_0^1)P(P_0^1)+P(P_2^2\mid P_1^3)P(P_1^3\mid P_0^1)P(P_0^1).$$

We used the fact the the result of the election depends only on the current government (and perhaps on the abilities of the competing parties).

$P(P_0^1)$ cancels out in $(1)$, so we have now

$$P(P_2^2\mid P_0^1)=$$ $$=P(P_2^2\mid P_1^1)P(P_1^1\mid P_0^1)+P(P_2^2\mid P_1^2)P(P_1^1\mid P_0^1)+P(P_2^2\mid P_1^3)P(P_1^3\mid P_0^1)=$$ $$=p_{12}p_{11}+p_{22}p_{12}+p_{32}p_{13}=$$ $$=0.2\cdot0.7+0.3\cdot0.2+0.4\cdot0.1=\color{red}{0.24}.$$