combinations()
Calculates the number of combinations that can be achieved by drawing k elements from n elements available.
syntax
combinations ( n: integer, k: integer) : integer
Calculates the number of possible combinations, counting any combination just once regardless of order. If you need to count every possible combination concerning order, see permutations().
parameters
n | the set the elements are drawn from |
k | the number of elements drawn |
return
number of possible combinations regardless of order
example
Find the number of two-people-combinations out of a set of three people available:
combinations ( 3, 2 )
returns 3.