0% found this document useful (0 votes)
52 views31 pages

Lecture # 19 - New

Uploaded by

khadija qadir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views31 pages

Lecture # 19 - New

Uploaded by

khadija qadir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 31

LECTURE 19

FUNCTION
ARROW DIAGRAM OF A FUNCTION
GRAPH OF A FUNCTION
WELL DEFINED FUNCTION
BINARY OPERATION
1
RELATIONS AND FUNCTIONS
A function F from a set X to a set Y is a relation from X to Y that
satisfies the following two properties:
1) For every element x in X, there is an element y in Y such that
(x,y) F.
{Every element of X is the first element of some ordered pair of F}
2. For all elements x in X and y and z in Y, if (x,y) F and (x,z) F,
then y = z
{No two distinct ordered pairs in F have the same first element}

2
EXERCISE
Which of the relations define functions from X = {2,4,5} to
Y={1,2,4,6}.
a. R1 = {(2,4), (4,1)}
b. R2 = {(2,4), (4,1), (4,2), (5,6)}
c. R3 = {(2,4), (4,1), (5,6)}
SOLUTION
a. R1 is not a function, because 5 X does not appear as the
first element in any ordered pair in R1.
b. R2 is not a function, because the ordered pairs (4,1) and (4,2)
have the same first element but different second elements.
c. R3 defines a function. 3
EXERCISE
Let A = {4,5,6} and B = {5,6} and define binary relations R and S from
A to B as follows:
for all (x,y) A  B, (x,y)  R xy
for all (x,y) A  B, xSy  2|(x-y)
a. Represent R and S as a set of ordered pairs.
b. Indicate whether R or S is a function.
SOLUTION
a. R = {(5,5), (6,5), (6,6)} S = {(4,6), (5,5), (6,6)}
b. R is not a function because 4 A is not related to any element of B.
S clearly defines a function since each element of A is related to
a unique element of B. 4
FUNCTION
A function f from a set X to a set Y is a relationship between
elements of X and elements of Y such that each element of X is
related to a unique element of Y, and is denoted f : X Y. The
set X is called the domain of f and Y is called the co-domain of f.
NOTE
The unique element y of Y that is related to x by f is denoted f(x)
and is called
f of x, or
the value of f at x, or
the image of x under f
5
ARROW DIAGRAM OF A FUNCTION
The definition of a function implies that the arrow diagram for a
function f has the following two properties:
1. Every element of X has an arrow coming out of it;
2. No elements of X has two arrows coming out of it that point
to two different elements of Y.
EXAMPLE
Let X = {a,b,c} and Y={1,2,3,4}.
Define a function f from X to Y by the arrow diagram.
f

a. .1
b. .2 Note that f(a) = 2,
c. .3 f(b) = 4,
.4 and f(c) = 2
6
X Y
FUNCTIONS AND NONFUNCTIONS

Which of the arrow diagrams define functions from X = {2,4,5}


to Y = {1,2,4,6}.

a. .1 b.
2. 2. .1
4. .2 .2
.4 4.
5. 5. .4
.6 .6
X Y X Y

Not a function because there Not a function, because there


is no arrow coming out of of are two arrows coming out of
5X to any element of Y. 4X. i.e., 4X is not related
to a unique element of Y. 7
RANGE OF A FUNCTION
Let f: XY. The range of f consists of those elements of Y that are
image of elements of X.
Symbolically:
range of f = {y Y| y = f(x), for some x X}
NOTE
1. The range of a function f is always a subset of the
co-domain of f.
2. The range of f: X Y is also called the image of X under f.
3. When y = f(x), then x is called the pre-image of y.
4. The set of all elements of X, that are related to some y Y
is called the inverse image of y. 8
EXERCISE
Determine the range of the functions f, g, h from X = {2,4,5} to
Y = {1,2,4,6} defined as:
f
1. X Y
2. .1
4. .2
5. .4
.6
2. g = {(2,6), (4,2), (5,1)}
3. h(2) = 4, h (4) = 4, h(5) = 1
SOLUTION
1. Range of f = {1, 6} 2. Range of g = {1, 2, 6}
3. Range of h = {1, 4} 9
GRAPH OF A FUNCTION

Let f be a real-valued function of a real variable. i.e. f:R R.


The graph of f is the set of all points (x,y) in the Cartesian
coordinate plane with the property that x is in the domain of f
and y = f(x).

10
EXAMPLE
Graph of y = x2 y y = x2

x y=f(x)
-3 9 (-3,9) (3,9)
-2 4
(x,f(x))
-1 1
0 0 (-2,4) (2,4)
+1 1 (-1,1) (1,1)
+2 4 x
O (o,o)
+3 9
11
VERTICAL LINE TEST FOR
THE GRAPH OF A FUNCTION
For a graph to be the graph of a function, any given vertical line
in its domain intersects the graph in at most one point.
y y=x2
EXAMPLE:
The graph of the relation y = x2
on R defines a function by vertical line test.

O x

12
EXERCISE
Define a binary relation 0 from R to R as follows:
for all real numbers x and y (x, y)  P  x = y2 Is
P a function? Explain.
SOLUTION
The graph of the relation x = y2 is shown below. Since a vertical
line intersects the graph at two points; the graph does not define a
function.
x Y
4
9 -3 3 (4,2)
4 -2 2
1 -1 1
0 -1 12 3 4 5 6 7 8 9 10 x
0 0
-2
1 1
-3 (4,-2)
4 2 -4
9 3 13
EXERCISE
Find all functions from X = {a,b} to Y = {u,v}
SOLUTION

1. 2.
a u a u

b v b v

X Y X Y

14
3.

a u

b v

X Y

4.
a u

b v

X Y
15
EXERCISE
Find four binary relations from X = {a,b}to Y = {u,v}that are not
functions.
SOLUTION:
a. .u
1.
b. .v

X Y
2.
a. .u

b. .v

16
X Y
3.
a. u.

b. v.

X Y
4.

a. u.

b. v.

X Y
17
EXERCISE
How many functions are there from a set with three elements to a set
with four elements.
SOLUTION
Let X = {x1, x2, x3} and Y= {y1, y2, y3,y4}
Then x1 may be related to any of the four elements y1, y2, y3, y4 of Y.
Hence there are 4 ways to relate x1 in Y. Similarly x2 may also be
related to any one of the 4 elements in Y. Thus the total number of
different ways to relate x1 and x2 to elements of Y are 4  4 = 16.
Finally x3 must also has its image in Y and again any one of the 4
elements y1, or y2 or y3 or y4 could be its image. Therefore the total
number of functions from X to Y are 4  4  4 = 43 = 64.
18
EXERCISE
Suppose A is a set with m elements and B is a set with n elements.
1. How many binary relations are there from A to B?
2. How many functions are there from A to B?
3. What fraction of the binary relations from A to B are functions?
SOLUTION
1. Number of elements in A  B = m.n
Therefore, number of binary relations from A to B =
Number of all subsets of A  B =
2mn
2. Number of functions from A to B = n.n.n. … .n (m times)
= nm 19

m mn
FUNCTIONS NOT WELL DEFINED
Determine whether f is a function from Z to R if
1
a. f ( n)   n b. f ( n)  2
n 4

c. f ( n)  n d. f ( n)  n 2  1

SOLUTION
a. f is not well defined since each integer n has two images +n
and -n
b. f is not well defined since f(2) and f(-2) are not defined.
c. f is not defined for n < 0 since f then results in imaginary
values (not real)
d. f is well defined because each integer has unique (one 20
EXERCISE
Student C tries to define a function h : Q  Q by the rule.
2
m m
h   for all integers m and n with n  0
 n n

Students D claims that h is not well defined. Justify students D’s claim.
SOLUTION:
The function h is well defined if each rational number has a unique (one
and only one) image.
1
Consider Q
2
21
2
1 1 1
h   
 2 2 2
1 2
Now  and
2 4
2
 
2 2 4
h    1
 4 4 4
Hence an element of Q has more than one images under h.
Accordingly h is not well defined.
REMARK:
A function f: X  Y is well defined iff
 x1, x2 X, if x1 = x2 then f(x1) = f(x2)

22
EXERCISE
Let g: RR+ be defined by g(x) = x2 +1
1. Show that g is well defined.
2. Determine the domain, co-domain and range of g.
SOLUTION
1. g is well defined:
Let x1, x2 R and suppose x1 = x2
 x12 = x22 (squaring both sides)
 x12 + 1 = x22 + 1 (adding 1 on both sides)
 g (x1) = g(x2) (by definition of g)
Thus if x1 = x2 then g (x1) = g(x2). According g:R  R+ is well
defined. 23
2. g:R R+ defined by g(x) = x2 + 1.
Domain of g = R (set of real numbers)
Co-domain of g = R+ (set of positive real numbers)
The range of g consists of those elements of R+ that appear as
image points.
Since x2 0  x R
x2 + 1 1  x R
i.e.,
g(x) = x2 + 1 1  x R
Hence the range of g is all real number greater than or equal to 1,
i.e., the internal [1,)
24
IMAGE OF A SET
Let f : X Y is function and A  X.
The image of A under f is denoted and defined as:
f(A) = {yY|y=f(x), for some x in A}
EXAMPLE
Let f: X Y be defined by the arrow diagram
f

1 .a Let A = {1,2}and B = {2,3}


2 then
b
3 c f(A)={b}and f(B) = {b,c}
4

X Y 25
INVERSE IMAGE OF A SET
Let f: X Y is a function and C  Y.
The inverse image of C under f is denoted and defined as:
f-1(C)={x X | f(x) C}
EXAMPLE
Let f: X Y be defined by the arrow diagram.
f
X Y
1 a Let C = {a},D = {b,c},E = {d} then
2 b f-1(C)={1,2}, f-1(D) = {3,4}, and f-
3 c 1
(E) =
4 d
26
SOME RESULTS
Let f: X Y is a function. Let A and B be subsets of X and C and
D be subsets of Y.
1. if A B then f(A)  f(B)
2. f(AB) = f(A) f(B)
3. f(AB)  f(A)  f(B)
4. f(A-B)  f(A) - f(B)
5. if C  D, then f-1(C)  f-1(D)
6. f-1(CD) = f-1(C)  f-1(D)
7. f-1(CD) = f-1(C) f-1(D)
8. f-1(C-D) = f-1 (C) - f-1 (D) 27
BINARY OPERATIONS
A binary operation “*” defined on a set A assigns to each ordered pair
(a,b) of elements of A, a uniquely determined element a*b of A.
That is, a binary operation takes two elements of A and maps them to a
third element of A.
EXAMPLE
1. “+” and “.” are binary operations on the set of natural
numbers N.
2. “-” is not a binary operation on N.
3. “-” is a binary operation on Z, the set of integers.
4. “” is a binary operation on the set of non-zero rational
numbers Q-{0}, but not a binary operation on Z.
28
BINARY OPERATION AS FUNCTION
A binary operation “*” on a set A is a function from A * A to A.
i.e. *: A A A.
Hence *(a,b) = c, where a, b, c A.
NOTE
*(a,b) is more commonly written as a*b.
EXAMPLES
1. The set operations union , intersection  and set difference -,
are binary operators on the power set P(A) of any set A.
2. The logical connectives , , ,  are binary operations on
the set {T, F}
29
3. The logic gates OR and AND are binary operations on {0,1}

A A+B A AB
OR AND
B B

A B A+B A B AB
1 1 1 1 1 1
1 0 1 1 0 0
0 1 1 0 1 0
0 0 0 0 0 0

30
4. The logic gate NOT is a uniary operation on {0,1}

A NOT
A

A A

1 0

0 1

31

You might also like