exactHeroCategoryJointFlopToRiver
Joint distribution of hero hand category on the turn and category on the river after enumerating all turn/river runouts from a fixed flop.
jointMatrix has length 81; index catTurn * 9 + catRiver for categories 0..8. See Packed card input.
Import
const poker = require('poker-calculations');
ESM (Node):
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
const poker = require('poker-calculations');
When to use
You need the exact flop→river category joint (not Monte Carlo) — for study charts, backend aggregation, or comparing how often hero improves or regresses by category on a fixed flop.
How to use
const poker = require('poker-calculations');
const hero = ['Ah', 'Kh'];
const flop = ['Qh', 'Jh', '2c'];
const { jointMatrix } = poker.exactHeroCategoryJointFlopToRiver(hero, flop);
console.log('Matrix length:', jointMatrix.length);
console.log('P(turn cat 0, river cat 0):', jointMatrix[0]);
console.log('Sum (should be ~1):', [...jointMatrix].reduce((a, b) => a + b, 0));
The second argument must be exactly three flop cards (not a four-card turn board). Optional knownDead removes extra cards from the deck before enumeration.
Return type
{ jointMatrix: Float64Array } — length 81, entries are probabilities summing to 1 over enumerated runouts.
See also
exactHeroRunoutVulnerability · exactHeroEquityRunoutQuantiles · Tournament, runouts, and bots