- . , .
, - . , 171! , . , .
- :
B (, ) = (-1)! (-1)!/( + - 1)!
, , , ; . , , , , , .
, , :
to-report betafunc [alpha beta]
ifelse (alpha >= beta)
[let v1 (factorial (beta - 1) (0))
let v2 (factorial (alpha + beta - 1) (alpha - 1))
report (v1 / v2)]
[let v1 (factorial (alpha - 1) (0))
let v2 (factorial (alpha + beta - 1) (beta - 1))
report (v1 / v2)]
end
to-report factorial [n m]
if (n = m) [report 1]
report (n * factorial (n - 1) (m))
end
, . , .
, (5! 8!)/(12)!
(1,6). (1,7/11). (1,7/11). (3,6/10)... (1.4/8). (1.3/7)... (1.1/5) (1.1/4)... (1.1/1)
, , . :
to-report stepwisefactorial3 [n1 n2 d]
if (n1 = 0) [report stepwisefactorial2 (n2) (d)]
if (n2 = 0) [report stepwisefactorial2 (n1) (d)]
if (d = 0) [report (stepwisefactorial1 (n1) * stepwisefactorial1 (n2))]
report ((((n1 * n2) / d)) * stepwisefactorial3 (n1 - 1) (n2 - 1) (d - 1))
end
to-report stepwisefactorial2 [n d]
if (n = 0) [report (1 / (stepwisefactorial1 (d)))]
if (d = 0) [report stepwisefactorial1 (n)]
report ((n / d)* stepwisefactorial2 (n - 1) (d - 1))
end
to-report stepwisefactorial1 [d]
if d = 0 [ report 1 ]
report d * stepwisefactorial1 (d - 1)
end
, + a > 345; .
, !