Establish a transition matrix:
[tex] T = \left[\begin{array}{ccc}0.7&0.3\\0.5&0.5\end{array}\right] [/tex]
The possible path are:
sunny -> cloudy -> cloudy -> sunny
-> sunny -> sunny
-> sunny -> cloudy -> sunny
-> sunny -> sunny
Find and add all the paths using the transition matrix T:
0.3*0.5*0.5 + 0.3*0.5*0.7 + 0.7*0.3*0.5 + 0.7*0.7*0.7 = 0.628