fairnessTest関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Is this die fair? A chi-square goodness-of-fit test of how often each face
came up (counts[i] for the i-th face) against a fair die, or against
chances when the die is supposed to be something else. It makes no roll:
the counts can come from a history here or from a real die on a real table.
インポート
import { fairnessTest } from "@johnmorrisdotca/korokoro";
定義
function fairnessTest(counts: readonly number[], chances?: readonly number[]): Fairness
引数
| 名前 | 型 | 説明 |
|---|---|---|
counts | readonly number[] | Observed counts in face order. |
chances (省略可) | readonly number[] | undefined | Expected face probabilities; uniform when omitted. |
戻り値
Fairness
Is this die fair? A chi-square goodness-of-fit test of how often each face came up (counts[i] for the i-th face) against a fair die, or against chances when the die is supposed to be something else. It makes no roll: the counts can come from a history here or from a real die on a real table.
例
import { fairnessTest } from "@johnmorrisdotca/korokoro";
console.log(fairnessTest([30, 30, 30, 30, 30, 30]).enough);true出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。