03_Functions
03_Functions
= WEEK 3 =
ORDERED PAIRS AND CARTESIAN
PRODUCTS
• Let A and B be sets. The Cartesian product of A and B, denoted by
AB, consists of all ordered pairs (a,b) where a A and b B. More
concisely, AB = {(a,b)| a A, b B}. Note: 1) AB is read “A cross
B”, 2) In (a,b), a and b are called the first element and the second
element, respectively, 3) Two ordered pairs (a,b) and (c,d) are equal if
and only if a=c and b=d.
• Example 1: If A={1,0} and B={-2,0,1} then AB = {(1,-2), (1,0), (1,1),
(0,-2), (0,0), (0,1)} and BA ={(-2,1), (-2,0), (0,1), (0,0), (1,1), (1,0)}.
• Example 2: If F = {1,-1} then FF = {(1,1), (1,-1), (-1,1), (-1,-1)}
• Question: In Example 2, what is F? (Recall that is the empty
set.)
RELATIONS (1)
• A relation R from A to B is a subset of AB.
• Example 1: Let A={1,0}, B={-2,0,1} and R = {(1,0), (1,1), (0,-2), (0,1)}. As R AB,
R is a relation from A to B.
• Example 2: Let A={1, 2, 3}, B = {3, 4, 6, 8}, and K = {(x,y) AB| y = x + 3}. Because
each element of K is an element of AB, K AB and accordingly K is a relation
from A to B. (Note that K = {(1,4), (3,6)}.)
• [Domain and range] Let R be a relation from A to B. The domain DR of the
relation R is defined as DR = {aA| (a,b)R for some b B}. The range ER of the
relation R is defined as ER = {bB| (a,b)R for some a A}.
• In Example 1: DR = {1, 0} = A and ER = {0, 1, -2} = B
• In Example 2: DK = {1, 3} and EK = {4, 6}
RELATIONS (2): MORE EXAMPLES
• Example 3: Let K = {2, 3, 4, 7, 10, 13} and L = {4, 6, 14, 17}. A relation J
from K to L is defined as follows. J = {(x,y)KL| x divides y}. Find DJ
and EJ.
• Ans.: J = {(2,4), (2,6), (2,14), (3,6), (4,4), (7,14)}. Then, DJ = {2, 3, 4, 7},
EJ = {4, 6, 14}
• Example 4: Let L = {4, 7, 10, 15} and M = {4, 6, 14, 17, 20}. A relation V
from L to M is defined as follows. V = {(x,y)LM| x > y}. Find DV and
EV .
• Ans.: V = {(7,4), (7,6), (10,4), (10,6), (15,4), (15,6), (15,14)}. It follows
that DV = {7, 10, 15} and EV = {4, 6, 14}
FUNCTIONS (1): DEFINITION AND
EXAMPLES
• Definition
• Let A and B be sets and f AB.
• f is a function from A to B provided that both conditions below hold:
• (1) If (a,b) f and (a,c) f then b = c, (2) Df = A
• Loosely speaking, every element of A is assigned to exactly one element of B.
• Example 1: [counter-example]
• Let K = {2, 3, 4, 7, 10, 13} and L = {4, 6, 14, 17}. A relation J from K to L is defined
as follows. J = {(x,y)KL| x divides y}. Is J a function from K to L? Ans.: No, it is
not. It fails condition (1). In the previous example, J = {(2,4), (2,6), (2,14), (3,6),
(4,4), (7,14)}. In this case (2,4) J and (2,6) J, but 46.
FUNCTIONS (2): MORE EXAMPLES
• Example 2: [counter-example]
• Let A = {1, 2, 3, 4, 5} and B = {0, 4, 5, 6}. A relation g from A to B is defined as follows. g =
{(x,y)AB| y = x+2}. Is g a function from A to B? Ans.: No, it is not. It fails condition (2). To
prove this, note that g = {(2,4), (3,5), (4,6)}. From this we have Dg = {2, 3, 5}. Consequently,
Dg A.
• Example 3:
• Let A = {1, 2, 3, 4} and B = {1, 2, 3, 4, 5, 6, 9}. A relation f from A to B is defined as follows. f =
{(x,y)AB| y = x+2}. Is f a function from A to B? Ans.: Yes, it is. f satisfies both conditions.
• Example 4:
• Let U = {1, 2, 3, 4} and V = {1, 2, 4, 5, 9, 16}. A relation k from U to V is defined as follows. k =
{(x,y)UV| y = x2}. Is f a function from U to V?
• Answer: Yes, it is. k satisfies both conditions.
FUNCTIONS (3): MORE EXAMPLES
• Example 5: A relation t from ℤ to ℕ is defined as follows. (Cf. Example 3 on
• t = {(x,y) ℤ ℕ | y = x+2}
the previous slide.)
• Is t a function from ℤ to ℕ?
• h = {(x,y) ℤ ℤ | y = x+2}
above.)
• Is h a function from ℤ to ℤ?
• Answer: Yes, it is. It satisfies both condition. (Verify!)
DOMAIN, IMAGE AND RANGE (1)
f:A→B
• If f is a function from A to B, we can write:
• Let h: ℤ→ℤ such that h(x) = x + 5 for every x ℤ. [Prove that h is a one-to-one
• Example 3:
from ℤ to ℤ.]. In this case, h-1: ℤ→ℤ where h-1(x) = x -5 for every x ℤ. To verify
this let a be any element of ℤ. As a result, h-1(a) = a – 5. Consequently, h(h-1(a)) = h(a-
5) = (a-5) + 5 = a. We have showed that for every a ℤ, it holds that h(h-1(a)) = a. It
implies h-1 as defined above is the inverse function of h.
correspondence from ℝ+ to ℝ+.] In this case, t-1: ℝ+ → ℝ+ where for every ℝ+. To
verify this let a be any element of ℝ+. As a result, t-1(a) = a2. Consequently, t(t-1(a)) =
t(a2) = = a. We have showed that for every a ℝ+, it holds that t(t-1(a)) = a. It implies
t-1 as defined above is the inverse function of t.
PRODUCT/COMPOSITION FUNCTION
• Let f: AB and g: BC. Then, the product function of f and g, denoted by g∘ f, is defined as a
function that maps A into C, where (g∘ f)(a) ≡ g(f(a)) for every member of A.
• Example 1
• Let A = {1, 2, 5}, B = {0, 8, 1}, C = {-2, 5, 1}
a) Find the formulae for (g∘ f)(x) and (f∘ g)(x), b) (g∘ f)(3) and (f∘ g)(3)
•
c) Is g∘ f = f∘ g?
•
•
a) (g∘ f)(x) = g(f(x)) = g(x+7) = (x+7)3, (f∘ g)(x) = f(g(x)) = f(x3) = x3+7.
• Answer:
c) In order that g∘ f = f∘ g, both function must have the same domain and for every x in
•
the domain the following must hold: (g∘ f)(x) = (f∘ g)(x). In this case, although they have
•
the same domain, i.e. ℝ, (g∘ f)(x) (f∘ g)(x) for some xℝ. (The answer to part b)
above shows that.) This proves that g∘ f f∘ g.
PRODUCT FUNCTION: EXAMPLE 3
• Let f: ℝ+ℝ+ and g: ℝ+ℝ where f(x) = x2 for every xℝ+ and g(x) =
• Example 3
log x for every xℝ+. (Verify that f and g are both bijections.) Note: ℝ+
= {xℝ|x>0}. Find: a) g∘ f, b) f -1, c) g-1, d) (g∘ f)-1, e) f -1 ∘ g-1, f) Verify
that (g∘ f)-1 = f -1 ∘ g-1.
• From parts b) and c), we have f -1: ℝ+ℝ+ where for every ℝ+
• Answer to part e):
• Answer to part f): By comparing the results in parts d and e, (g∘ f)-1 =
-1
f -1 ∘ g-1 is verified.