Updated · By Pete Bromfield, IB examiner

IA idea · Matrices, transformations & Markov chains

Gambler's ruin: how long until someone runs out?

AI HLAA HL Ambitious Also in: Probability, Simulation

Research question

If two players repeatedly bet one coin on a slightly unfair game, what is the probability that each is ruined and how long does the game last on average, from matrices, from a recurrence and from simulation?

Adapt it: change the place, the data or the comparison until the question is yours.

Free: the A–E checklist an examiner uses, by email ↓

Why it makes a good exploration

Three methods for the same answer that check each other: an absorbing Markov chain, a difference equation solved exactly, and a simulation.

The mathematics you'll need

  • Absorbing Markov chains and the fundamental matrix (new)
  • Recurrence relations solved with a characteristic equation
  • Expected duration
  • Simulation to check
  • Effect of a small bias over many bets

Course labels show where a technique sits; using maths from outside your course is fine if you explain it clearly and say it is new to you.

Where the data comes from

No data needed; optionally play a real coin game to compare.

Cite every source in a footnote where you use it and in your bibliography. Check the licence of any dataset you download.

A possible outline

  1. Set up the chain for small totals.
  2. Find ruin probabilities with matrices.
  3. Solve the recurrence for general totals.
  4. Find expected duration and check by simulation.
  5. Reflect on what a small bias does in a casino.

Pitfalls that cost marks

  • Using the fundamental matrix without explaining it.
  • Algebra errors in the recurrence; check with small cases.
  • Too few simulations.

Showing personal engagement

  • Predict the answer for a fair game first.
  • Find the bias that makes a game 'feel' fair but isn't.
  • Play the game with a friend.

See Criterion C: personal engagement for what examiners look for.

Which course is it for?

CourseFitMaths to lean on
AA SLNot a natural fitThe core technique sits in the AI course or at HL; an AA SL student could use it only as clearly explained new mathematics.
AA HLGood fitAbsorbing Markov chains and the fundamental matrix (new); Recurrence relations solved with a characteristic equation
AI SLNot a natural fitThe mathematics is mainly AA or HL (calculus or proof beyond AI SL); an AI SL version would need a data-driven, technology-based approach.
AI HLGood fitAbsorbing Markov chains and the fundamental matrix (new); Recurrence relations solved with a characteristic equation

Level: Ambitious. Suits confident students; expect to learn some mathematics on your own. See how the IA differs between AA and AI, SL and HL.

How this idea reaches the top bands

Personal engagement (C)

Collect the data for your matrix yourself (counting transitions, measuring a shape), and choose the states or the transformation from a situation you care about.

Reflection (D)

Question the model's assumptions: is the process memoryless, are the probabilities constant, does the transformation preserve what it should? Say how each affects your conclusion. For this idea, start with: using the fundamental matrix without explaining it — say how it affects your answer.

Use of mathematics (E)

SL: Matrices are in AI HL. At SL, keep to small matrices you explain carefully as new mathematics, with every multiplication shown once and the result interpreted.

HL: Transition matrices, powers, steady states and eigenvalues used correctly, with diagonalisation or a general result derived, and the long-run behaviour interpreted in context.

Criteria A and B (presentation and communication) work the same way for every idea: see the guides to Criterion A and Criterion B.

Taking it further

Allow bets of different sizes, or find the strategy that maximises the chance of reaching a target.

Extending it for HL

Diagonalise the matrix to find a formula for the nth state, or compare the steady state with what your data actually shows.

Before you start: the checklist an examiner uses

Every check for Criteria A–E in a 4-page PDF, the mistakes that cost the most marks and a self-assessment grid. We'll email it with a short IA tip every few days, timed to your deadline if you give it. Free — no account, no payment.

Turn this idea into your IA

Similar ideas

All matrices & markov ideas · AI HL ideas · AA HL ideas · All 239 IA ideas