I got an exercise in matlab were i need to solve two things. I think i have solved the first part but struggle to solve part 2.
Info:
A small version of the game Snakes and Ladders is shown in the figure below. You begin on square 1 and ending with square 9. In each case you toss a coin. Head equal 1 step and tail equal two steps. If you end up at the bottom of a ladder you will climb up to the top. If you end up on the head of the snake you will fall down to its tail. You need to finish the game by hiting square 9 with the correct step (from 8 to 9 will be 1 step). Because the probabilities are "Where to go after the next step does not depend on what's has happend before", we can describe the game as one Markov chain.
Problem #1: Solve the transition matrix for this chain. Problem #2: What is the probability that you will finish the game (reach square 9) in:
- 5 turns
- 10 turns
- 20 turns
I am wondering if my transition matrix is correct (picture): Transition matrix
I am really stuck in problem 2 were i need to solve the 5,10 and 20 turns with matlab code.
I think there is a problem with the transition matrix; for example, shouldn't there be a $0.5$ probability that you go from square $1$ to square $7$ i.e. that you roll a head on the first roll?
As for the computations: Hint If $M$ is the transition matrix, then the $i$-$j$th entry of $M^n$, denoted $p_{i,j}^{(n)}$, is the probability of getting from square $i$ to square $j$ in $n$ steps. How could this be used to compute the probabilities you want given you can easily compute $M^n$ using MatLab?