Reference · Rolls and exact odds
expectedHighestfunction
The average of the highest total among several throws of a roll. Exact: the highest is at most t when every throw is.
Import it
import { expectedHighest } from "@johnmorrisdotca/korokoro";
Definition
function expectedHighest(spec: Odds, times: number): number
Parameters
| Name | Type | Description |
|---|---|---|
spec | Odds | Dice counts, sides, rules and modifier; omitted fields use the documented defaults. |
times | number | The number of independent repeats. |
Returns
number
The average of the highest total among several throws of a roll. Exact: the highest is at most t when every throw is.
Examples
import { expectedHighest } from "@johnmorrisdotca/korokoro";
import { normalizeSpec } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
console.log(expectedHighest(spec, 3));9.057870370370377What it prints (run when this page was built)