函数名:stats_stat_binomial_coef()
适用版本:PHP 7.2.0 及以上版本
用法:stats_stat_binomial_coef() 函数用于计算二项式系数(binomial coefficient),即在给定的 n 次试验中,成功出现 k 次的可能性的数量。
语法:float stats_stat_binomial_coef( int $n, int $k )
参数:
返回值:
示例:
$n = 10;
$k = 3;
$coef = stats_stat_binomial_coef($n, $k);
echo "在 {$n} 次试验中成功出现 {$k} 次的可能性数量为 {$coef}。";
输出: 在 10 次试验中成功出现 3 次的可能性数量为 120.0。
注意事项: