标签: r binomial-coefficients gamma-distribution
我正在尝试创建一个计算二项式公式的函数,但我不断收到错误“gamma fn中的值超出范围”
mything <- function(x, n, p) { a = choose(n, x) b = p^x c = (1 - p)^(n - x) d = a * b * c return(d) } mything(20, 2000, 0.01)