Off the top of my head, you would do it by getting the hitting probability of a snake from zero, and then the hitting probability of a snake from itself, and then take the expectation a la a geometric series.
math
General community for all things mathematics on @lemmy.world
Submit link and text posts about anything at all related to mathematics.
Questions about mathematical topics are allowed, but NO HOMEWORK HELP. Communities for general math and homework help should be firmly delineated just as they were on reddit.
And in case you don't know how to calculate the hitting probability, there's some notes on it here: http://www.statslab.cam.ac.uk/~rrw1/markov/M.pdf. More generally, Dexter's notes (should come up if you Google it) are great for a number of topics in maths.
For an example of how you'd go about calculating it for your specific problem, consider the following: squares 1, 2, 3 and 4, a snake from 3 to 1, a dice that rolls 1 or 2, and finishing at 4. Then, letting hi be the probability of hitting 3 from square i,
h3 = 1
h4 = 0
h2 = 1/2h3 = 1/2
h1 = 1/2h3 1/2h2 = 3/4
More generally, for any Markov chain, for set A to be hit, the hitting probabilities are the minimal solution to
hi = 1, I in A
hi = Σj pij hj, for transition probabilities pij
Hopefully that makes sense, and feel free to DM about any stats questions, as it was the focus of my undergrad :)
Thank you.