Random walk with variable transition probabilities Suppose we are dealing with a discrete 1D random walk. At each point, we have different probabilities of making step to the left or to the right.
--------------+---+---+---+---+---+---+---+---+
Points        | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
--------------+---+---+---+---+---+---+---+---+
P(move right) |...|0.3|0.5|0.7|0.4|0.8|0.9|...|
--------------+---+---+---+---+---+---+---+---+
P(move left)  |...|0.7|0.5|0.3|0.6|0.2|0.1|...|
--------------+---+---+---+---+---+---+---+---+

For example, the probability to get from point 3 to point 4 is 0.7, and the probability to get from same point 3 to 2 is 0.3.
In other words, it is like a Markov chain: states are points; transitions are possible only between neighboring states; all transition probabilities are known.
Suppose the motion begins at point 3. How can we calculate the probability that we will get to point 7 before we get to point 0?
 A: The book "Random Walks and Electric Networks" has some useful examples that should be of assistance:
https://math.dartmouth.edu/~doyle/docs/walks/walks.pdf
In particular, I'll point you to section 1.2.6 -- particularly, the part starting with, "As a second example," on the top of page 26. The gist is that you'll set up a $8 \times 8$ matrix whose $(i, j)$ entry is the probability of going from $i$ to $j$ -- e.g. the $(3, 4)$ entry would be $0.7$ per what you've written above. Most of the entries will be $0$, including all entries along the diagonal (except for the $(0,0)$ and $(7, 7)$ entries, which will be $1$ since they are your absorbing states).
After you have this matrix, your task is to reordering the states so that the absorbing states are in the upper left and your transition matrix has the canonical form
$$M = \left( \begin{array}{cc} I_2 & 0 \\ R & Q \end{array} \right)$$ where in your case, $I_2$ is the $2 \times 2$ identity matrix, the $0$ is a $2 \times 6$ block of $0$ entries, $R$ is a $6 \times 2$ block matrix consisting of the probabilities of each state transitioning into one of the absorbing states, and $Q$ is a $6 \times 6$ matrix with transition probabilities for the non-absorbing states. The computation $(I_6 - Q)^{-1}R$ will then give you the absorption probabilities you're looking for.
I highly recommend the above link, as it explains what I just described in much better detail and includes some fully worked-out examples.
