|
comb(n,r)
Returns the number of combinations of n elements taken r at
a time (0 ≤ r ≤ n). Use comb to determine the total possible
number of groups for a given number of items. A combina-
tion is any set or subset of items, regardless of their order.
Combinations are distinct from permutations, for which the
order is significant. comb(n,r) also is known as the binomial
coefficient and is read “n choose r”. The number of combina-
tions is n!/(r!(n–r)!) where n and r are integers and the symbol
! denotes a factorial. comb(n,r) is the same as fact(n)/
(fact(r)*(fact(n-r)) . See also: fact (p. 66), perm (p. 115).
Examples:
comb(8,0) → 1.
comb(8,1) → 8.
comb(8,2) → 28.
comb(8,6) → 28.
comb(8,8) → 1.
|