Exercise 1.11

Let A and B be sets with |A| = n, |B| = m.

(a)
How many functions are there from A to B (i.e., functions with domain A, assigning an element of B to each element of A)?
(b)
How many one-to-one functions are there from A to B? (See Section A.2.1 of the math appendix for information about one-to-one functions.)

Answers

(a)
Each of the n inputs has m choices for an output, resulting in mn

possible functions.

(b)
If n < m, at least two inputs will be mapped to the same output, so no one-to-one function is possible.

If n m, the first input has m choices, the second input has m 1 choices, and so on. The total number of one-to-one functions then is

m(m 1)(m 2)(m n + 1)

User profile picture
2021-12-05 00:00
Comments