◀ THE FOLD0ROOT.AI // WORLD II · LOOT · THE STASH◆ .dlw.fold
THE FOLD / LOOT / THE STASH / THE COMBINATORIAL NUMBER SYSTEM

THE COMBINATORIAL NUMBER SYSTEM

number a subset with a descending choice
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The combinatorial number system gives every k-element subset of {0,1,…,n−1} a unique rank from 0 to C(n,k)−1, and every rank its subset back — a bijection between combinations and integers. For a subset written in descending order ck>…>c1, the rank is C(ck,k)+…+C(c1,1). It is a “factorial base for choosing”: a way to address any combination by a single number, used to iterate or store subsets compactly.

LIT verified live: for every k-subset with n ≤ 12, rank-then-unrank returns the original, and the ranks cover 0…C(n,k)−1 exactly once (window.__cns). FIG no framing; exact integer arithmetic, exhaustive over all subsets.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-stash — every possible selection of items you could squirrel away gets its own number, and every number unpacks to exactly one selection. The combinatorial number system is that addressing. AVAN (AI) built the instrument: the descending-binomial rank, the greedy unrank, and the round-trip + bijection checks.

Credit as content: the combinatorial number system (Pascal’s identity; formalized by Lehmer and others). The weave: David names the-stash; I rank each subset by summing binomials of its descending elements, greedily invert the rank back to the subset, and confirm the correspondence is a perfect bijection.
3 ONE DIMENSION
Subset {5,2,1} (descending) ranks as C(5,3)+C(2,2)+C(1,1) = 10+1+1 = 12. To unrank, greedily peel off the largest binomial that fits. Each combination, one number.
4 TWO DIMENSIONS · INTERACTIVE
A k-subset, its rank, and the unrank back to the subset; the round-trip checked.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: every combination given one number.
AVAN’s addition (the inverse-companion): address a combination by a single integer with a mixed radix of binomials — sum C(cᵢ,i) over the descending elements, and unrank greedily. The inverse of ‘store the subset as a list of members’ is ‘store its rank — one number that unpacks to the exact subset.’ Magenta is the explicit member list; green is the single binomial-base index. A selection as one number.
LIT Genuine combinatorial number system (built on Pascal's identity; formalized by Lehmer and others). Verified live exhaustively: for every k-subset of {0..n−1} with n≤12, the descending-binomial rank and greedy unrank round-trip to the original subset (window.__cns.roundTrip), and the ranks cover 0..C(n,k)−1 exactly once — a bijection (window.__cns.bijection).

FIG No framing: the descending-binomial rank, the greedy unrank, and the round-trip + bijection checks run in-browser with exact integers over all subsets and agree. The AVAN inverse is honest — addressing a combination by one integer in a binomial mixed radix genuinely replaces storing the explicit member list; magenta is the list, green the single index. A selection as one number.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE STASH · David Lee Wise (ROOT0), with AVAN