This can be solved with linear algebra as follows:
1. Create an adjacency matrix.
2. For each row in the matrix, scale all of the values so that the row sums to 1.
3. At this point, the value at row i, column j will be the probability that a single random step starting in cell i will land you in cell j.
4. Raise the matrix to the 9th power. If you're doing this by hand, you can do it in only 4 matrix multiplications if you're clever enough.
5. At this point, the value at row i, column j will be the probability that exactly 9 random steps starting in cell i will land you in cell j.
6. The row and column corresponding to the puzzle's specified starting and ending square will now contain the desired probability.
Here's a demonstration of this approach in Haskell (it requires the matrix
package):
import Data.Matrix
adjacencies = [
[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,1,0,0,0,0,0,0,0,0,0,0],
[0,0,0,1,0,0,0,0,0,0,0,0,0,0,0],
[1,0,1,0,0,0,1,0,0,0,0,0,0,0,0],
[0,1,0,0,0,1,0,0,1,0,0,0,0,0,0],
[0,0,0,0,1,0,0,0,0,0,0,0,0,0,0],
[0,0,0,1,0,0,0,1,0,0,1,0,0,0,0],
[0,0,0,0,0,0,1,0,1,0,0,0,0,0,0],
[0,0,0,0,1,0,0,1,0,0,0,1,0,0,0],
[0,0,0,0,0,0,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,1,0,0,1,0,0,0,1,0],
[0,0,0,0,0,0,0,0,1,0,0,0,1,0,1],
[0,0,0,0,0,0,0,0,0,0,0,1,0,0,0],
[0,0,0,0,0,0,0,0,0,0,1,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,1,0,0,0]]
normalize :: [Rational] -> [Rational]
normalize xs = map (\x -> x / s) xs
where s = sum xs
stepProbabilities = fromLists (map normalize adjacencies)
walkProbabilities = stepProbabilities ^ 9
-- Result: 935 % 13122
main = print $ getElem 8 1 walkProbabilities