Once there was a pig, which was very fond of treasure hunting. The treasure hunt is risky, and it is inadvertently caught in the peach blossom trap. Fortunately, it has got a map of peach blossom trap. You can think of it as a matrix of R rowand C column. ‘.’ stand for the road you can walk. ‘*’ means there is a peach tree planted in this grid, and obviously you can’t go into it. Thepig can only walk up to four adjacent squares in the upper, lower, left and right directions at a time. The outside of the matrix is the paradise of freedom, and of course, it may never go out. Though it has got the map, but doesn't know where it is in the peach blossom trap now,that means it could be at any ‘.’ in the matrix. It finds you smart to tell it the probability it can get out of peach blossom trap, please tell him the answer in the formof p/q.
Once there was a pig, which was very fond of treasure hunting. The treasure hunt is risky, and it is inadvertently caught in the peach blossom trap. Fortunately, it has got a map of peach blossom trap. You can think of it as a matrix of R row and C column. ‘.’ stand for the road you can walk. ‘*’ means there is a peach tree planted in this grid, and obviously you can’t go into it. The pig can only walk up to four adjacent squares in the upper, lower, left and right directions at a time. The outside of the matrix is the paradise of freedom, and of course, it may never go out. Though it has got the map, but doesn't know where it is in the peach blossom trap now, that means it could be at any ‘.’ in the matrix. It finds you smart to tell it the probability it can get out of peach blossom trap, please tell him the answer in the form of p/q.