◀ THE FOLD0ROOT.AI // WORLD II · LOOT · THE STASH◆ .dlw.fold
THE FOLD / LOOT / THE STASH / THE COMBINADICS

THE COMBINADICS

index any subset by a single number
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The combinatorial number system (combinadics) gives every k-element subset a unique integer index and back — a bijection between the numbers 0..C(n,k)−1 and the k-subsets of an n-set. The index of a subset {c1>…>ck} is simply C(c1,k)+C(c2,k−1)+…+C(ck,1); unranking runs it backwards with a greedy binomial peel. It lets you store, shuffle, or address combinations by a single number — a “subset odometer.”

LIT verified live: over all C(10,5)=252 subsets, rank∘unrank is the identity, and every unrank yields a valid, distinct 5-subset (window.__combinadics). FIG no framing; exact.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-stash — the hoard whose every possible k-item combination gets one address, indexable like a shelf slot. Combinadics is that addressing. AVAN (AI) built the instrument: the binomial rank, the greedy unrank peel, and the round-trip bijection check.

Credit as content: the combinatorial number system (Pascal-era binomials; formalized by D. H. Lehmer & others). The weave: David names the stash; I map each subset to its binomial index and greedily peel it back, confirming the map is an exact bijection over all C(10,5) subsets.
3 ONE DIMENSION
Rank a subset by summing binomials: {5,3,2,1,0} → C(5,5)+C(3,4)+C(2,3)+C(1,2)+C(0,1). Unrank peels the largest fitting binomial off the index, one element at a time.
4 TWO DIMENSIONS · INTERACTIVE
Slide an index; watch its 5-subset of {0..9} appear. The round-trip rank∘unrank is checked over all 252 indices.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the bijection between indices and k-subsets.
AVAN’s addition (the inverse-companion): address a whole combination by a single integer — rank it as a sum of binomials, unrank by greedily peeling the largest fitting binomial. The inverse of ‘enumerate subsets by listing them’ is ‘name each subset by one number and reconstruct it on demand.’ Magenta is the full list of subsets you never have to store; green is the single index that stands for each. A subset odometer.
LIT Genuine combinatorial number system / combinadics (classical binomial ranking; associated with D. H. Lehmer). Verified live: over all C(10,5)=252 five-subsets of a ten-set, rank composed with unrank is the identity, and every unrank produces a valid, distinct 5-subset (window.__combinadics.bijection && .valid).

FIG No framing: the binomial rank, the greedy unrank peel, and the round-trip bijection check run in-browser over all 252 subsets and hold. The AVAN inverse is honest — ranking a subset as a sum of binomials and unranking by peeling the largest fitting binomial addresses a whole combination by one integer; magenta is the full subset list you never store, green the single index that stands for each. A subset odometer.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE STASH · David Lee Wise (ROOT0), with AVAN