7.1 Functions Defined on General Sets
Definitions
- Function f from a set X to a set Y, denoted f: X → Y, is
a relation from X, the domain of f, to Y, the co-domain
of f, that satisfies two properties: (1) every element X is
related to some element in Y, and (2) no element in X is related
to more than one element in Y.
- Range of f = image of X under f = {y ∈ Y | y = f(x),
for some x in X}
- Inverse image of y = {x ∈ X | f(x) = y}
Theorem 7.1.1 A Test for Function Equality
- If F: X → Y and G: X → Y are functions, then F = G
if and only if F(x) = G(x) for every x ∈ X
Example Functions
- Identity Function: IX(x) = x for each x in X
- Multiply Function: M(a, b) = a*b for each a in R and for each b in R
- Hamming Distance Function: Let Sn be the set of all strings of
0's and 1's of length n. Define H: Sn × Sn →
Znonneg as follows: For each pair of strings (s, t) ∈
Sn × Sn, H(s,t) = the number of positions
where s and t have different values.
- (n-place) Boolean function: f is a function whose domain
is the set of all ordered n-tuples of 0's and 1's and whose co-domain
is the set {0, 1}. In other words, f: {0,1}n → {0,1}.
In Class Exercises
Exercise 1
Let X = {1, 3, 5} and Y = {s, t, u, v}. Define f: X → Y by the
following set of ordered pairs {(1, v), (3, s), (5, v)}.
- Draw an arrow diagram.
- Find f(3).
- What is the range of f?
- Is 3 an inverse image of s?
Exercise 6a
Define a function on the set of nonnegative integers that can be used
to define this sequence: 1, -1/3, 1/5, -1/7, 1/9, ...
Exercise 11b
Define F: Z × Z → Z × Z as follows: For every
ordered pair (a,b) of integers, F(a,b) = (2a+1, 3b-2). Find F(2,1).
Exercise 29a
Find the Hamming Distance H(10101, 00011)
Exercise 30a
Draw an arrow diagram for the following boolean function:
F(0,0) = 1, F(0,1) = 0, F(1,0) = 1, F(1,1) = 0
Exercise 33
Show that g: Q → Z defined by the rule g(m/n) = m - n
for all integers m and n with n ≠ 0 is not a function.