# Range equity aggregation: exact river examples

Created September 5, 2026 by GTO Gecko. Original synthetic data and code; no player data, commercial solver output or app telemetry. This bundle illustrates normalization over legal joint hand pairs, not optimal play.

## Reproduce

Keep all eight files in one directory. Use Python 3.11+ and Node.js 22+ with no third-party dependencies:

```sh
python generate.py
node verify.mjs
```

The generator overwrites only results.json, pairs.csv and hands.csv beside itself. The verifier checks these outputs against an independently specified fixture oracle. MANIFEST.sha256 records the release files other than itself; regeneration must preserve those three data hashes. Paths do not depend on the working directory.

## Model

Two Hold'em players, a fixed completed five-card board, and explicit combo-level input weights. All unlisted hands have zero weight. Each listed combo must be internally valid and disjoint from the board. A pair sharing a hole card is incompatible and contributes zero mass.

For legal pair (h,v), mass = a(h)*b(v). Normalize over all legal pairs. Hero's share is1 for a win,1/2 for a tie,0 for a loss. Hero equity is weighted share divided by total mass. Row mass includes Hero's own input weight once. Conditional row equity divides the row's weighted share by its mass. The deliberately naive comparator averages supported conditional equities using only Hero input weights, omitting compatible opponent mass. It is not treated as the correct aggregate.

Python ranks every five-card subset of each seven-card holding with exact tie breakers. Rational arithmetic preserves all weights and results. JSON fractions are strings; undefined values are null. CSV uses empty fields for undefined values and True/False for legal. There is no Monte Carlo sampling, seed or inference interval.

## Cases and expected equity

| Case | Change from the base | Legal mass | Hero equity |
|---|---|---:|---:|
| equal_inputs | Board2c3d7h9sJc; HeroAsAh,KsKh; VillainAsAd,AcAd,QsQh; each weight1 |5|1/2|
| half_qq | OpponentQsQh weight1/2 |4|3/8|
| half_hero_aa | HeroAsAh weight1/2 |4|7/16|
| all_compatible | Remove opponentAsAd |4|5/8|
| zero_row | OpponentAsKd only; HeroAA has no support |1|1|
| zero_total | HeroAsAh versusAsKd only |0|undefined|
| all_ties | Royal-flush boardAsKsQsJsTs; disjoint low pairs |4|1/2|

Seven cases contain29 candidate pairs, including incompatible cells, and13 Hero rows. The base has six candidates, five legal pairs and Hero pot-share total5/2. Its naive hand average is13/24. Reducing opponentQQ to1/2 changes the aggregate to3/8 versus naive13/30. Percentages in the article are rounded for presentation only.

## Files

- generate.py: original standard-library exact generator.
- verify.mjs: independently implemented fixture and data verifier.
- results.json: full inputs, pairs, conditional hand summaries and aggregates.
- pairs.csv: complete pair ledger.
- hands.csv: conditional hand equity and mass ledger.
- matchup-mass.svg: accessible diagram of the base case.
- README.md: these methods and instructions.
- MANIFEST.sha256: hashes of the other seven files.

## Primary references, accessed September 5, 2026

- [PioSOLVER range weights and matchups](https://piosolver.com/docs/viewer/numbers_in_piosolver/): documents raw weights versus compatible matchup frequencies.
- [PioSOLVER UPI](https://piosolver.com/docs/upi/commands/): per-hand equity, matchup and total export conventions.
- [Hold'em rules](https://www.pokerstars.com/poker/games/texas-holdem/): best-five-card showdown and ties.
- [Independent open-source implementation](https://github.com/b-inary/postflop-solver/blob/9d1509fe5077d019825f833eed04b16d342dfda1/src/game/interpreter.rs): cache_normalized_weights accounts for compatible opponent mass. Consult the upstream license before reusing its code; no upstream code is copied into this bundle.

## Limits

This is a small pedagogical collection, not a validated general equity engine. It assumes factorable input weights conditioned on legality. Arbitrary joint correlations and hidden folded-player evidence need another model. Positions, stack depths, bet sizes, rake/antes, tournament payouts and bounties are absent because only final showdown shares are evaluated. No strategy, actionEV, profit, app-feature or opponent-frequency inference follows. An earlier-street equity calculation must additionally account for legal future boards. Product export conventions may differ.
