本文へ移動

Korokoroコロコロ

ダイスを組み合わせて振り、ダイス表記を読み取り、正確な確率を調べます。履歴の保存やシードを指定した再現もできます。

「コロコロ」は、小さなものが転がる様子を表す言葉です。 名前について(英語)

目次

リファレンス · ロールと正確な確率

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

引数

名前型説明
countsreadonly 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

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/korokoro 1.16.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。