Markov chain to total/unconditional probability Got asked this on an interview, and I only had just a little over a minute to answer this so time was quite tight. Needless to say I couldn't figure it out in time so hopefully you can help me figure this out. Unfortunately I haven't dealt with Markov chains in a while.
A day is either good or bad. If today is a good day, then tomorrow has $x$ probability of being good. If today is a bad day then tomorrow has a $y$ probability of being good (in the interview $y<x$ but for the sake of generality we can assume it doesn't matter). How many good days can you expect in a window of 365 days?
I thought about writing down a transition matrix and raising it to a power, but I wasn't sure if it was the right direction since the question asked about the course of 365 days and not 365 days from now.
 A: Hint: Draw a tree that gives you the probability of a good day two days from a given day $D$ (without knowing whether $D$ is a good or bad day). Then you can compute the probability that $D+2$ is a good day, $D+4$, etc. Then you can compute the probability that day $D=1$ is a good day, and the probability that day $D=2$ is a good day, and you will be able to compute the probability that any given day $D \in [1,365]$ is a good day. Then take expected values. At least, that's my idea. There may be a more elegant approach.
A: Since they expected you to solve that in a minute, I'm guessing you were supposed to assume the Markov chain representing good/bad days was stationary. They just wanted you to compute the probability (at stationarity) that a given day is good and multiply that by 365 (by additivity of the expected value). Since you are trying to review Markov chains for future interviews, I won't explain how to find that probability, and I'd suggest trying to figure it out yourself before looking it up.
Edit: The wording wasn't the greatest, but in future you should probably ask them about the initial condition of the Markov chain (in this case, the probability that day 1 is a good day). If you have no information about the initial condition, then it's a good bet that the Markov chain is stationary.
A: Since initial conditions haven't been given, perhaps you are expected to assume that the steady state arrives fairly quickly, and compute the steady state probabilities to get an approximation for the expected number of good days in $365$ days
The transition matrix is
$\quad\quad\quad\,G\quad\; B$
$\quad\quad G\;\,$x$\quad$1-x
$\quad\quad B\;$y$\quad$1-y
Let $\Large g$ and $\Large b\;$ be the steady states of $G$ and $B$ respectively, then further iterations won't change the probabilities of being in state $G$ or state $B,$ so
$\large gx+by=g,\quad g(1−x)+b(1-y)=b,\quad g+b=1,$
which yields $\large g=\dfrac{by}{1-x},\quad x≠1 $
and  expected number of days in state $\large G=365g$
So essentially, they wanted you to evolve and solve the system of linear equations
