这题要好好做还是要花一点时间,我只做第一问,后面的你自己再加一点就好了。
先上第一问的答案
Let $X_{ij}$ be a Bernoulli random variable where
\begin{align*}
x_{ij} = \begin{cases} 1 \text{ if cell $(i,j)$ is empty at time 1}\\ 0 \text{ if cell $(i,j)$ is nonempty at time 1, }\end{cases}
\end{align*}
then we know that $E[X_{ij}] = p_{ij}$, where $p_{ij}$ is the probability that cell $(i,j)$ is empty at time 1.
There are 3 types of cells: Cell with 2 neighbors (corner cells: (0,0),(0,3),(3,0),(3,3))
\begin{align*}
p_{00} &= P(\text{mouse in cell (0,1) does not jump to (0,0)})\times P(\text{mouse in cell (1,0) does not jump to (0,0)})\\
&= \frac{2}{3}\times \frac{2}{3} = \frac{4}{9}.
\end{align*}
So by similar reasoning we have
\begin{align*}
p_{30} = \frac{4}{9},\quad p_{03} = \frac{4}{9},\quad p_{33} = \frac{4}{9}.
\end{align*}
Cell with 3 neighbors (boarder cells: (0,1)(0,2),(1,0),(2,0),(3,1)(3,2),(1,3),(2,3))
\begin{align*}
p_{01} =& P(\text{mouse in cell (0,0) does not jump to (0,1)})\times P(\text{mouse in cell (1,1) does not jump to (0,1)})\\ &\times P(\text{mouse in cell (0,2) does not jump to (0,1)})\\
=& \frac{1}{2}\times \frac{3}{4}\times \frac{2}{3} = \frac{1}{4}.
\end{align*}
So by similar reasoning we have
\begin{align*}
p_{01} = p_{02} = p_{10} = p_{20} = p_{31} = p_{31} = p_{13} = p_{23} = \frac{1}{4}.
\end{align*}
Cell with 4 neighbors (boarder cells: (1,1)(1,2),(2,1),(2,2))
\begin{align*}
p_{01} =& P(\text{mouse in cell (0,1) does not jump to (1,1)})\times P(\text{mouse in cell (1,0) does not jump to (1,1)})\\ &\times P(\text{mouse in cell (1,2) does not jump to (1,1)})\times P(\text{mouse in cell (2,1) does not jump to (1,1)})\\
=& \frac{2}{3}\times \frac{2}{3}\times \frac{3}{4}\times \frac{3}{4} = \frac{1}{4}.
\end{align*}
So by similar reasoning we have
\begin{align*}
p_{11} = p_{12} = p_{21} = p_{22} = \frac{1}{4}.
\end{align*}
Now, let $Y$ be the random variable of the number of empty cells at time 1, then we have
\begin{align*}
E[Y] = E\left[\sum\limits_{i=0}^3\sum\limits_{j=0}^3X_{ij}\right] = \sum\limits_{i=0}^3\sum\limits_{j=0}^3E[X_{ij}] = \sum\limits_{i=0}^3\sum\limits_{j=0}^3p_{ij} = \frac{43}{9} \approx 4.78.
\end{align*}
再给你贴一段验证第一问答案的代码
实验10000次得到的第一问的答案是4.7732.
第二三问都需要simulation了,在我贴的代码基础上再加改进就好。