PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Machine Learning/Imc

Compute gambler’s ruin probabilities and hitting times

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of stochastic processes, Markov chains, and discrete-time random walks by requiring derivation of absorption probabilities and expected hitting times in the gambler’s ruin model.

  • medium
  • Imc
  • Machine Learning
  • Data Scientist

Compute gambler’s ruin probabilities and hitting times

Company: Imc

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Onsite

A gambler plays a sequence of independent bets. Starting wealth is \(i\) dollars, with absorbing boundaries at \(0\) (ruin) and \(N\) (target). Each round: - With probability \(p\), wealth increases by 1. - With probability \(q=1-p\), wealth decreases by 1. 1) Derive the probability \(u_i\) that the gambler reaches \(N\) before 0. 2) Derive the expected number of steps until absorption (hitting either 0 or \(N\)) starting from \(i\). 3) (Random walk follow-up) For the unbiased case \(p=q=1/2\), relate your results to a simple symmetric random walk hitting \(\{0,N\}\).

Quick Answer: This question evaluates understanding of stochastic processes, Markov chains, and discrete-time random walks by requiring derivation of absorption probabilities and expected hitting times in the gambler’s ruin model.

Related Interview Questions

  • Choose optimal posted price under adverse selection - Imc (medium)
  • Run EDA and train models while preventing overfitting - Imc (medium)
  • Explain linear regression and Transformer fundamentals - Imc (medium)
  • Solve a constrained problem using KKT conditions - Imc (medium)
Imc logo
Imc
Jan 14, 2026, 12:00 AM
Data Scientist
Onsite
Machine Learning
3
0
Loading...

A gambler plays a sequence of independent bets. Starting wealth is iii dollars, with absorbing boundaries at 000 (ruin) and NNN (target).

Each round:

  • With probability ppp , wealth increases by 1.
  • With probability q=1−pq=1-pq=1−p , wealth decreases by 1.
  1. Derive the probability uiu_iui​ that the gambler reaches NNN before 0.
  2. Derive the expected number of steps until absorption (hitting either 0 or NNN ) starting from iii .
  3. (Random walk follow-up) For the unbiased case p=q=1/2p=q=1/2p=q=1/2 , relate your results to a simple symmetric random walk hitting {0,N}\{0,N\}{0,N} .

Solution

Show

Submit Your Answer

Sign in to leave a comment

Loading comments...

Browse More Questions

More Machine Learning•More Imc•More Data Scientist•Imc Data Scientist•Imc Machine Learning•Data Scientist Machine Learning
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.