Previous Up Next

2.7.2  Binomial coefficients : binomial comb nCr

comb or nCr or binomial takes as argument two integers n and p.
comb(n,p) or nCr(n,p) or binomial(n,p) returns (pn) =Cnp.
Input :

comb(5,2)

Output :

10

Remark
binomial (unlike comb, nCr) may have a third real argument, in this case binomial(n,p,a) returns (pn) ap(1−a)np.


Previous Up Next