comb: comb: Calculate Number of Combinations C(n, k)
Description
Calculates the total number of ways to choose k items from n distinct items (without regard to order),
i.e., the number of combinations C(n, k) = n! / (k! * (n - k)!).
This function is intended for moderate n and k. For very large values, consider the 'gmp' package.
Usage
comb(n, k)
Value
Numeric. The combination count C(n, k) (returns Inf for very large n).
Arguments
n
Integer. Total number of items (non-negative integer).
k
Integer. Number of items to choose (non-negative integer, must be <= n).