Suppose it is Friday (Fr), and you are asked to determine the probability that it will rain tomorrow on Saturday (Sa). You will need to know whether it rained yesterday, Thursday (Th), and two days ago on Wednesday (We). Given the information in the problem, you can make the following table:
$$\begin{array} {c|c}
\text{Rained on} & \text{Will Rain on} \\
\begin{array} {ccc}
\text{We} & \text{Th} & \text{Fr} \\ \hline
Y & Y & Y \\
Y & Y & N \\
Y & N & Y \\
Y & N & N \\
N & Y & Y \\
N & Y & N \\
N & N & Y \\
N & N & N \\
\end{array}&
\begin{array} {c}
\text{Sa} \\ \hline
0.8 \\
0.4 \\
0.6 \\
0.4 \\
0.6 \\
0.4 \\
0.6 \\
0.2 \\
\end{array}
\end{array}$$
Now this is a transition table , but the output states are not the same as the input states. The input states are the rain of 3 days; the input states are the rain of 1 day. So to make a transition matrix, we need the output states to be the same as the input states: 3 days to 3 days, {We, Th, Fr} to {Th, Fr, Sa}.
$$\begin{array} {c|c}
\text{Rained on} & \text{Will Rain on Th Fr Sa } \\
\begin{array} {ccc}
\text{We} & \text{Th} & \text{Fr} \\ \hline
Y & Y & Y \\
Y & Y & N \\
Y & N & Y \\
Y & N & N \\
N & Y & Y \\
N & Y & N \\
N & N & Y \\
N & N & N \\
\end{array}&
\begin{array} {c}
\text{YYY} & \text{YYN} & \text{YNY} & \text{YNN} &
\text{NYY} & \text{NYN} & \text{NNY} & \text{NNN} \\ \hline
0.8 & 0.2 \\
& & 0.6 & 0.4 \\
& & & & 0.6 & 0.4 \\
& & & & & & 0.6 & 0.4 \\
0.6 & 0.4 \\
& & 0.6 & 0.4 \\
& & & & 0.6 & 0.4 \\
& & & & & & 0.2 & 0.8 \\
\end{array}
\end{array}$$
Each blank entry is an impossible transition. For example, it's impossible to transition from a Friday where it rained 3 days in a row to a Saturday where it was clear 3 days in a row (the top right corner). So your final transition matrix is:
$$\begin{bmatrix}
0.8 & 0.2 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0.4 & 0.6 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0.6 & 0.4 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0.4 & 0.6 \\
0.6 & 0.4 & 0 & 0 & 0 & 0 & 0 & 0 \\
0 & 0 & 0.4 & 0.6 & 0 & 0 & 0 & 0 \\
0 & 0 & 0 & 0 & 0.6 & 0.4 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 0.2 & 0.8 \\
\end{bmatrix}$$
The "notation" (if it can even be called that) that your guide is using is replacing the yes/no sequence with a number (So YYY is 0, NNN is 7, it is quite confusing). $P_{0,0}$ is the probability that it rained for the past 3 days and tomorrow will also be a day where it has rained for 3 days.
The transition matrix $P$ has entries $p_{ij}$ which are the probability of transitioning from $i$ to $j$. So if your states are listed as "sunny,partly cloudy,rainy" then
$$P=\begin{bmatrix} 0.5 & 0.4 & 0.1 \\
0.4 & 0.5 & 0.1 \\
0.2 & 0.2 & 0.6 \end{bmatrix}$$
Given an initial distribution $\lambda$ (written as a row vector), the distribution at time $n$ is $\lambda P^n$. (If you prefer, you can work with a column vector and deal with $(P^T)^n \lambda$.) So you can find your second answer by taking $\lambda=[0,0,1]$ and calculating $\lambda P^2$.
The first answer is slightly different because you are being asked about the probability that it rains two days in a row. Here you'll want to use the independence: the probability of being rainy for the next two days is the probability to go from rainy to rainy, and then rainy to rainy again.
Best Answer
You consider two recent days and each day has two possibilities. Therefore, you have four states. Let
R
represent rainy andS
sunny. So the states are:RR
,RS
,SR
,SS
.So for instance if you are in the state
RR
, you go to stateRS
with probability $\frac{1}{6}$ and remain in that state with probability $1-\frac{1}{6}$. Hence the transtion matrix becomes$\hspace{6.75cm}$
RR
$\hspace{5mm}$RS
$\hspace{4mm}$SR
$\hspace{4mm}$SS
$$\begin{bmatrix} 1-\frac{1}{6}&\frac{1}{6} & 0 & 0\\ 0&0 & 1-\frac{1}{3} & \frac{1}{3}\\ 1-\frac{1}{3}&\frac{1}{3} & 0 & 0\\ 0&0 & 1-\frac{1}{2} & \frac{1}{2} \end{bmatrix}$$