Relation and Mapping

Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

UNIT- II

Relations
RELATIONS
Introduction

The elements of a set may be related to one another. For example, in the set of natural
numbers there is the ‘less than’ relation between the elements. The elements of one set may
also be related to the elements another set.

Binary Relation

A binary relation between two sets A and B is a rule R which decides, for any
elements, whether a is in relation R to b. If so, we write a R b. If a is not in relation R to b, then
we shall write a /R b.

We can also consider a R b as the ordered pair (a, b) in which case we can define a binary
relation from A to B as a subset of A X B. This subset is denoted by the relation R.

In general, any set of ordered pairs defines a binary relation.

For example, the relation of father to his child is F = {(a, b) / a is the father of b} In this relation
F, the first member is the name of the father and the second is the name of the child.

The definition of relation permits any set of ordered pairs to define a relation.

For example, the set S given by


S = {(1, 2), (3, a), (b, a) ,(b, Joe)}
Definition
The domain D of a binary relation S is the set of all first elements of the ordered pairs in the
relation.(i.e) D(S)= {a / $ b for which (a, b) Є S}
The range R of a binary relation S is the set of all second elements of the
ordered pairs in the relation.(i.e) R(S) = {b / $ a for which (a, b) Є S}

For example
For the relation S = {(1, 2), (3, a), (b, a) ,(b, Joe)}
D(S) = {1, 3, b, b} and
R(S) = {2, a, a, Joe}
Let X and Y be any two sets. A subset of the Cartesian product X * Y defines a relation, say C.
For any such relation C, we have D( C ) Í X and R( C) Í Y, and the relation C is said to from X
to Y. If Y = X, then C is said to be a relation form X to X. In such case, c is called a relation in
X. Thus any relation in X is a subset of X * X . The set X * X is called a universal relation in
X, while the empty set which is also a subset of X * X is called a void relation in X.

For example
Let L denote the relation “less than or equal to” and D denote the relation
“divides” where x D y means “ x divides y”. Both L and D are defined on the
set {1, 2, 3, 4}
L = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (4,
4)} D = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}
L Ç D = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 2), (2, 4), (3, 3), (4,
4)} = D

Properties of Binary Relations:

Definition: A binary relation R in a set X is reflexive if, for every x Є X, x R


x, That is (x, x) Є R, or R is reflexive in X ó (x) (x Є X ® x R x).
For example

 The relation £ is reflexive in the set of real numbers.


 The set inclusion is reflexive in the family of all subsets of a universal set.
 The relation equality of set is also reflexive.
 The relation is parallel in the set lines in a plane.
 The relation of similarity in the set of triangles in a plane is reflexive.

Definition: A relation R in a set X is symmetric if for every x and y in X, whenever x R y, then


y R x.(i.e) R is symmetric in X ó (x) (y) (x Є X ٨ y Є X ٨ x R y ® y R x}
For example

 The relation equality of set is symmetric.


 The relation of similarity in the set of triangles in a plane is symmetric.
 The relation of being a sister is not symmetric in the set of all people.
 However, in the set females it is symmetric.

Definition: A relation R in a set X is transitive if, for every x, y, and z are in X, R is


whenever x R y and y R z , then x R z. (i.e) transitive in X ó (x) (y) (z) (x Є X٨ y Є X٨ z Є
X ٨ x R y٨ y R z® x R z)
For example

 The relations <, £, >, ³ and = are transitive in the set of real numbers
 The relations Í, Ì, Ê, É and equality are also transitive in the family of sets.
 The relation of similarity in the set of triangles in a plane is transitive.

Definition: A relation R in a set X is irreflexive if, for every x Є X , (x, x)ÏX.

For example

 The relation < is irreflexive in the set of all real numbers.


 The relation proper inclusion is irreflexive in the set of all nonempty subsets of a
universal set.
 Let X = {1, 2, 3} and S = {(1, 1), (1, 2), (3, 2), (2, 3), (3, 3)} is neither irreflexive nor
reflexive.

Definition:A relation R in a set x is anti symmetric if , for every x and y in X,


whenever x R y and y R x, then x = y.
Symbolically,(x) (y) (x Є X ٨ y Є X ٨ x R y ٨ y R x ® x = y)

For example

 The relations £ , ³ and = are anti symmetric


 The relation Í is anti symmetric in set of subsets.
 The relation “divides” is anti symmetric in set of real numbers.
 Consider the relation “is a son of” on the male children in a family.Evidently the
relation is not symmetric, transitive and reflexive.
 The relation “ is a divisor of “ is reflexive and transitive but not symmetric on the set
of natural numbers.
 Consider the set H of all human beings. Let r be a relation “ is married to “
R is symmetric.
 Let I be the set of integers. R on I is defined as a R b if a – b is an even number.R is an
reflexive, symmetric and transitive.
Equivalence Relation:

Definition:A relation R in a set A is called an equivalence relation if

 a R a for every i.e. R is reflexive


 a R b => b R a for every a, b Є A i.e. R is symmetric
 a R b and b R c => a R c for every a, b, c Є A, i.e. R is transitive.

For example

 The relation equality of numbers on set of real numbers.


 The relation being parallel on a set of lines in a plane.

Problem1: Let us consider the set T of triangles in a plane. Let us define a relation
R in T as R= {(a, b) / (a, b Є T and a is similar to b}
We have to show that relation R is an equivalence relation
Solution :

 A triangle a is similar to itself. a R a


 If the triangle a is similar to the triangle b, then triangle b is similar to the triangle a then
a R b => b R a
 If a is similar to b and b is similar to c, then a is similar to c (i.e) a R b and b R c => a R
c.

Hence R is an equivalence relation.

Problem 2: Let x = {1, 2, 3, … 7} and R = {(x, y) / x – y is divisible by 3} Show that R is an


equivalence relation.

Solution: For any a Є X, a- a is divisible by


3, Hence a R a, R is reflexive
For any a, b Є X, if a – b is divisible by 3, then b – a is also divisible by
3, R is symmetric.
For any a, b, c Є, if a R b and b R c, then a – b is divisible by 3
and b–c is divisible by 3. So that (a – b) + (b – c) is also divisible by
3, hence a – c is also divisible by 3. Thus R is transitive.
Hence R is equivalence.

Problem3 Let Z be the set of all integers. Let m be a fixed integer. Two integers a and
b are said to be congruent modulo m if and only if m divides a-b, in which case we write a º
b (mod m). This relation is called the relation of congruence modulo m and we can show that is
an equivalence relation.

Solution :

 a - a=0 and m divides a – a (i.e) a R a, (a, a) Є R, R is reflexive .


 a R b = m divides a-b

m divides b -
a b º a (mod
m) b R a
that is R is symmetric.

 a R b and b R c => a ºb (mod m) and bº c (mod m)


O m divides a – b and m divides b-c
O a – b = km and b – c = lm for some k ,l Є z
O (a – b) + (b – c) = km + lm
O a – c = (k +l) m
O aº c (mod m)
O aRc
O R is transitive

Hence the congruence relation is an equivalence relation.

Equivalence Classes:

Let R be an equivalence relation on a set A. For any a ЄA, the equivalence class generated by a
is the set of all elements b Є A such a R b and is denoted [a]. It is also called the R –
equivalence class and denoted by a Є A. i.e., [a] = {b Є A / b R a}

Let Z be the set of integer and R be the relation called “congruence modulo
3” defined by R = {(x, y)/ xÎ Z Ù yÎZ Ù (x-y) is divisible by 3}
Then the equivalence classes are
[0] = {… -6, -3, 0, 3, 6, …}
[1] = {…, -5, -2, 1, 4, 7, …}
[2] = {…, -4, -1, 2, 5, 8, …}
Composition of binary relations:

Definition:Let R be a relation from X to Y and S be a relation from Y to Z. Then the relation R


o S is given by R o S = {(x, z) / xÎX Ù z Î Z Ù y Î Y such that (x, y) Î R Ù (y, z) Î S)} is
called the composite relation of R and S.
The operation of obtaining R o S is called the composition of relations.

Example: Let R = {(1, 2), (3, 4), (2, 2)} and


S = {(4, 2), (2, 5), (3, 1),(1,3)}
Then R o S = {(1, 5), (3, 2), (2, 5)} and S o R = {(4, 2), (3, 2), (1, 4)}
It is to be noted that R o S ≠ S o R.
Also Ro(S o T) = (R o S) o T = R o S o T

Note: We write R o R as R2; R o R o R as R3 and so on.

Definition
Let R be a relation from X to Y, a relation R from Y to X is called the converse of R,
where the ordered pairs of Ř are obtained by interchanging the numbers in each of the
ordered pairs of R. This means for x Î X and y Î Y, that x R y ó y Ř x.
Then the relation Ř is given by R = {(x, y) / (y, x) Î R} is called the converse
of R Example:
Let R = {(1, 2),(3, 4),(2, 2)}
Then Ř = {(2, 1),(4, 3),(2, 2)}

Note: If R is an equivalence relation, then Ř is also an equivalence relation.

Definition Let X be any finite set and R be a relation in X. The relation


R+ = R U R2 U R3…in X. is called the transitive closure of R in X

Example: Let R = {(a, b), (b, c), (c, a)}.


Now R2 = R o R = {(a, c), (b, a), (c, b)}
R3 = R2 o R = {(a, a), (b, b), (c, c)}
R4 = R3 o R = {(a, b), (b, c), (c, a)} = R
R5= R3o R2 = R2 and so on.

Thus, R+ = R U R2 U R3 U R4 U…
= R U R2 U R3.
={(a, b),(b, c),(c, a),(a, c),(b, a),(c ,b),(a, b),(b, b),(c, c)}

We see that R+ is a transitive relation containing R. In fact, it is the smallest transitive


relation containing R.
Partial Ordering Relations:

Definition
A binary relation R in a set P is called partial order relation or partial ordering in P
iff R is reflexive, anti symmetric, and transitive.
A partial order relation is denoted by the symbol £., If £ is a partial ordering on P,
then the ordered pair (P, £) is called a partially ordered set or a poset.

 Let R be the set of real numbers. The relation “less than or equal to ” or
O , is a partial ordering on R.
 Let X be a set and r(X) be its power set. The relation subset, Í on X is partial ordering.
 Let Sn be the set of divisors of n. The relation D means “divides” on Sn ,is partial
ordering on Sn .

In a partially ordered set (P, £) , an element y Î P is said to cover an element x Î P


if x <y and if there does not exist any element z Î P such that x £ z and z £ y;
that is, y covers x Û (x < y Ù (x £ z £ y Þ x = z Ú z = y))
A partial order relation £ on a set P can be represented by means of a diagram known as
a Hasse diagram or partial order set diagram of (P, £). In such a diagram, each element is
represented by a small circle or a dot. The circle for x Î P is drawn below the circle for y Î P if x
< y, and a line is drawn between x and y if y covers x.

If x < y but y does not cover x, then x and y are not connected directly by a single line.However,
they are connected through one or more elements of P.

Hasse Diagram:

A Hasse diagram is a digraph for a poset which does not have loops and arcs implied by the
transitivity.
Example 10: For the relation {< a, a >, < a, b >, < a, c >, < b, b >, < b, c >, < c, c >} on set {a,
b,c}, the Hasse diagram has the arcs {< a, b >, < b, c >} as shown below.
Ex: Let A be a given finite set and r(A) its power set. Let Í be the subset relation on the
elements of r(A). Draw Hasse diagram of (r(A), Í) for A = {a, b, c}
Functions

Introduction
A function is a special type of relation. It may be considered as a relation in which each
element of the domain belongs to only one ordered pair in the relation. Thus a function from A
to B is a subset of A X B having the property that for each a ЄA, there is one and only one
b Є B such that (a, b) Î G.

Definition
Let A and B be any two sets. A relation f from A to B is called a function if for every a Є A
there is a unique b Є B such that (a, b) Є f .

Note that the definition of function requires that a relation must satisfy two additional
conditions in order to qualify as a function.

The first condition is that every a Є A must be related to some b Є B, (i.e) the domain of
f must be A and not merely subset of A. The second requirement of uniqueness can be
expressed as (a, b) Є f ٨ (b, c) Є f => b = c
Intuitively, a function from a set A to a set B is a rule which assigns to every element of A, a unique
element of B. If a ЄA, then the unique element of B assigned to a under f is denoted by f
(a).The usual notation for a function f from A to B is f: A® B defined by a ® f (a) where a Є
A, f(a) is called the image of a under f and a is called pre image of f(a).

 Let X = Y = R and f(x) = x2 + 2. Df = R and Rf Í R.


 Let X be the set of all statements in logic and let Y = {True,

False}. A mapping f: X®Y is a function.

 A program written in high level language is mapped into a machine language by a


compiler. Similarly, the output from a compiler is a function of its input.
 Let X = Y = R and f(x) = x2 is a function from X ® Y,and g(x2) = x is not a function
from X ® Y.

A mapping f: A ® B is called one-to-one (injective or 1 –1) if distinct elements of A


are mapped into distinct elements of B. (i.e) f is one-to-one if
a1 = a2 => f (a1) = f(a2) or equivalently f(a1) ¹ f(a2) => a1 ¹ a2
For example, f: N ® N given by f(x) = x is 1-1 where N is the set of a natural numbers.
A mapping f: A® B is called onto (surjective) if for every b Є B there is an a Є A
such that f (a) = B. i.e. if every element of B has a pre-image in A. Otherwise it is called into.
For example, f: Z®Z given by f(x) = x + 1 is an onto mapping.
A mapping is both 1-1 and onto is called bijective
.
For example f: R®R given by f(x) = X + 1 is bijective.

Definition: A mapping f: R® b is called a constant mapping if, for all aÎA, f (a) =
b, a fixed element.
For example f: Z®Z given by f(x) = 0, for all x ÎZ is a constant mapping.

Definition
A mapping f: A®A is called the identity mapping of A if f (a) = a, for all aÎA. Usually it
is denoted by IA or simply I.

Composition of functions:

If f: A®B and g: B®C are two functions, then the composition of functions f and g, denoted
by g o f, is the function is given by g o f : A®C and is given by
g o f = {(a, c) / a Є A ٨ c Є C ٨ $bÎ B ': f(a)= b ٨ g(b) =
c} and (g of)(a) = ((f(a))

Example 1: Consider the sets A = {1, 2, 3},B={a, b} and C = {x,


y}. Let f: A® B be defined by f (1) = a ; f(2) = b and f(3)=b and
Let g: B® C be defined by g(a) = x and g(b) = y
(i.e) f = {(1, a), (2, b), (3, b)} and g = {(a, x), (b,
y)}. Then g o f: A®C is defined by
(g of) (1) = g (f(1)) = g(a) = x
(g o f) (2) = g (f(2)) = g(b) = y
(g o f) (3) = g (f(3)) = g(b) = y
i.e., g o f = {(1, x), (2, y),(3, y)}

If f: A® A and g: A®A, where A= {1, 2, 3}, are given by


f = {(1, 2), (2, 3), (3, 1)} and g = {(1, 3), (2, 2), (3, 1)} Then
g of = {(1, 2), (2, 1), (3, 3)}, fog= {(1, 1), (2, 3), (3, 2)}
f of = {(1, 3), (2, 1), (3, 2)} and gog= {(1, 1), (2, 2), (3, 3)}

Example 2: Let f(x) = x+2, g(x) = x – 2 and h(x) = 3x for x Î R, where R is the set of real
numbers.
Then f o f = {(x, x+4)/xÎ R} f
o g = {(x, x)/ x Î X} g
o f = {(x, x)/ xÎ X}
g o g = {(x, x-4)/x Î X}
h o g = {(x,3x-6)/ x Î X} h
o f = {(x, 3x+6)/ x Î X}

Inverse functions:
Let f: A® B be a one-to-one and onto mapping. Then, its inverse, denoted by f -1 is given by f -
1 = {(b, a) / (a, b) Î f} Clearly f-1: B® A is one-to-one and onto.

Also we observe that f o f -1 = IB and f -1o f = IA.


If f -1 exists then f is called invertible.

For example:Let f: R ®R be defined by f(x) = x + 2


Then f -1: R® R is defined by f -1(x) = x - 2

Theorem: Let f: X ®Y and g: Y ® Z be two one to one and onto functions. Then gof is also one
to one and onto function.

Proof
Let f:X ® Y g : Y ® Z be two one to one and onto functions. Let x1, x2 Î X

 g o f (x1) = g o f(x2),
 g (f(x1)) = g(f(x2)),
 g(x1) = g(x2) since [f is 1-1]

x1 = x2 since [ g is 1-1}
so that gof is 1-1.

By the definition of composition, gof : X ® Z is a function.


We have to prove that every element of z Î Z an image element for some x Î X
under gof.
Since g is onto $ y ÎY ': g(y) = z and f is onto from X to Y,
$ x ÎX ': f(x) = y.
Now, gof (x) = g ( f ( x))
= g(y) [since f(x) = y]
= z [since g(y) = z]
which shows that gof is onto.
Theorem (g o f) -1 = f -1 o g -1
(i.e) the inverse of a composite function can be expressed in terms of the
composition of the inverses in the reverse order.

Proof.
f: A ® B is one to one and onto.
g: B ® C is one to one and onto.
gof: A ® C is also one to one and onto. Þ
(gof) -1: C ® A is one to one and onto.
Let a Î A, then there exists an element b Î b such that f (a) = b Þ a = f-1
(b). Now b Î B Þ there exists an element c Î C such that g (b) = c Þ b = g -
1(c). Then (gof)(a) = g[f(a)] = g(b) = c Þ a = (gof) -1(c). …….(1)
(f -1 o g-1) (c) = f -1(g -1 (c)) = f -1(b) = a Þ a = (f -1 o g -1)( c )
….(2) Combining (1) and (2), we have
(gof) -1 = f -1 o g -1

Theorem: If f: A ® B is an invertible mapping , then


f o f -1 = I B and f-1 o f = IA
Proof: f is invertible, then f -1 is defined by f(a) = b ó f-1(b) =
a where a Î A and bÎ B .
Now we have to prove that f of -1 = IB
. Let bÎ B and f -1(b) = a, a Î A
then fof-1(b) = f(f-1(b))
= f(a) = b
therefore f o f -1 (b) = b " b Î B => f o f -1 = IB
Now f -1 o f(a) = f -1 (f(a)) = f -1 (b) = a
therefore f -1 o f(a) = a " a Î A => f -1 o f = IA.
Hence the theorem.

Recursive Functions:

The term "recursive function" is often used informally to describe any function that is defined
with recursion. There are several formal counterparts to this informal definition, many of which
only differ in trivial respects.

Kleene (1952) defines a "partial recursive function" of nonnegative integers to be any function that
is defined by a noncontradictory system of equations whose left and right sides are composed from
(1) function symbols (for example, , , , etc.), (2) variables for nonnegative integers (for example,
, , , etc.), (3) the constant 0, and (4) the successor function .

For example,
(1)

(2)

(3)

(4)

defines to be the function that computes the product of and .

Note that the equations might not uniquely determine the value of for every possible input, and
in that sense the definition is "partial." If the system of equations determines the value of f for
every input, then the definition is said to be "total." When the term "recursive function" is used
alone, it is usually implicit that "total recursive function" is intended. Note that some authors use
the term "general recursive function to mean partial recursive function, although others use it to
mean "total recursive function."

The set of functions that can be defined recursively in this manner is known to be equivalent to
the set of functions computed by Turing machines and by the lambda calculus.

Lattice and its Properties:

Introduction:
A lattice is partially ordered set (L, £) in which every pair of elements a, b ÎL has a
greatest lower bound and a least upper bound.
The glb of a subset, {a, b} Í L will be denoted by a * b and the lub by a Å b.
.
Usually, for any pair a, b Î L, GLB {a, b} = a * b, is called the meet or product and LUB{a,
b} = a Å b, is called the join or sum of a and b.

Example1 Consider a non-empty set S and let P(S) be its power set. The relation Í
“contained in” is a partial ordering on P(S). For any two subsets A, BÎ P(S)
GLB {A, B} and LUB {A, B} are evidently A Ç B and A È B respectively.

Example2 Let I+ be the set of positive integers, and D denote the relation of “division” in
I+ such that for any a, b Î I+ , a D b iff a divides b. Then (I+, D) is a lattice in which
the join of a and b is given by the least common multiple(LCM) of a and b, that is,
a Å b = LCM of a and b, and the meet of a and b, that is , a * b is the greatest common divisor
(GCD) of a and b.

A lattice can be conveniently represented by a diagram.


For example, let Sn be the set of all divisors of n, where n is a positive integer. Let D denote the
relation “division” such that for any a, b Î Sn, a D b iff a divides b.
Then (Sn, D) is a lattice with a * b = gcd(a, b) and a Å b = lcm(a, b).
Take n=6. Then S6 = {1, 2, 3, 6}. It can be represented by a diagram in Fig(1).
Take n=8. Then S8 = {1, 2, 4, 8}

Two lattices can have the same diagram. For example if S = {1, 2, 3} then (p(s), Í ) and (S6,D)
have the same diagram viz. fig(1), but the nodes are differently labeled .
We observe that for any partial ordering relation £ on a set S the
converse relation ³ is also partial ordering relation on S. If (S, £) is a lattice
With meet a * b and join a Å b , then (S, ³ ) is the also a lattice with meet
a Å b and join a * b i.e., the GLB and LUB get interchanged . Thus we have
the principle of duality of lattice as follows.

Any statement about lattices involving the operations ^ and V and the relations £ and ³
remains true if ^, V, ³ and £ are replaced by V, ^, £ and ³ respectively.
The operation ^ and V are called duals of each other as are the relations £ and ³.. Also, the
lattice (L, £) and (L, ³) are called the duals of each other.

Properties of lattices:
Let (L, £) be a lattice with the binary operations * and Å then for any a, b, c Î L,

 a*a=a aÅa=a (Idempotent)


 a*b=b*a , aÅb =bÅa (Commutative)
 (a * b) * c = a * (b * c) , (a Å ) Å c = a Å (b Å c)
O (Associative)
 a * (a Å b) = a , a Å (a * b ) = a (absorption)

For any a ÎL, a £ a, a £ LUB {a, b} => a £ a * (a Å b). On the other hand,
GLB {a, a Å b} £ a i.e., (a Å b) Å a, hence a * (a Å b) = a

Theorem 1
Let (L, £) be a lattice with the binary operations * and Å denote the operations of meet and join
respectively For any a, b Î L,
a£bóa*b=aóaÅb=b
Proof

Suppose that a £ b. we know that a £ a, a £ GLB {a, b}, i.e., a £ a * b.


But from the definition of a * b, we get a * b £ a.
Hence a £ b => a * b = a ………………………… (1)
Now we assume that a * b = a; but is possible only if a £ b,
that is a * b = a => a £ b ………………………… (2)
From (1) and (2), we get a £ b ó a * b = a.
Suppose a * b = a.
then b Å (a * b) = b Å a = a Å b ……………………. (3)
but b Å ( a * b) = b ( by iv)…………………….. (4)
Hence a Å b = b, from (3) => (4)
Suppose aÅ b = b, i.e., LUB {a, b} = b, this is possible only if a£ b, thus(3) => (1)
(1) => (2) => (3) => (1). Hence these are equivalent.

Let us assume a * b = a.
Now (a * b) Å b = a Å b
We know that by absorption law , (a * b) Å b = b
so that a Å b = b, therefore a * b = a Þ a Å b = b (5)
similarly, we can prove a Å b = b Þ a * b = a (6)
From (5) and (6), we get
a*b=aÛaÅb=b
Hence the theorem.

Theorem2 For any a, b, c Î L, where (L, £) is a lattice. b


£ c => { a * b £ a * c and
{ aÅb£aÅc

Proof Suppose b £ c. we have proved that b £ a ó b * c = b…….. (1)


Now consider
(a * b ) * (a * c) = (a * a) * (b * c) (by Idempotent)
= a * (b * c)
=a*b (by (1))
Thus (a * b) * (a * c ) = a * b which => (a * b ) £ (a * c)
Similarly (a Å b) Å ( a Å c) = (a Å a) Å (b Å c)
= a Å (b Å c)
=aÅc
which => (a Å b ) £ (a Å c )

note:These properties are known as isotonicity.

You might also like