Combinatorics deals with finite sets (i.e. the sets are enumerable) and belongs to the subfield of discrete maths.

Cardinality

The cardinality of a set is the number of elements in .
We denote the cardinality of by , also denoted by or .

Link to original

Additivity of cardinality

For two disjoint sets , the cardinality of their union is the sum of the cardinalities.

For nondisjoint sets, you need the inclusion-exclusion principle to remove the double counting of the intersection.

The product of the cardinalities of two sets is the cardinality of the cartesian product.

If there is a bijection between two sets, they have the same cardinality.

bijective

Sampling elements from choices

When order matters:

With replacement:
Without replacement: (pool gets smaller with each sample)

When order doesn’t matter:
(binomial coefficient = “selection from a partial multiset”)

The above but with more words:

permutations: How many ways are there to arrange all elements of ?

, bijective permutation function


(exactly what we had in (ii) above)

Permutation notation

We can denote the permutation in three ways:
(1) Two rows – the first row is the original order, the second row is the new order:
, e.g.:
(2) or we just take the second row: ,
(3) or we take the cycle notation: , i.e. .
Each group is its own cycle – no duplicates / loops (else it wouldn’t be bijective which is a requirement for a permutation).

Link to original
^b4a0f0

inclusion-exclusion principle

The inclusion -exclusion principle gives a way to compute the size of the union of multiple non-disjoint sets.


Inclusion-Exclusion Principle

EXAMPLE

alphabet , set of words (order matters), , empty word .
, length
… how big is the set of words containing ?
… words that don’t contain
…???

Link to original