Count Trade Orderings That Never Leave Your Inventory Short

Last updated: November 29, 2026

Quick Overview

A market maker will do n buys and n sells of one unit each in random order, starting flat. How many orderings keep inventory at or above zero the whole time, and what is the probability a random ordering does?

Akuna Capital
Statistics & Math
Quantitative Researcher
Akuna Capital
November 29, 2026
Quantitative Researcher
Onsite
Statistics & Math
Medium

0

0

0 solved


A market maker will do n buys and n sells of one unit each in random order, starting flat. How many orderings keep inventory at or above zero the whole time, and what is the probability a random ordering does?

Akuna Capital's quant onsite mixes combinatorics with trading language, and this is the ballot problem dressed as inventory. The interviewer checks that you can count lattice paths, use the reflection principle to subtract bad paths, and arrive at the Catalan number with a quick check on small n.

What the Interviewer Expects
  • Map the problem to up/down lattice paths that never go below zero
  • Count all paths as C(2n, n)
  • Use reflection to count bad paths as C(2n, n+1)
  • Get the Catalan number C(2n, n)/(n+1) and probability 1/(n+1)
  • Verify on n = 2 by listing
Key Topics to Cover
combinatorics
Catalan numbers
reflection principle
random walks
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • What if there are a buys and b sells with a > b; what fraction stay non-negative?
  • What is the probability inventory stays strictly positive after the first trade?
  • How does this relate to the probability a random walk returns to zero?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

Each buy is +1, each sell is -1, there are exactly n of each, and all (2nn)\binom{2n}{n} orderings are equally likely. 'Never short' means every prefix has at least as many buys as sells....

Approach

Each ordering is a path from height 0 to height 0 in 2n2n steps. Count all paths, subtract the ones that touch −1-1 at some point. The reflection principle gives a bijection between bad paths and path...


Submit Your Answer
Markdown supported