Scenario
In quantitative trading and quantitative research, candidates are frequently evaluated on probability modeling, specifically regarding Gambler's Ruin / Difference Equations.
Your Task
A gambler starts with an initial capital of \iandbets$1ateachstep.Ineachindependentgame,thegamblerwins$1withprobabilitypandloses$1withprobabilityq = 1-p,wherep \ne 1/2.Thegameterminateswhenthegamblerreaches$N(win)or$0(ruin).(1)DerivetheexactprobabilityP_iofreaching$Nbeforeruin.(2)Derivetheexpectedduration\mathbb{E}[T_i]$ of the game.
Constraints
- All variables are defined on a standard probability space (Ω,F,P).
- Analytical expressions must be in closed form, and empirical simulations should converge within standard statistical tolerances.