Follow

うちの計算式 

$p = 0.1;
$q = 1 - $p;

$maxFails = 5;

$F = array_fill(0, $maxFails + 1, 0);

$F[5] = 1;

for ($i = $maxFails - 1; $i >= 0; $i--) {
$F[$i] = $p * 1 + $q * (1 + $F[$i + 1]);
}

echo "9→10の期待試行回数: " . round($F[0], 5) . " 回\n";

大体同じ数字

· · Web · 0 · 1 · 0
Sign in to participate in the conversation
RO丼 - RO Mastodon

ラグナロクオンラインユーザ向けのMastodonインスタンス。