Gambler's Ruin: Hitting Probability

Level 4●●●○○ Medium~6 min

Problem

You start with DOLLARk and bet DOLLAR1 per round on a game that pays +1+1 with probability pp and 1-1 with probability q=1pq=1-p. You stop at DOLLAR0 (ruin) or DOLLARN (target). What is the probability you reach NN before 00? Cover both the fair (p=1/2p=1/2) and biased cases.
N0ktime →

Start at k; a fair walk is absorbed at 0 (ruin) or N (target).