The walk on the 1D Lattice with no barriers can be illustrated where a walker starts at zero (0) on the number line and a fair coin is flipped. If it lands on heads, the walker moves one (1) unit to the right. If it lands on tails, the marker is moved one (1) unit to the left.
Unlike the random walk on the 1D lattice where the walk can be extended to infinity at either end of the number line, the random walk with barriers ends when the walker runs into either barrier on each side of the number line.
If the walker starts at zero and walks until either the barrier at A or the barrier at B is hit, what is the probability of hitting the barrier at A and the probability of hitting the barrier at B? Find a formula generalizing this probability.