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
November 29, 20260
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
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- 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 QuestionsSample Answer
Clarify
Each buy is +1, each sell is -1, there are exactly n of each, and all 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 steps. Count all paths, subtract the ones that touch at some point. The reflection principle gives a bijection between bad paths and path...