Skip to main content

rangeWeightTopKMass

Return the normalized probability mass held by the top weighted combos.

rangeWeightTopKMass(range: SparseRangeSpec | Float64Array, k: number): number

See Packed card input and SparseRangeSpec where those inputs apply.

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

Use rangeWeightTopKMass when you need to return the normalized probability mass held by the top weighted combos.

How to use

const poker = require('poker-calculations');
const range = new Float64Array(1326);
range.fill(1 / 1326);

const result = poker.rangeWeightTopKMass(range, 5);
console.log(result);

See also

materializeVillainRangeAfterBlockers · Sparse range input