Some example functions [009T]
- March 9, 2026
Example [009U]
- March 9, 2026
Let \mathrm {Shp} = \{ \diamond , \triangle , \square \}. Now define a function g : \mathrm {Shp} \to \mathbb {N} by \begin {align*} g(\diamond ) &= 6 \\ g(\triangle ) &= 6 \\ g(\square ) &= 32. \end {align*} This is a valid function since every element of \mathrm {Shp} is assigned to exactly one element of \mathbb {N}. The domain of g is \mathrm {Shp}, the codomain is \mathbb {N}, and the range of g is the set \{6,32\}.
Example [009V]
- March 9, 2026
Let h : \mathbb {N} \to \mathbb {N} be defined by h(n) = 2n. The domain and codomain of h are both \mathbb {N}; the range is the set of all even natural numbers.
Example [009W]
- March 9, 2026
Let \ell : \mathbb {N} \to \mathrm {Shp} be the function which sends all multiples of 3 to \diamond , all numbers which are one more than a multiple of 3 to \triangle , and all which are two more than a multiple of 3 to \square . That is, \begin {align*} \ell (3n) &= \diamond \\ \ell (3n+1) &= \triangle \\ \ell (3n+2) &= \square \end {align*} This is a valid function since every natural number falls into exactly one of these three cases.