Learn/Combinatorics/Functions Between Sets
Combinatorics • Topic 7

Functions Between Sets

In combinatorics, we often count the number of functions between two finite sets satisfying specific properties (like injectivity or surjectivity).

Basic Counting

Let and be finite sets with and .

Theorem (Total Functions)
The total number of functions is .

Proof. For each of the elements in , there are choices in . .

Counting Injections (One-to-One)

An injection requires that distinct inputs map to distinct outputs. This is only possible if .
Theorem (Number of Injections)
The number of injective functions is:

Counting Surjections (Onto)

Counting surjections is harder and typically requires the Principle of Inclusion-Exclusion or Stirling numbers of the second kind.

Counting Bijections

If , a function is a bijection if and only if it is an injection (or surjection).
Theorem (Number of Bijections)
The number of bijections from a set of size to itself is .

Practice Problems

Exercise (Problem 1)
How many functions are there? How many are injective?
Exercise (Problem 2)
Let and . What is the probability that a random function is strictly increasing?
Exercise (Problem 3)
Explain why there are no surjective functions from a set of size 3 to a set of size 4.