Fairness型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What a fairness test makes of a die.
インポート
import type { Fairness } from "@johnmorrisdotca/korokoro";
定義
type Fairness = {
sides: number;
rolls: number;
minimum: number;
enough: boolean;
expected: number[];
statistic: number | null;
p: number | null;
verdict: "too-few" | "fair" | "unusual" | "lopsided";
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
sides | number | How many faces the die has. |
rolls | number | How many throws were counted. |
minimum | number | How many throws the test wants before it will pronounce: five for each face. |
enough | boolean | Whether there were that many. |
expected | number[] | How often each face should have come up, if the die is what it is tested against. |
statistic | number | null | The chi-square statistic: how far the counts stray from that, in all. Null with too few throws. |
p | number | null | The chance that a die as supposed strays this far or further. Null with too few throws: never a guess. |
verdict | "fair" | "too-few" | "unusual" | "lopsided" | The reading. |
例
import type { Fairness } from "@johnmorrisdotca/korokoro";
import { fairnessTest } from "@johnmorrisdotca/korokoro";
const value: Fairness = fairnessTest([30, 30, 30, 30, 30, 30]);
console.log(value.enough);true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。