Counting Theorems

Basic Counting Properties

Number of subsets of a set with size n (power set)

(n0)+(n1)+(n2)+ ... +(nn)=k=0n(nk)=2n

Left side is equal to 2n by Bijection

Pascal's Identity

For any integer n and 0k<n

(nk)=(n1k1)+(n1k)(nk)(n1k)=(n1k1)

(n1k1) counts the subsets with one element already selected

(n1k) counts all subsets where that same element cannot be selected

As they are 2 separate scenarios, we add the possibilities (Sum Rule)

Binomial Theorem

(x+y)n=k=0n(nk)xkynk=k=0n(nk)xnkyk

For example

(x+y)4=x0y4+4x1y3+6x2y2+4x3y1+x4y0

Therefore the coefficient for xk is (nk)=(nnk)

Vandermonde's (Zhu Shijie's) Identity

(m+nr)=k=0r(mk)(nrk)

(m+nr) is the coefficient of yr when expanding (1+y)m+n

(1+y)m+n=(1+y)m(1+y)n=()

Generalized for any number of ns

\begin{pmatrix} n_1+...+n_p\\r \end{pmatrix}=\sum_{k_1+...+k_p=r}^r\begin{pmatrix} n_1\\k_1 \end{pmatrix}\begin{pmatrix} n_2\\k_2 \end{pmatrix}\begin{pmatrix} n_p\\k_p \end{pmatrix}$$= $\begin{pmatrix} r+p-1\\p-1 \end{pmatrix}$ = multiset with p groups of r # Inclusion/Exclusion Principle - sets = no repeated elements - $|A|+|B| =|A\cup B|-|A\cap B| = |A|+|B|-|AB|$ - $$|A_1\cup A_2\ \cup\ ...\ \cup\ A_n|= \sum_{S\neq 0,S\subseteq\{1,...,n\}}(-1)^{|S|-1}|A_S|

Others

n2(2n2n2)=j=1nj(nj)(nj)2