Quant

Probability, advanced

The harder probability questions trading and quant firms ask: overlapping patterns, ruin and random walks, Poisson clocks, conditional means, records, derangements and stopping rules.

Read first: Probability and brainteasers

8 concepts9 min read25-question test, from a bank of 34Updated

Concept 1 of 81 min

Patterns and waiting times

The rule
The expected wait for a coin-flip pattern sums 2k over every k for which its first k flips equal its last k.
Worked examples

A pattern that overlaps itself

Given
PatternHTH
Overlaps at lengths1 and 3
  1. Wait = 23 + 21 = 10 flips

A miss can leave part of HTH in place, but completing it costs extra waiting.

A pattern that does not

Given
PatternHHT
Overlaps at lengths3 only
  1. Wait = 23 = 8 flips

Same length, but HHT comes 2 flips sooner than HTH on average.

The picture
Formula
E[wait]=Σ 2k over overlaps k (k = full length included)
Var(geometric)=(1 − p) ÷ p²
cards before the first target ≈ others ÷ (targets + 1)
Why it holds

So self-overlapping patterns take longer. The number of tries until a first success has variance (1 − p) ÷ p².

Patterns of the same length also do not come first equally often (Penney's game): once 2 heads appear, heads-heads-tails is certain to come before heads-tails-heads. Waiting for 2 consecutive matches, HH or TT, needs one flip to start and then waits for a match.

Without replacement, the non-target cards spread evenly over the gaps around the targets.

Watch out
  • Giving every 3-flip pattern the same wait.
  • Assuming patterns of the same length are equally likely to come first.
  • Using the with-replacement answer for cards that are not put back.
In the interview
  1. Why does it take longer on average to see heads-tails-heads than heads-heads-tails?

    A complete answer covers

    • Heads-tails-heads overlaps with itself: it starts and ends with heads.
    • The expected wait adds 2k for each overlap: 8 + 2 = 10 against 8.
    • Set up the states and solve to check it.
    • Same-length patterns also differ in which comes first, as in Penney's game.

Also in our technical interviews, on camera, with a score.

Concept 2 of 81 min

Random walks, ruin and Markov chains

The rule
In gambler's ruin with win probability p, the chance of reaching N before 0 from k is (1 − rk) ÷ (1 − rN), with r = q ÷ p.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 3 of 81 min

Poisson processes and exponential clocks

The rule
A Poisson process with rate λ has no arrival in a period t with probability e−λt, and its waiting times are exponential and memoryless.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 4 of 81 min

Conditional means and the faces trick

The rule
Conditioning restricts the outcomes before averaging, and symmetry often gives the answer at once.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 5 of 81 min

Covariance and correlation

The rule
Cov(X, Y) = E[XY] − E[X] × E[Y], so a variable can be uncorrelated with its own square.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 6 of 81 min

Random draws: e, records, derangements and stopping

The rule
The number of uniform draws needed for their sum to exceed 1 averages e, and the share of derangements tends to 1 ÷ e.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 7 of 81 min

Symmetry and geometric puzzles

The rule
3 random points on a circle form a triangle containing the centre with probability 1/4, as they lie on a semicircle with probability 3/4.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Concept 8 of 81 min

AdvancedHow long a fair game lasts: distance squared

The rule
A fair one-step game started at k and stopped at 0 or N lasts k × (N − k) rounds on average.

The why, the charts, the worked example and the interview questions are in Essentials, with every quiz.

See the plansSign in

Recap

  • A pattern that overlaps with itself takes longer to appear; same-length patterns do not have the same odds of coming first.
  • Gambler's ruin: P(reach N from k) = (1 − rk) ÷ (1 − rN) with r = q ÷ p; a symmetric walk reaches every level for sure, in infinite expected time.
  • Poisson and exponential clocks are memoryless; the first of several rings at the sum of their rates.
  • Condition by restricting the outcomes, then use symmetry; count faces, not cards.
  • e appears everywhere: draws until a sum exceeds 1, derangements, the secretary problem; records grow like the harmonic sum.
Now test it

25 questions on Probability, advanced

Timed, like the real one, drawn from a bank of 34. Every answer explained.

Test yourself →