Markov chain - ergodic theorem I need help with transition matrix of the following problem
On each evening, the owner of a car washes it with probability 0.6. Independently of that event, every night a dirty rain pours on the car with probability 0.2.  (the question uses ergodic theorem)
In the long run, on which fraction of the mornings is the car clean?

my state 1 represents "car is clean" and state 2 represents "car is dirty"
I am not sure if my transition matrix is correct
 A: Limiting distribution of an ergodic Markov chain with finitely many states.
First thing to check is that this matrix $\mathbf{P}$ is a stochastic matrix with rows summing to $1,$ which is true.
Because the transition matrix has all positive elements, it describes
an (aperiodic) ergodic Markov chain with a single class of intercommunicating states. [To ensure ergodicity, it is enough for some power $\mathbf{P}^k$ of $\mathbf{P}$ to have all positive elements; here it happens that $k = 1.$]
Thus, your chain has a stationary distribution $\sigma = (\sigma_1,\sigma_2),$
such that $\sigma\mathbf{P} = \sigma.$
Solving two equations in two
unknowns shows that $\sigma_1 = .75, \sigma_2 = 0.25.$
In particular, $\sigma_1 = p_{12}/(p_{12}+p_{21}) = 0.6/0.8 = 0.75.$ [See the Note at the the end for an intuitive argument.]
Also, vector
$\sigma$ is the limiting distribution of the chain, so that the car is
clean on $75\%$ of the mornings.
Finding $\mathbf{P}^8$ suggests this limiting distribution, because
both its rows are approximately $\sigma.$ [Matrix multiplication in R.]
P = matrix(c(.8,.2,  .6,.4), byrow=T, nrow=2);  P
P2 = P %*% P; P2
      [,1] [,2]
[1,]  0.8  0.2
[2,]  0.6  0.4
P2 = P %*% P; P2
     [,1] [,2]
[1,] 0.76 0.24
[2,] 0.72 0.28
P4 = P2 %*% P2; P4
       [,1]   [,2]
[1,] 0.7504 0.2496
[2,] 0.7488 0.2512
P8 = P4 %*% P4; P8
          [,1]      [,2]
[1,] 0.7500006 0.2499994
[2,] 0.7499981 0.2500019

For ergodic chains with more than two states, it may be convenient
to use eigen vectors to find the stationary distribution $\sigma.$
We want a left eigen vector and R finds right eigen vectors, so we
use the transpose t(P) of P. The eigen vector with the largest
modulus [given first] is proportional to $\sigma.$ [We use as.numeric to suppress
superfluous complex-number notation in case some unused eigen vectors
are complex.]
v = eigen(t(P))$vectors[,1]
sg = as.numeric(v/sum(v));  sg
[1] 0.75 0.25

Note: Here is an intuitive view of the probability (proportion of the time) the car is clean: Suppose the car starts out dirty.
Then by a geometric distribution argument it will wait on average $1/0.6 = 10/6$ days until it is washed. Then it will wait on average $1/.2 = 5$ days before it gets a muddy rain bath. So a "cycle length" from dirty back to dirty with have $10/6 + 5$ days on average. Of this period of time it will have been clean
$5$ out of $10/6+10/2 = 40/6$ days. So, on average, it is clean $\frac{1/p_{21}}{1/p_{11}+1/p_{21}} =\frac{p_{12}}{p_{21}+p_{12}}=\frac{5}{40/6} = \frac{3}{4}$ of the time. [This kind of argument often works well with 2-state chains, but not so well for chains with more states, because there are so many different possible cycles among states to consider.]
