How may i find the expected number of throws to finish a snakes and ladders game depending on the value of the initial throw?
I have a board with 25 squares so I made a 26x26 matrix with probabilities of getting to the state.
For e.g. from a 0 the probability of me getting to 0 is _, 1 is _, 2 is _.......25 is _
from a 1 the probability of me getting to 0 is _, 1 is _, 2 is _.......25 is _
and so on.
I don't know how to proceed from here.
Of course I am doing this using python, you can have a look at the code that i have currently. Its just I don't know the concept of how I can find the expected number of throws ...so if someone could shed some light that would be good
from pylab import *
from numpy import *
# get the probabilities of going from one state to another.
data = loadtxt("mat.txt")
data = data.reshape(-1,26)
# chop off the last row and column
# transition probabilities among the transient states
Q = data[0:25,0:25]
# the transition probabilities from transient to absorbing
R = data[0:25,25:26]
# M = (I-Q)^-1
Matrix = linalg.inv(eye(25)-Q)
# B = M*R
B = Matrix*R
count = 
for i in Matrix:
for m in i:
sum = sum + m