Counting functions
\[\#(A\to B)=n^m,\qquad \#\text{one-one}=\frac{n!}{(n-m)!}\ (m\le n)\]
Bijections from an \(n\)-element set to itself: \(n!\). Onto functions from an \(m\)-set onto a 2-element set: \(2^m-2\).
Relations and Functions
A function \(f:A\to B\) assigns to every element of the domain \(A\) exactly one element of the codomain \(B\). The set of outputs actually produced is the range.
| Type | Meaning | Test |
|---|---|---|
| One-one (injective) | Different inputs give different outputs | Assume \(f(x_1)=f(x_2)\) and prove \(x_1=x_2\) |
| Onto (surjective) | Every element of the codomain is an output | Take any \(y\in B\), solve \(f(x)=y\) with \(x\in A\) |
| Bijective | Both one-one and onto | Both tests |
The same rule can change type when the domain or codomain changes: \(f(x)=x^2\) is neither one-one nor onto on \(\mathbb{R}\to\mathbb{R}\), but it is a bijection from \([0,\infty)\) to \([0,\infty)\).
Graphically, a function is one-one when every horizontal line meets its graph at most once, and onto when every horizontal line at a height in the codomain meets it at least once.
If \(n(A)=m\) and \(n(B)=n\): there are \(n^m\) functions from \(A\) to \(B\); \(n(n-1)\cdots(n-m+1)\) of them are one-one (needs \(m\le n\)); and there are \(n!\) bijections from a set with \(n\) elements to itself. A finite set function \(f:A\to A\) is one-one exactly when it is onto.
\[\#(A\to B)=n^m,\qquad \#\text{one-one}=\frac{n!}{(n-m)!}\ (m\le n)\]
Bijections from an \(n\)-element set to itself: \(n!\). Onto functions from an \(m\)-set onto a 2-element set: \(2^m-2\).
\(x\mapsto x^2\): neither on \(\mathbb{R}\to\mathbb{R}\); one-one but not onto on \(\mathbb{N}\to\mathbb{N}\); bijective on \([0,\infty)\to[0,\infty)\).
One-one: every horizontal line cuts the graph at most once. Onto: every horizontal line at a codomain height cuts it at least once.
Onto depends on the codomain: \(e^x\) is not onto \(\mathbb{R}\) because negative numbers and 0 are never outputs.
Showing two particular inputs give different outputs proves nothing; you must start from f(x₁) = f(x₂) in general.
Show \(f:\mathbb{R}\to\mathbb{R},\ f(x)=5-2x\) is bijective.
One-one: \(5-2x_1=5-2x_2\Rightarrow x_1=x_2\). Onto: for any \(y\), \(x=\frac{5-y}{2}\in\mathbb{R}\) gives \(f(x)=y\). Hence bijective.
A fresh set of questions from this topic. Change answers freely – solutions appear after you submit.
Start PracticeDecide one-one by solving f(x₁) = f(x₂); decide onto by solving f(x) = y inside the domain. Always read the domain and codomain first.
Create a free account to take practice sessions and tests, see detailed explanations and track your progress.