Assuming we start at state 0:
Attached is a picture of the transition matrix and the problem I am trying to figure out. I understand that we have to go from 0 to 7, giving that a probability of .5, and I understand the n-1 being the steps from 7 to itself. However, I'm having a hard time understanding where the 0.4 comes from.
Thanks for your help!


This is a very sloppily drawn diagram because they do not label the self-loops explicitly. The point is that there is only 0.6 worth of outgoing edges from state 7, which means that by conservation of probability there must be a self-loop with weight 0.4 from state 7 to itself.