# Combinatorial Probability

Basic combinatorial probability focuses on computing probabilities of events associated with finite or countable discrete structures. This page will focus primarily on urn problems which are elementary combinatorial probability problems involving basic enumerative techniques. These urn problems and their solutions serve as a template for attacking other problems involving discrete random variables and their associated events.

## Permutations

The notion of permutation relates to the act of arranging all the members of a set into some sequence or order, or if the set is already ordered, rearranging (reordering) its elements, a process called permuting. These differ from combinations, which are selections of some members of a set where order is disregarded. For example, written as tuples, there are six permutations of the set {1,2,3}, namely: (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), and (3,2,1). These are all the possible orderings of this three element set. As another example, an anagram of a word, all of whose letters are different, is a permutation of its letters. In this example, the letters are already ordered in the original word and the anagram is a reordering of the letters.

The number of permutations of $n$ distinct objects is $n!$, which means the product of all positive integers less than or equal to $n$.

### Permutations with repetition

Ordered arrangements of the elements of a set $S$ of length $n$ where repetition is allowed are called $n$-tuples, but have sometimes been referred to as permutations with repetition although they are not permutations in general. They are also called words over the alphabet $S$ in some contexts. If the set $S$ has $k$ elements, the number of $n$-tuples over $S$ is $k^n$. There is no restriction on how often an element can appear in an $n$-tuple, but if restrictions are placed on how often an element can appear, this formula is no longer valid.

## Combinations

A combination is a way of selecting items from a collection, such that (unlike permutations) the order of selection does not matter. In smaller cases it is possible to count the number of combinations. 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$. If the set has $n$ elements, the number of $k$-combinations is equal to the binomial coefficient

[$] \binom nk = \frac{n(n-1)\dotsb(n-k+1)}{k(k-1)\dotsb1}[$]

, which can be written using factorials as $\textstyle\frac{n!}{k!(n-k)!}$ whenever $k\leq n$, and which is zero when $k \gt n$. The set of all $k$-combinations of a set $S$ is sometimes denoted by $\textstyle\binom Sk\,$.

Combinations refer to the combination of $n$ things taken $k$ at a time without repetition. To refer to combinations in which repetition is allowed, the terms $k$-selection,[1] $k$-multiset,[2] or $k$-combination with repetition are often used.[3] If, in the above example, it was 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, with large sets this becomes impractical. 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 $C^n_k$, ${}_nC_k$, ${}^nC_k$, $C_{n,k}$ or even $C_n^k$ (the latter form was standard in French, Romanian, Russian, Chinese[4] and Polish texts). The same number however occurs in many other mathematical contexts, where it is denoted by $\tbinom 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 $\tbinom nk$ for all natural numbers $k$ at once by the relation

[$](1+X)^n=\sum_{k\geq0}\binom nk X^k[$]

, from which it is clear that $\tbinom n0=\tbinom nn=1$ and $\tbinom nk=0$ for $k \gt n$. To see that these coefficients count $k$-combinations from $S$, one can first consider a collection of $n$ distinct variables $X$$S$ labeled by the elements $S$ of $S$, and expand the product over all elements of $S$:

[$]\prod_{s\in S}(1+X_s)[$]

It has $2^n$ distinct terms corresponding to all the subsets of $S$, each subset giving the product of the corresponding variables $X_S$. Now setting all of the $X_S$ equal to the unlabeled variable $X$, so that the product becomes $(1 + X)^n$, the term for each $k$-combination from $S$ becomes $X^k$, 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

[$]\binom nk=\binom{n-1}{k-1}+\binom{n-1}k[$]

, for 0 < $k \lt 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

[$]\binom nk = \frac{n(n-1)(n-2)\cdots(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

[$] \binom nk = \binom n{n-k}[$]

, for $0 \leq k \leq 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:

[$] \binom nk = \frac{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 inferior as a method of computation to 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:

[$] \binom nk = \begin{cases} \binom n{k-1} \frac {n-k+1}k &\quad \text{if } k \gt 0 \\ \binom {n-1}k \frac n{n-k} &\quad \text{if } k \lt n \\ \binom {n-1}{k-1} \frac nk &\quad \text{if } n, k \gt 0 \end{cases} [$]

Together with the basic cases $\tbinom n0=1=\tbinom 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$.

## Urn Problems

An urn problem is an idealized mental exercise in which some objects of real interest (such as atoms, people, cars, etc.) are represented as colored balls in an urn or other container. One pretends to remove one or more balls from the urn; the goal is to determine the probability of drawing one color or another, or some other properties.

In this basic urn model in probability theory, the urn contains $x$ green and $y$ red balls, well-mixed together. One ball is drawn randomly from the urn and its color observed; it is then placed back in the urn (or not), and the selection process is repeated.

Possible questions that can be answered in this model are:

• Can I infer the proportion of green and red balls from $n$ observations? With what degree of confidence?
• Knowing $x$ and $y$, what is the probability of drawing a specific sequence (e.g. one green followed by one red)?
• If I only observe $n$ balls, how sure can I be that there are no green balls? (A variation on the first question)

### Example: number of successful draws (trials)

Assume the basic urn model (as described above). If $X$ denotes the number of green balls (successes) drawn from $n$ draws with replacement and $p$ denotes the probability of drawing a green ball from a single draw, then

[$] $$\label{urn-example-binomial} \operatorname{P}(X = k) = \binom{n}{k} p^k (1-p)^{n-k}.$$ [$]

The probability distribution described by \ref{urn-example-binomial} is the binomial distribution.

### Example: number of successful draws with multiple colors

Suppose we have an urn with colored balls and the number of distinct colors is $k$. One can think of the colors as categorizing the balls into $k$ different categories and we can index the colors: color 1, color 2,...,color $k$. What is the probability of drawing $x_i$ balls of color $i (i=1,\ldots,k)$ given $n$ total draws with replacement ? If $X_i$ is the random variable representing the number of balls drawn of color $i$ and $p_i$ denotes the probability of drawing a ball of color $i$ on a single draw, then

[$] $$\label{urn-example-multinomial} \operatorname{P}[X_1= x_1,\ldots,X_n = x_n] = \frac{n!}{x_1!\cdots x_k!} p_1^{x_1} \cdots p_k^{x_k}.$$ [$]

The probability distribution described by \ref{urn-example-multinomial} is called a multinomial distribution.

### Example: drawing without replacement

Define drawing a green ball as a success and drawing a red ball as a failure. If the variable $N$ describes the number of all marbles in the urn (see contingency table below) and $K$ describes the number of green marbles, then $N-K$ corresponds to the number of red marbles. In this example, $X$ is the random variable whose outcome is $k$, the number of green marbles actually drawn in the experiment. This situation is illustrated by the following contingency table:

drawn not drawn total
green marbles $k$ $K-k$ $K$
red marbles $n-k$ $N - K - n + k$ $N − K$
total $n$ $N − n$ $N$

Now, assume (for example) that there are 5 green and 45 red marbles in the urn. Standing next to the urn, you close your eyes and draw 10 marbles without replacement. What is the probability that exactly 4 of the 10 are green?

This problem is summarized by the following contingency table:

drawn not drawn total
green marbles $k$ = 4 $K-k$ = 1 $K$ = 5
red marbles $n − k$ = 6 $N - K - n + k$ = 39 $N − K$ = 45
total $n$ = 10 $N − n$ = 40 $N$ = 50

Generally speaking, the probability of drawing exactly $k$ green marbles can be calculated by the formula:

[$] $$\label{urn-example-hyper} \operatorname{P}(X=k) ={{{K \choose k} {{N-K} \choose {n-k}}}\over {N \choose n}}.$$ [$]

The probability distribution described by \ref{urn-example-hyper} is called a hypergeometric distribution.

### Example: first successful draw

Suppose that we have an urn with green and red balls. If $X$ denotes the smallest number of draws with replacement until one sees a green ball (a success), then

[$] $$\label{urn-example-geom} \operatorname{P}(X = k) = (1-p)^{k-1}p.$$ [$]

The probability distribution described by \ref{urn-example-geom} is a geometric distribution.

## Notes

1. Ryser 1963, p. 7 also referred to as an unordered selection.
2. Mazur 2010, p. 10
3. When the term combination is used to refer to either situation (as in (Brualdi 2010)) care must be taken to clarify whether sets or multisets are being discussed.
4. High School Textbook for full-time student (Required) Mathematics Book II B (in Chinese) (2nd ed.). China: People's Education Press. June 2006. pp. 107–116. ISBN 978-7-107-19616-4.CS1 maint: unrecognized language (link)

## References

• Wikipedia contributors. "Combination". Wikipedia. Wikipedia. Retrieved 28 January 2022.
• Wikipedia contributors. "Permutation". Wikipedia. Wikipedia. Retrieved 28 January 2022.
• Wikipedia contributors. "Urn problem". Wikipedia. Wikipedia. Retrieved 28 January 2022.