Combinatorics

Permutation

n! = 1 * 2 * ... * n

For example, the permutations of the set {a,b,c} are 3!=6: abc, bac ,bca, cab, cba, acb.

Combination

The number of k-combinations (each of size k) from a set S with n elements (size n) is the binomial coefficient:

C(n,k)=(n!) / (k!(n - k)!)

where n is the number of objects from which you can choose and k is the number to be chosen.

For example, the combinations of the set {a,b,c,d} with 2 elements are 4!/(2!2!)=6: ab, ac, ad, bc, bd, cd.

algorithms/combinatorics.txt · Last modified: 2010/08/10 (external edit)
CC Attribution-Noncommercial-Share Alike 3.0 Unported
Valid CSS Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0