Bijection Theorem

If there is a bijection from $A$ to $B$, then $|A| = |B|$.

The Sum Rule

If there are $n(A )$ ways to do $A$ and distinct from them $n(B)$ ways to do $B$, then the number of ways to do $A$ or $B$ is $n(A) + n(B)$.

The Product Rule

If there are $n(A)$ ways to do $A$ and $n(B)$ ways to do $B$, then the number of ways to do $A$ and $B$ is $n(A) \times n(B)$.

Example 3: If there are $n$ Senators on a committee, in how many ways can a subcommittee be formed?

There are many ways to solve this question.

  1. Let $N_1$ be the number of subcommittees with 1 senator $(n)$, $N_2$ be the number of subcommittees with 2 senator $(n(n-1)/2)$.

    According to the sum rule:

    $N = n_1 + N_2 + \dots + N_n$.

    It turns out that $N_k = \frac{n!}{k!(n-k)!}$ ($n$ choose $k$). This will be proved later.

  2. Every subcommittee can be uniquely represented by a binary string. The number of unique binary strings there are is the number of possible subcommittees. We can use the product rule. $01011$. There are $2^n$ subcommittees if we allow subcommittees of size $0$ and $n$.

Claim: $\mathcal{P}(S)$ has $2^{|S|}$ elements.

Proof. By induction on $|S|$.

Base case: If $|S| = 0$, then $S = \emptyset$.

Inductive Step: Suppose $S + \{a_1,\dots,a_{n+1}\}$. Let $S' = \{a_1,\dots,a_{n}\}$. By the induction hypothesis, $|\mathcal{P}(S')|=2^n$. Partition $\mathcal{P}(S)$ into two subsets:

$A=$ the subsets of $S$ that don't contain $a_{n+1}$.

$B=$ the subsets of $S$ that do contain $a_{n+1}$.

It's easy to see that $A=\mathcal{P}(S')$: $T$ is a subset of $S$ that doesn't contain $a_{n+1}$ if and only if $T$ is a subset of $S'$.

Example 4: How many legal configurations are there in Towers of Hanoi with $n$ rings?

There are $3^n$. There is a bijection between strings of votes and legal configurations. Each ring has $3$ possible configurations, so there are $3^n$ ways to order the rings.

Example 5: How many distinguishable ways can the letters of "computer" be arranged? How about "discrete"?

There are $8!$ ways to arrange the letters of computer by the product rule.