A gambler starts with \iand plays a game where, at each step, they win $1 with probabilitypand lose $1 with probabilityq = 1 - p.Thegameendswhenthegamblereitherreaches$N$ (win) or $0 (ruin).
Let Pi denote the probability of reaching \Nbefore $0, starting from$i$.
Derive a closed-form expression for Pi in terms of p, q, i, N.
What happens in the fair case p=q=21?
What is the expected duration of the game (number of steps until absorption)?