In mathematics, a combination is a selection of items from a set that has distinct members, such that the order of selection does not matter (unlike permutations). For example, given three fruits, say an apple, an orange and a pear, there are three combinations of two that can be drawn from this set: an apple and a pear; an apple and an orange; or a pear and an orange. More formally, a k-combination of a set S is a subset of k distinct elements of S. So, two combinations are identical if and only if each combination has the same members. (The arrangement of the members in each set does not matter.) If the set has n elements, the number of k-combinations, denoted by C(n,k) or Ckn, is equal to the binomial coefficient: (nk)=n(n−1)⋯(n−k+1)k(k−1)⋯1, which using factorial notation can be compactly expressed as (nk)=n!k!(n−k)! whenever n≥k≥0. This formula can be derived from the fact that each k-combination of a set S of n members has k! permutations so Pkn=Ckn×k! or Ckn=Pkn/k!. The set of all k-combinations of a set S is often denoted by (Sk). A combination is a selection of n things taken k at a time without repetition. To refer to combinations in which repetition is allowed, the terms k-combination with repetition, k-multiset, or k-selection, are often used. If, in the above example, it were possible to have two of any one kind of fruit there would be 3 more 2-selections: one with two apples, one with two oranges, and one with two pears. Although the set of three fruits was small enough to write a complete list of combinations, this becomes impractical as the size of the set increases. For example, a poker hand can be described as a 5-combination (k = 5) of cards from a 52 card deck (n = 52). The 5 cards of the hand are all distinct, and the order of cards in the hand does not matter. There are 2,598,960 such combinations, and the chance of drawing any one hand at random is 1 / 2,598,960.
Number of k-combinations
The number of k-combinations from a given set S of n elements is often denoted in elementary combinatorics texts by C(n,k), or by a variation such as Ckn, nCk, nCk, Cn,k or even Cnk. The same number however occurs in many other mathematical contexts, where it is denoted by (nk) (often read as "n choose k"); notably it occurs as a coefficient in the binomial formula, hence its name binomial coefficient. One can define (nk) for all natural numbers k at once by the relation (1+X)n=∑k≥0(nk)Xk, from which it is clear that (n0)=(nn)=1, and further (nk)=0 for k>n. To see that these coefficients count k-combinations from S, one can first consider a collection of n distinct variables Xs labeled by the elements s of S, and expand the product over all elements of S: ∏s∈S(1+Xs); it has 2n distinct terms corresponding to all the subsets of S, each subset giving the product of the corresponding variables Xs. Now setting all of the Xs equal to the unlabeled variable X, so that the product becomes (1 + X)n, the term for each k-combination from S becomes Xk, so that the coefficient of that power in the result equals the number of such k-combinations. Binomial coefficients can be computed explicitly in various ways. To get all of them for the expansions up to (1 + X)n, one can use (in addition to the basic cases already given) the recursion relation (nk)=(n−1k−1)+(n−1k), for 0 < k < n, which follows from (1 + X)n = (1 + X)n − 1(1 + X); this leads to the construction of Pascal's triangle. For determining an individual binomial coefficient, it is more practical to use the formula (nk)=n(n−1)(n−2)⋯(n−k+1)k!. The numerator gives the number of k-permutations of n, i.e., of sequences of k distinct elements of S, while the denominator gives the number of such k-permutations that give the same k-combination when the order is ignored. When k exceeds n/2, the above formula contains factors common to the numerator and the denominator, and canceling them out gives the relation (nk)=(nn−k), for 0 ≤ k ≤ n. This expresses a symmetry that is evident from the binomial formula, and can also be understood in terms of k-combinations by taking the complement of such a combination, which is an (n − k)-combination. Finally there is a formula which exhibits this symmetry directly, and has the merit of being easy to remember: (nk)=n!k!(n−k)!, where n! denotes the factorial of n. It is obtained from the previous formula by multiplying denominator and numerator by (n − k)!, so it is certainly computationally less efficient than that formula. The last formula can be understood directly, by considering the n! permutations of all the elements of S. Each such permutation gives a k-combination by selecting its first k elements. There are many duplicate selections: any combined permutation of the first k elements among each other, and of the final (n − k) elements among each other produces the same combination; this explains the division in the formula. From the above formulas follow relations between adjacent numbers in Pascal's triangle in all three directions: (nk)={(nk−1)n−k+1kif k>0(n−1k)nn−kif k<n(n−1k−1)nkif n,k>0. Together with the basic cases (n0)=1=(nn), these allow successive computation of respectively all numbers of combinations from the same set (a row in Pascal's triangle), of k-combinations of sets of growing sizes, and of combinations with a complement of fixed size n − k.
… excerpt ends here. Continue reading the full article.

