SlideShare uma empresa Scribd logo
1 de 39
UNIT-I: Relation
 1.0 Introduction
 1.1 Objective
 1.2 Relation
 1.3 Type of relation
 1.4 composition of relations
 1.5 Pictorial representation of relations
 1.6 Closures of relations
 1.7 Equivalence relations
 1.8 Partial ordering relation.
 1.9 Function
 1.10 Various types of functions
 1.11 Composition of function
 1.12 Recursively defined function
 1.13 Mathematical Induction: Piano’s axioms
 1.14 Mathematical Induction
 1.15 Discrete numeric functions
 1.16 Generating functions
 1.17 Simple recurrence relation with constant coefficients
 1.18 Linear recurrence relation with constant coefficients.
 1.19 Asymptotic behavior of functions

1.0 INTRODUCTION             (Relation)

 We start by considering a simple example.
 Let S denote the set of all students at UPTec University,
 Lucknow and
 Let T denote the set of all teaching staff there.
 For every student s∈S and every teaching staff t∈T,
 exactly one of the following is true:
 • s has attended a lecture given by t, or
 • s has not attended a lecture given by t.
 We now define a relation R as follows.
 Let s∈S and t∈T.
 We say that sRt if s has attended a lecture given by t. If
 we now look at all possible pairs (s,t) of students and
 teaching staff, then some of these pairs will satisfy the
 relation while other pairs may not.

                                              1
To put it in a slightly different way, we can say that the
   relation R can be represented by the collection of all
   pairs (s,t) where sRt. This is a sub collection of the set of
   all possible pairs (s,t).
Formally, we define a relation in terms of these “ordered
pairs”.
Relations, as noted above, will be defined in terms of
ordered pairs (a, b) of elements, where a is designated as
the first element and b as the second element.
There are three kinds of relations which play a major role
in our theory:
   (i) Equivalence relations,
   (ii) Partial order relations,
   (iii) Functions.
All these relations will be discussed here.

1.1 OBJECTIVE

After going through this unit-I you will be able to:
  • Define a Relation and various types of relations
  • Discuss a pictorial representation of relations.
  • Explain the closure of reflexive, symmetric and transitive
     relations.
  • Define and explain the Equivalence relations and partial
     order relation (POSet).
  • Define and explain the difference between a relation and a
     function.
  • Discuss the various types of functions such as One-One,
     into, onto and Inverse functions.
  • Discuss the composition of functions
  • Discuss the Recursively defined functions.
                               2
• Discuss various proof methods such as proof by
    Counterexample, by Contra positive and by Contradictions
  • Define and explain Piano’s axioms and mathematical
    induction

 1.1Some definitions required to define relation

Definition1: Ordered Pair:
Let A and B are two sets and let a∈A and b∈B then a set of two
elements whose elements have been listed in a specific order is
called an ordered pair. It is denoted by (a,b). Particularly:
     For different a and b: (a,b)≠(b,a) and
     If (a1,b1)=(a2,b2) ⇔ a1=a2 and b1=b2
Thus in case of relation (a,b)≠(b,a) unless a=b, whereas in case
of Sets, the order of elements is irrelevant; for example
{2,3}={3,2}.

Definition2: (Cartesian product of two sets):

Let A and B be two nonempty sets. The set A×B = {(a,b) :
a∈A and b∈B} is called the Cartesian product of the sets A
and B. In other words, A×B is the set of all ordered pairs
(a,b), where a∈A and b∈B. In short this product A×B is
read as “A cross B”.

Example1.1: Let A = {1, 2} and B= {a, b, c}. Then
    A×B = {(1,a),(1,b),(1,c),(2,a),(2,b),(2,c)}
    BXA = {(a, 1), (a, 2) (b, 1) (b, 2), (c, 1), (c, 2)}
And AXA = {(1, 1), (1,2),(2,1),(2,2)}

Clearly, from this example, we can note down the
following points:
                                 3
   A×B≠B×A
     If A has n elements and B has m elements than A×B
      has m.n elements.
     If A=φ and (or) B=φ then A×B=φ
     If either A or B has infinite set then A×B is also an
      infinite set.
     If A×B=B×A ⇔ A=B


1.2RELATION

Let A and B are two nonempty sets. A binary relation or,
simply, relation from A to B is a subset of A X B i.e.
R is a relation from A to B ⇔ R⊆ (A×B)

Example1.2: Let A = {1, 2,3} and B= {a, b, c}
Then A×B={(1,a),(1,b),(1,c),(2,a),(2,b),(2,c),(3,a),(3,b),(3,c)}
 R1={(1,a),(1,c)}
 R2={(1,a),(2,a),(2,c)}
 R3={(3,c)} are all examples of relations from A to B.

Suppose R is a relation from A to B (i.e. R⊆ (A×B)). Then R
is a set of ordered pairs where each first element comes
from A and each second element comes from B. That is,
for each pair a∈A and b∈B, exactly one of the following is
true:
   (i)  (a,b)∈R, we then say “a is R-related to b”. We write
        aRb.
   (ii) (a, b)∉R, we then say “a is not R-related to b”. We
        write a Rb .
                 /


                                     4
There are many instances when A = B. In this case, R is a
relation from a set A to itself i.e. R is a subset of A2=A X A.
Then we say that R is a relation on A.

Definition1: Domain and Range of a relation:
   If R⊆ (A×B) is a relation from A×B, then
   Domain(R)={a: (a,b)∈R} and
   Range(R)={b: (a,b)∈R}.


The domain of a relation R is the set of all first elements of
the ordered pairs which belong to R, and the range of R is
the set of second elements.

Example2.3: In the example1.2 above, for relation
R2={(1,a),(2,a),(2,c)}
Domain(R)={1,2}
Range(R)={a,c}.

Example2.4: Let A={1,2,3,4}. Define a relation R on A by
writing (x,y)∈R if x < y. Then
R = {(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}.

Example2.5: Let A={1,2,3}. Define a relation R on A as
R={{a,b}: a is divisible by b. We have R = {(1,1),(2,1),(3,1),
(2,2),(3,3)}.




                                5
Example2.6:Let Abe the power set of the set {1,2} in
other words, A= {φ,{1},{2},{1,2}} is the set of subsets of the
set {1,2}. Write a relation on A, where (P,Q)∈R, if P⊂Q.
In this case we have:
R= {(φ,{1}), (φ,{2}), (φ,{1,2}), ({1},{1,2}), ({2},{1,2})}.


Example2.7 :If set A has n elements and B has m

elements, how many relations are there on the set A×B.
Let|A|=nand|B|=m.WeknowthatR⊆ (A×B) and |

A×B|=m.n, Also set of all possible subsets of A×B is power
set of A×B i.e. P(A×B).
Thus if | A×B|=m.n, then |P(A×B)|=2mn.
Hence If set A has n elements and B has m elements, then
     there are 2mn relations on it.

Definition2: (Inverse Relation):
If R⊆ (A×B) is a relation from A×B then the inverse
relation of R (denoted by R-1), is a relation from B to A. It
is defined as R-1={(b,a): (a,b)∈R}.
Also the domain and range of R-1 are equal to the range
 and domain of R. Clearly for any relation R, (R-1)-1=R.

Example2.8: Let A={1,2,3} and B={a,b,c}, if R is a relation
 from A to B such that R={(1,b),(2,a),(2,b)};
Dom(R)={1,2}andRange(R)={a,b},then

R-1={(b,1),(a,2),(b,2)} and Dom(R-1)={a,b} and
range(R-1)={1,2}.
                               6
Check your progress-1:
Q.1: Define the following: a) Identity relation b) Universal relation
 c) Void relation
Q.2: Let A={1,2,3,4,5,6} and let R be a relation on A defined by “x
 divides y”. Write R as a set of ordered pairs.
Q.3: Find the inverse relation on the relation R, above, i.e. “x is
 multiple of y”.
Q.4: Let S be the relation on the set N of +ve integers, defined by
 the equation x+3y=13 i.e.
  S={(x,y): x+3y=13}. Find the relation S?
Q.5: Find the Domain and Range of the above relation?
Q.5: Find the inverse of the following relations
   a) is shorter than b) “is younger than” c) “is child of” d) “is
 a sibling of”
  e) “is parallel to” f) “lies above” g) “is perpendicular to”


1.3 TYPES OF RELATIONS:
Let A be a given non empty set then a relation R⊆A×A is
called a binary relation on A. Binary relations that satisfy
certain special properties can be very useful in solving
computation problems. So let’s discuss some of these
properties:
We have following types of properties in a (Binary)
relation on a given set A.
  1. Reflexive
  2. Irreflexive
  3. Symmetric
                                  7
4. Asymmetric
  5. Anti-symmetric
  6. Transitive

1. Reflexive Relations
A relation R on a set A is reflexive if for every a∈A, aRa. that is, a
relation R in a set A is said to be reflexive if every element of A is
related to itself i.e. aRa is true for every a∈A.
   Definition2: (In terms of directed graph): R is reflexive if there
   must be a loop at each node a∈A.


Example1: Let A be the set of all straight lines in a plane. The
relation R “x is parallel to y” is reflexive since every straight line
is parallel to itself.
Example2: Let A be the set of numbers and relation R in A is
defined by “x is equal to y” is reflexive” since each number is
equal to itself.
Example3: Let A={1,2,3} and the relation R in A is defined by
R={(1,1),(2,2),(2,3)} is not reflexive because (3,3) does not belongs
to R. The given relation R will be reflexive, if every ordered pair
(a,a)∈R for all a∈A.
Example4:
Consider the following five relations on the set A = {1, 2, 3, 4, 5}:
 R1 = {(1, 1), (1, 2), (2,2),(2, 3), (1, 3), (3,3),(4,2),(4, 4),(5,5)}
 R2 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
 R3 = {(1, 3), (2, 1)}
R4 = Ø, the empty relation
R5 = A X A, the universal relation
Determine which of the relations are reflexive.

Solution:

                                    8
The only relations R1 and R5 are reflexive, since A contains the
five elements 1, 2, 3, 4 and 5, a relation R on A is reflexive if it
contains the five pairs (1, 1), (2, 2), (3, 3), (4, 4) and (5,5). Thus only
R1 and R5 are reflexive.
R2, R3, and R4 are not reflexive since, for example, (5, 5) does not
belong to any of them.

Check Your progress2:

Consider the following five relations:

       1. Relation ≤ (Less than or equal ) on the set Z of integers
       2. Set inclusion ⊆ on a collection C of sets
       3. Relation ┴ (perpendicular) on the set L of lines in the plane.
       4. Relation││ (parallel) on the set L of lines in the plane.
       5. Relation │ of divisibility on the set N of positive integers.
          (Recall x│y if there exists z such that xz = y.)
Determine which of the relations are reflexive.

The relation (3) is not reflexive since no line is perpendicular to itself.
Also (4) is not reflexive since no line is parallel to itself. The other
relations are reflexive; that is, x ≤ x for every integer x in Z, A⊆A for
any set A in C, and n│n for every positive integer n in N.


2. Irreflexive Relations
A relations R on a set is irreflexive if (a, a)∉R for every a є
A. Thus R is not irreflexive if there exist at least one a∈A
such that (a, a)∈R.

   Definition2: (In terms of directed graph): R is Irreflexive if there
   is no loop at any node a∈A.


Example1: Let A= {1,2,3} and let R= {(1, 1),(3,2)}.

                                      9
Here R is not reflexive since (2,2) or (3,3)∉R. Also R is not
irreflexive, since (1, 1)∈R.
Example2: Let A={a,b,c}be a non empty set. Let R={(a,b),(b,c),(c,a)}
Here R is irreflexive since (a,a) )∉R for every a∈A. Also note that
there is no loop at any node.

3. Symmetric Relations:

A relation R on a set A is symmetric if ∀a,b in A, if aRb, then
bRa. In other words a relation R is symmetric if in R whenever
(a, b)∈R then (b, a)∈R.
Thus R is not symmetric if there exists a, b∈A such that (a,
b)∈R but (b, a)∉R.
  Definition2: (In terms of directed graph): A relation (R) is
  symmetric; if one node (x) is connected to node (y) then there must
  be a return arc from node (y) to node (x).

     •   A relation R is said to be symmetric if R=R-1




Example1: Let A={set of all straight lines in a plane}. The Relation R
on A is defined by “ a is perpendicular to be” is a symmetric relation
because a⊥b ⇒ b⊥a.
Example2: Let N={set of Natural numbers}. The Relation R on N is
defined by “ a is equal to b” is symmetric since aRb⇒bRa.
Example3: Consider the following five relations on the set
A = {1, 2, 3, 4, 5}:
 R1 = {(1, 1), (1, 2), (2,2),(2, 3), (1, 3), (3,3),(4,2),(4, 4),(5,5)}
 R2 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)}
 R3 = {(1, 3), (2, 1)}
R4 = Ø, the empty relation
                                    10
R5 = A X A, the universal relation.
Determine which of the above relations are symmetric.
Solution:
The relations R2, R4 and R5 are symmetric, since in R whenever (a,
b)∈R then (b, a)∈R .
The other relations R1 and R3 are not symmetric, since in R1, (1, 2)∈R1
but (2, 1)∉R1 and in R3; (1, 3)∈R3 but (3, 1)∉R3.

Example4: Each of the following defines a relation on set N of positive
integers:
R: x is greater than y
S: x+y=10
T: x+4y=10
Determine which of the relation are reflexive and which of them are
symmetric.
Solution: a) None are reflexive. For example (1,1) ∉ R , S or T.
          b) Only S is symmetric, since whenever (a, b)∈S then (b, a)∈S.
The other relations R and T are not symmetric.
**************

4: Anti-symmetric:

A relation R on a set A is anti-symmetric if whenever aRb and
bRa then a = b. That is if (a,b),(b,a)∈R then there must be the
case that a=b. Thus R is not antisymmetric if there exists a, b∈A
such that (a, b) and (b, a) belong to R, but a ≠ b
    •   Definition2: A relation R is said to be Anti-symmetric if
        (a,b)∈R⇒(b,a)∉R unless a=b.
    •   Definition3: (In terms of directed graph): R is anti-symmetric, if
        whenever there is an edge from xy, with x≠y, then there is no
        edge from yx.

Note: Symmetric and anti-symmetric relations are not negatives to each
other. For example, the relation R={(1,4),(4,1),(2,4)} is neither
symmetric nor anti-symmetric and the relation S={(1,1),(2,2)} is both
symmetric and anti symmetric.

                                    11
Example1: Let A be a set of positive integers and R be a
relation on A such that
R={(a,b): a,b∈A and a≥b}. This relation R is an anti-symmetric
relation because if (a,b),(b,a)∈R ⇒a=b
Example2: Determine which of the following in above
example3 is antisymmetric.
Solution: R2 is not anti-symmetric since (1,2),(2,1)∈R2, but
1≠2. Similarly R5 is also not a anti-symmetric. All the other
relations are anti-symmetric.

5.Asymmetric Relation
A relation R on set A is asymmetric if (a, b)∈R then (b, a)∉R. It means
that R is not asymmetric if for some a and b from A both (a, b)∈R and
(b, a)∈R.
     • Definition2: R is Asymmetric, if there is an edge from xy then
       there must not be an edge from yx.
     • Symmetric and Asymmetric relations are negatives to each other
       i.e. if a relation is symmetric then it will not be asymmetric or
       vice-versa.


Example1: Let A = {a, b, c, d} and let R = {(a, b), (b, b), (b, d),
(d, a)}. Determine whether the relation is symmetric,
asymmetric and anti-symmetric.
Solution: Here (a, b)∈R but (b, a)∉R, hence R is not symmetric.
Also since (b, b)∈R, R is not asymmetric and since if a ≠ b,
either (a, b)∉R or (b, a)∉R, ∀a,b∈A, the R is not anti-
symmetric.
Example 2
Let A be a set of integers and R be a relation on A such that
                       R = {(x, y)│ x ∈A, y∈A and x<y}.
Determine whether the relation is symmetric, asymmetric and
anti-symmetric.
Solution:
                                   12
Here for every (x, y)∈R such that x<y, it is true that (y, x)∉R,
hence R is not symmetric. Also R is asymmetric. If x ≠ y, then
either (a, b) Є R or (b, a) Є R, hence R is antisymmetric.

6. Transitive Relations:
A relation R on a set A is said to be transitive if (a,b)∈R
and (b,c)∈R ⇒(a,c)∈R, for all a,b,c∈A.
In other words relation R is transitive if aRb and bRc
implies that aRc, for all a,b,c∈A
Thus R is not transitive if there exist a, b, c ∈A such that
(a, b), (b, c)∈R but (a, c)∉R.
  Definition2: (In terms of directed graph): R is transitive, if
  whenever there is an edge from xy and yz then there must also
  be an edge from xz.


Example1: Determine which of the relations in above Example3
are transitive.
Solution: The relation R1 is not transitive since(4,2), (2,3)∈R1
but (4, 3)∉R1. All the other relations are transitive. Also the
relation R3 is not transitive since (2,1), (1,3)∈R3, but (2, 3)∉R3.
All the other relations are transitive relation.

Example2: Determine which of the relations are transitive.
   a) Relation ≤ on the set Z of integers
   b) Relation || on the set of line in the plane.
   c) Relation set inclusion ⊆on the collection S of sets.
Solution: Relations (a) and (c) are transitive whereas (b) is not
transitive, since if a||b and b||a then a is not parallel to itself.


1.4: Composition of Relations

                                  13
Let A, B and C is sets, and let R1 be a relation from A to B
and R2 be a relation from B to C.
That is, R1⊆ (A×B) and R2⊆ (B×C).
Then the composite of R1 and R2 is a relation from A to C,
denoted by R2οR1 and defined by
R1οR2={(a,c): there exists b∈B such that (a,b)∈R1 and (b,c)∈R2}

The relation R1οR2 is called the composition of R1 and R2.
Suppose R is a relation on a set A, that is R1⊆ (A×A). Then
RοR, the composition of R with itself is always defined. RοR is
sometimes denoted by R2.
Similarly, R3= RοRοR, and so on. Thus Rn is defined for all
positive n.
To find composition of relations using Matrix form:
We can also find the composition of relations R1 and R2 (i.e.
R1οR2) using matrices. Suppose MR1 and MR2 denotes the
matrices of the relations R1 and R2. Then by multiplying MR1
and MR2, we get the matrix MR1.MR2(=M). The nonzero entries of
this matrix M gives us the elements related to R1οR2.
Example 2.12:
Let A = {1, 2, 3}, B = {a, b, c}, C= {x, y, z}. Consider the following
relation R1 from A to B and R2 from B to C.
R1= {(1, b), (2, a), (3, c)} and
R2= {(a, z), (b, x), (c, y), (c, z)}
   a) Find the composite relation R1οR2.
   b) Find the matrix for MR1οR2 and compare the results obtained
      in part (a).
Solution: (a) The arrow diagram of the relations R1 and R2 is
shown in figure-1.
              A                B            C



             1            a             x
                          b        14
             2                          y
             3            c             z
            Figure-1
Since 1 in A is connected to x in C by the path 1bx , so (1,x)∈ R1οR2..
Similarly 2 in A is connected to z in C by the path 2az , so (2,z)∈ R1οR2
         3 in A is connected to y in C by the path 3cy , so (3,y)∈ R1οR2
         3 in A is connected to z in C by the path 3cz , so (3,z)∈ R1οR2
So finally R1οR2={(1,x),(2,z),(3,y),(3,z)}

(b) The matrices for MR1 , MR2 and MR1oR2 can be obtained as
follows:

              a b c             x y z                  x y z
            1 0 1 0          a 0 0 1                 1 1 0 0
       MR1= 2 1 0 0     MR2= b 1 0 0     MR1. MR2 = 2 0 0 1
            3 0 0 1          c 0 1 0                 3 0 1 1

      The non zero entries in the matrix MR1.MR2 (=M) gives a
      elements belongs to R1oR2. So
      R1οR2={(1,x),(2,z),(3,y),(3,z)}

Theorem 2.1: (Show that the composition of relations is Associative).
Let A, B, C and D be sets. Suppose
R is a relation from A to B,
S is a relation from B to C, and
T is a relation from C to D. Then (RοS)οT = Rο(SοT)
Solution:
L.H.S.: Suppose (a,d)∈ (RοS)οT ⇒ (a,c)∈RοS and (c,d)∈T
         Since (a,c)∈RοS ⇒ (a,b)∈R and (b,c)∈S
Now (SοT) ⇒ (b,d)∈SοT
Since (a,b)∈R and (b,d)∈SοT ⇒(a,d)∈ Rο(SοT)
Hence proved.
Note: 1) composition of relations is Associative i.e. (RοS)οT =
Rο(SοT).
                                    15
2) (RοS)≠(SοR)




Check your progress-3:
Q.1:
Let R = {(1, 2), (3, 4), (2, 2)}and S = {(4, 2), (2, 5), (3, 1), (1, 3)}.
Compute RοS, SοR, Rο(SοR), (RοS)οR, RοRοR.
Solution:
     a) RοS = {(1,5), (3, 2), (2, 5)}
          SοR = {(4, 2), (3, 2), (1, 4)}. Clearly RοS≠ SοR
     b) Rο(SοR)= {(3, 2)}.
        (RοS)οR = {(3, 2)}. Clearly Rο(SοR)= (RοS)οR.
     c) RοRοR= {(1, 2), (2, 2)}
Q.2:
1.5: PICTORIAL REPRESENTATION OF RELATIONS
The diagrammatical representation (also called graph) of a
relation R is called a pictorial representation of the given relation
R.

Example 2.9
Consider the relations R defined by the equation: x2 + y2 = 36

That is, R consists of all ordered pairs (x, y) which satisfy the
given equation. The graph of the equation is a circle having its
center at the origin and radius 6. The pictorial representation
(graph) of this equation is shown in figure-1

                           6

                -6         0   6
                           0


                      -6


                                       16
Figure-1: Graphical representation of the equation: x2 + y2 = 36




Method to represent a given relations (on finite set) in pictorial
form:
If A and B are finite sets, then there are two ways of picturing a
relation R from A to B.
   1. By using matrix of the relation
   2. By using Arrow diagram
   3. By using directed graph of relations

     •   Matrix of the relation (denoted by MR) is a 2D rectangular
         array whose rows are labeled by the elements of A and
         whose columns are labeled by the elements of B. Put a 1 or
         0 in each position of the array according as follows:

              1 if (a,b)∈R
   MR=        0 if (a,b)∉R

  Where a∈A and b∈B .
  • In arrow diagram, we write down the elements of A and B in
     two disjoint disks, and then draw as arrow from a∈A to b∈B
     whenever (a,b)∈R.
  • Directed graph method is used when R is a relation from a
     finite set to itself. .First we write down the elements of the
     set, and when we draw an arrow from each element a to
     each element b whenever a is related to b.
Example2.10:
Suppose A={1,2,3} and B={a,b,c}, if R is a relation from A to B such
 that R={(1,b),(2,a),(2,c),(3,c)}
The following figure-a and figure-b shows these two ways of
representation.
                                 17
a   b c

               1 0 1 0         1          a
               2 1 1 0         2          b
               3 0 0 1         3          c

         Figure-a              Figure-b




 Example2.11: Let A={1,2,3,4} and a relation R from A to itself i.e.
R⊆ (A×A) is defined as:
R= {(1, 2), (2, 2), (2, 4), (3, 2), (3,3), (3, 4), (4, 1)}


           1               2




           3               4




Check your progress-2:
Q.1: Given a relation R={(1,y),(2,z),(3,y),(4,x),(4,z)} on sets
A={1,2,3,4} and B={x,y,z}
a) Draw the arrow diagram of R
b) Find the Matrix of R
c) Find the Inverse relation (R-1) of R in matrix form.
d) Determine the Domain and Range of R.
Q.2: Draw the directed graph of the following relation on a set
A={1,2,3,4}
   i. R={(1,2)(2,2),(2,4),(3,2),(3,4)(4,1),(4,3)}
  ii. R={(1,1),(2,2),(2,3),(3,2),(4,2),(4,4)}

1.6: CLOSURE OF RELATIONS:

If R is a binary relation and p is some property, and then the p
closure of R is the smallest binary relation containing R that
                                    18
satisfies property p. Our goal is to construct closures for the
reflexive, symmetric and transitive properties. These are
commonly known as:

  • Reflexive closure (denoted by r(R))
  • Symmetric closure (denoted by s(R))
  • Transitive closure (denoted by t(R))

Closures of relations are used to make the given relation
Reflexive, Symmetric and Transitive, whenever the given relation
is not in proper form (i.e. reflexive, symmetric or transitive).

Reflexive, Symmetric & Transitive Closures

Let R be a relation on a set A. Then reflexive and symmetric closure of
R, is defined as:

      1.   r(R)=R ∪ DA , where DA={(a,a):a∈A} is the diagonal or
           equality relation on A.
      2.   s(R)=R ∪ R-1, where R-1 is the inverse relation of R, i.e.
           R-1={(y,x): (x,y)∈R}
      3.   t(R)=R∪R2∪R3∪…..
      4.   If A is finite with n elements, then t(R)= R∪R2∪R3∪….Rn.


In other words, If R is a binary relation on A, then the reflexive
closure r(R) can be constructed by including all pairs (a,a) that are
not already in R, and
To construct symmetric closure s(R), we must include all pairs for
(y,x) for which (x,y)∈R.
To construct Transitive closure t(R), if R contains the pairs (a,b)
and (b,c) then t(R) must contains the pair (a,b), for all a,b,c∈A.



                                      19
Finding t(R) can take a lot of time when A has a large number of
elements. There exist an efficient way for computing t(R), known
as warshall’s algorithm (which may be discussed latter).




Example 1
 Consider the following relation R on the set A = {1, 2, 3, 4}:
  R = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3)}.
 Then r( R ) = R ∪ DA =R ∪ {(2, 2),(4, 4)}={(1, 1), (1, 3), (2, 4), (3, 1),
(3, 3), (4, 3),(2,2),(4,4)}
  and s( R) = R ∪ R-1= R∪{(4, 2), (3, 4)}= {(1, 1), (1, 3), (2, 4), (3, 1),
(3, 3), (4, 3),(4,2),(3,4)
        t(R)= R∪R2∪R3∪R4={…..}
Example2: Determine which of the following is transitive relation:
  a) Relation ≤ on the set Z of integers.
  b) Relation || on the set of lines in the plane.
Solution: a) The relation ≤ is transitive, since a≤b and b≤c then a≤c.
          b) The relation || is not transitive, since a||b and b||a then a is
           not || to a itself.

1.7: EQUIVALENCE RELATIONS (or RST relation):



A relation R in a set A is said to be an equivalence relation if
  1. R is Reflexive i.e. aRa ∀a∈A.
  2. R is Symmetric i.e. aRa⇒bRa, ∀a,b∈A.
  3. R is Transitive i.e. If aRb and bRc⇒ aRc ∀a,b,c∈A.


Example1: Relation R on a set A defined by “a is equal to b” is
an equivalence relation, since it is reflexive (a = a for every
a∈A), symmetric (If a = b, then b = a , ∀a,b∈A) and transitive
(If a = b and b = c, then a = c, ∀a,b,c∈A).


                                                20
Example2: Relation R in a set A defined by “ x is parallel to y”
is also an equivalence relation since it it is reflexive, symmetric
and transitive.
Example3: The relation ⊆ (set inclusion) is not an equivalence
relation, since it is reflexive and transitive, but it is not
symmetric. Since A⊆B does not imply B⊆A.

Example4: A = {1, 2, 3, 4, 5}. Let R be relation on A such that
R = {(x, y) │ x + y = 5}
We get R as {(1, 4), (2, 3), (4, 1), (3, 2)}. We can say that, R is
not reflexive as for every a, (a, a)∈R. R is symmetric as if (a,
b)∈R then (b, a)∈R and R is antisymmetric relation also. R is
not transitive as (1, 4) ∈R and (4, 1)∈R but (1, 1)∉R. Hence R
is not equivalence relation.
      PARTIAL ORDERING RELATIONS (POR):
1.8
A relation R on a set A is called a Partial ordering or a partial
order relation, if it is:
  1. Reflexive, i.e. aRa ∀a∈A.
  2. Anti-symmetric, i.e. If aRb and bRa⇒ a=b ∀a,b∈A.
  3. Transitive i.e. If aRb and bRc⇒ aRc ∀a,b,c∈A.


The set over which a partial order is defined is called a partially ordered
set (or POSET). It is denoted by (A,R) where A is a given set and R is a
relation which satisfy the above three conditions. POSET is discussed in
detail, in the Lattice chapter (Unit-II).
Example1:The relation ⊆ of set inclusion is a partial ordering on any
collection of sets since set inclusion has the following three desired
properties.
Reflexive, i.e. a ⊆ a ∀a∈A.
Anti-symmetric, i.e. a ⊆ b and b⊆ a⇒ a=b, ∀a,b∈A
Transitive i.e. if a⊆b and b⊆c, then a⊆c ∀a,b,c∈A.
Example2: The relation ≤ (less than or equal to) on the set R of real
numbers is a partial order relation.
 Since the relation (≤) is:
1. Reflexive i.e. a≤a, ∀a∈R
                                          21
2. Anti-symmetric i.e. a ≤b and b≤ a⇒a=b, ∀a,b∈R
3. Transitive i.e a≤b and b≤c, ⇒a≤c ∀a,b,c∈R
Example3: Let N be the set of all positive integers. The relation “a
divides b” is a partial ordering on N. However, “a divides b” is not a
partial ordering on the set Z of integers since a|b and b|a does not imply
a = b. For example, 2|-2 and - 2│2 but 2 ≠ -2.
Check your progress-3:




1.9: Functions:

A function is a special kind of relation. For example suppose
X= the set of students of UP Technical university, and
Y=the set of their enrolment numbers.
Now consider a relation R between A to B, i.e. R ={(a,b)∈AxB |
b is enrollment number of a }.
It is a ‘special’ relation, because to each a∈A ∃! b such that aRb.
We call such a relation a function from A to B.
Definition:
Suppose X and Y be two nonempty sets. A rule or a
correspondence which assign each element x∈X to a unique
element y∈Y is called a function or mapping from X to Y and
written as
f: XY (read as “ f is a function which maps X into Y)
      •   The main idea is that each element of X is associated with
          exactly one element of B. In other words if x∈X is associated
          with y∈Y, then x is not associated with any other elements of Y.
      •   The element y is called the image of x under f and is denoted by
          f(x) i.e. y=f(x)
      •   The element x is called the pre-image of y.




                                    22
•    Domain: The set X is called the domain of the function f, and
  •    Co-domain: The set B is called the co-domain of the function f.
  •    Range of f: The range of f, denoted by Range (f), is the subset of
       elements in the co-domain Y that are associated with some element
       of X. In other words Range (f)={f(x): x∈X}. It is also denoted as
       f(X).
  •    Given an element x∈X, the unique element of Y to which the
       function f associates, is denoted by f (x) and is called the f-image
       (or image) of x or the value of the function f for x. We also say
       that f maps x to f(x). The element x is referred to as the pre-image
       of f (x).


Example1: If A = {1,2,3,4,5}, B = {1,8,27,64,125}, and the rule f
assigns to each member in A its cube, then f is a function from A to B.
The domain of f is A, its co-domain is B and its range is {1,8,27,64}.

Example2: Find the domain and range for f : f(x) =x/1-x
Solution: We can see that 1–x = 0, if x = 1, in this case f(x) will be
undefined.
Domain of f can be taken as R~{1}and co-domain can be R.

      (Necessary conditions to be a function f: XY):
         •    A single element in domain X cannot have more than one image in Y. However, two or more than
              two elements in X may have the same image in Y (see figure-1).

         •    Every element in domain X must have its image in Y but every element in Y may not have its pre-
              image in X (otherwise it is not a function, see figure-


                          a              1                   a               1
                          b              2                   b               2
                          c              3                   c               3



      Figure1-2: Two associations (mapping) that are not function




                                                     23
Frequently, a function can be expressed by means of a
mathematical formula. For example, consider the function f,
which maps each natural number N to its square. We may
describe this function by the formula:
                      f(x) = x2 or y = x2
In the first notation, x is called a variable and the letter f denotes
the function.
In the second notation, x is called the independent variable and
y is called the dependent variable since the value of y will
depend on the value of x.

Remark: Whenever a function is given by a formula in terms of
a variable x, we assume, unless it is otherwise stated, that the
domain of the function is R (or the largest subset of R for which
the formula has meaning) and the co-domain in R.

Example1: Suppose A ={1,2,3}, B= {1,4,9,11} and f assigns to
each member in A its square values. Then f is a function from A
to B.
But if A={1,2,3,4}, B={1,4,9,10} and f is the same rule, then f is
not a function from A to B since no member of B is assigned to
the element 4 in A.

Example1: Let X={1,2,3,4,5} and Y={a,b,c,d,e}. Determine
whether or not each relation below is a function from XY. If
they are functions, give the domain, co-domain and Range of
each, if they are not tell why?
  a) f={(1,a),(2,b),(3,b),(5,e)}
  b) g={(1,e),(5,d),(3,a),(2,b),(1,d),(4,a)}
  c) h={(5,a),(1,e),(4,b),(3,c),(2,d)}




                                  24
Solution:
  a) f is not a function, since 4∈X is not associated with any element of
     Y or f(4) don’t have any image inY.
  b) g is not a function since 1∈X is associated with two different
     elements, namely e and d.
  c) h is a function from X to Y since each member of X appears as the
     first coordinate in exactly one ordered pair in function (say f); here
     f(1)=e, f(2)=d, f(3)=c, f(4)=b and f(5)=a. Domain={1,2,3,4,5}, Co-
     domain={a,b,c,d,e} and Range(h)={a,b,c,d,e}

      Remark: Every relation is not necessarily a function but
      every function is a relation.


Example2: State whether or not each diagram in figure-1 defines a
    function from X={a,b,c} into Y={1,2,3}.


         a         1          a              1       a              1
         b         2          b              2       b              2
         c         3          c              3       c              3

        Figure-a                  figure-b               Figure-c



Solution:
  a) No. There is nothing to assigned to the element b∈A
  b) No. f(c) has two images x and z in Y.
  c) Yes.

Difference between Relation and function:

  •    Every function f: XY gives rise a relation from X to Y.
  •    Every relation (R⊆X×Y) is not necessarily a function (f: XY)..




Example1: Let X={1,2,3,4} and Y={a,b,c}. Consider the following
relations R1 and R2 (i.e. R1,R2⊆X×Y:
                                       25
R1={(1,a),(2,a),(3,b),(4,c)}
R2={(1,a),(2,b),(1,c),(3,a),(4,b)}
Determine whether or not each relation below is a function from X to Y.

Solution: Yes, R1 is a function from X to Y. Each element of X appears
as the first element in one and only one ordered pair in R1, i.e. every
element in X must have its image in Y. Obviously R1 is also a relation
from X to Y. But R2 is not a function from X to Y since 1 is associated
with two different elements a and c of Y.
Hence every relation is not necessarily a function.
Example 2: Consider the following relations on the set A = {1, 2, 3}:
                   f = {(1, 3), (2, 3), (3, 1)}
                   g= {(1, 2), (3, 1)}
                   h= {(1, 3), (2, 1), (1, 2), (3, 1)}
Determine whether or not each relation above is a function from A into
A.
Solution:
f is a function from A into A since each member of A appears as the first
coordinate in exactly one ordered pair in f; here f(1) = 3, f(2) = 3 and
f(3) =1. g is not a function from A into A since 2 Є A is not the first
coordinate of any pair in g and so g does not assign any image to 2. Also
h is not a function from A into A since 1 Є A appears as the first
coordinate of two distinct ordered pairs in h, (1, 3) and (1, 2). If h is to
be a function it cannot assign both 3 and 2 to the element 1 Є A.

Equality of two functions: Two functions f and g of AB are said to
be equal iff f(x)=g(x) for all x∈A, and we write f=g. Note that two equal
function f and g are defined on same domain A.
 For two unequal mappings from A to B, there must exist at least one
element x∈A such that f(x)≠g(x).

Example1: If f(x)=x3+1 where x is any real number and g(x)= x3+1
where x is any complex number then f≠g because the domain of f and g
are different.
Example2: Let A={3,4} and B={2,4,9,16}. Let a function f be defined
from A to B by f(x)= x2 and g={(3,9),(4,16)}, then f=g because f and g


                                     26
both have the same domain={3,4} and each of them assigns the same
image to each element in the domain.




1.10   TYPES OF FUNCTIONS (or mappings):

Let f: AB is a given function. We have following types of functions
(or mapping) between A to B.

   1.   One-to-one mapping
   2.   Onto mapping
   3.   Invertible function (i.e. one-one onto)
   4.   Into mapping
   5.   Many one
   6.   Many one onto
   7.   Many one into

1.0 One-one mapping:

A function f: A → B is said to be one-to-one or one-one or
injective, written as 1-1, if different elements in the domain A
have different images in B. Another way to say this is that f is
one-one if f(x) =f(y) implies x= y (x,y∈A). An injective
function is called an injection. The following figure-1 illustrates
an injection from AB.



                    1                    a
                    2                    b
                    3                    c
                                         d
                Figure-1: An injection



For example f: RR be defined by f(x) = 2x+1, x∈R, then for
x1 ,x2∈R (x1≠x2) we have f(x1)≠f(x2). So, f is 1–1.
                                             27
2: Onto mapping

A function f: A → B is said to be an onto or surjective if each
element of B is the image of some element of A. In other words,
f: A → B is onto if the image of f is the entire co-domain, that is,
f(A)=B. [Equivalently, we say that f is onto if Range(f)=B]. If a
function is mapping of A onto B, we write:
     onto
f: A      B.
An surjective function is called an surjection. The following
figure-2 illustrates an injection from AB.

                1                    a
                2                     b
                3                     c
                4
            Figure-2: A surjection


For example, f: ZZ : f(x) = x+1, x∈Z, then every element y in
the co-domain Z has a pre-image y–1 in the domain Z.
Therefore, f(Z) = Z ,and f is an onto mapping.


3: Invertible (one-one and Onto) Mapping

A function f; A→ B is invertible (or bijective) if its inverse
relation f -1 is a function from B to A. In general, the inverse
relation f -1 may not be a function.
Another term for bijective is “one-to-one and onto”. A bijective
function is called a bijection or a “one-to-one correspondence”
The following figure-3 illustrates an bijection from AB.

                1                    a
                2                     b
                3                     c
                4                    d    28

            Figure-3: A bijection
The following theorem gives a necessary condition for invertible (or
one-one and onto) function:

Theorem1: A function f: A → B is invertible if and only if f is both
one-to-one (i.e. 1-1) and onto.

   • If f: A→ B is both one-to-one and onto, then f is called a one-to-
     one correspondence between A and B. This is called so because
     each element of A corresponds to a unique element of B and vice
     versa.
   • In this case, each element of A maps to a distinct element of B, and
     vice-versa.

For example, f: ZZ : f(x) = x+2, x∈Z is both injective and surjective.
So, f is bijective.

Example1: Consider the functions e: AB, f: BC, g: CD and h;
DE defined by the following diagram:




Determine whether the above functions are one-one, onto and
invertible function.
Solution:
e: is one-to-one as no element in B is image of more than one element in A.
f: is one-to-one as no element in C is image of more than one element in B. but
g: is not one-to-one as g(r)=g(u)=v
h: is not 1-1 as h(v)=h(w)=z.
e: is not onto since 3∈B is not the image under e of any element of A.
f: is onto since every element of C is the image under f of some element of B, i.e.
   f(B)=C
                                         29
g: is onto since every element of D is the image under g of some element of C, i.e.
   g(C)=D.
h: is not onto since x,y∈E are not the image under h of any element of D.
   only f is invertible since f-1 is exist and it is a function from C to B.

Example2: Let A be set of employees of a company and let B be the set
of their telephone extensions. Assuming that all the employees are listed
and that every person has his/her own extension, then the mapping from
A to B is invertible.

Example3:Thefunctione: RR; e(x) = x2 is neither 1-1 nor
onto.
Example4: Thefunctionf: RR; f(x) = 2x is 1-1 and not onto.
Example5: the function h(x) = x3 is 1-1 and onto.
Note:increasingfunctionsare1-1.
Example6: corman p.163:
Example1:
Example2:
Example3:

4: Into mapping: A function f: A → B is said to be into
function if there exits at least one element in (co-domain set) B
which is not the f-image of any element in (domain set) A. We
say that f is a mapping of A ‘into’ B. In this case the range of f
is a proper subset of the co-domain of f i.e. f(A)⊂B.

                     1                   a
                     2                    b
                     3                    c


               Figure-2: An into mapping



5: Many one: A mapping f: A → B is said to be many-one if
two (or more than two) distinct elements in A has the same
image in B i.e. x,y∈A and x≠y ⇒f(x)=f(y).

                     -2                 4
          Figure-2: Many-one mapping 9 30
                     2
                     3
       (Because two different elements in A (i.e. -2,2} have the same
       f-image in B) 4                  16
6: many-one onto: A mapping f: A → B is said to be many-one
onto mapping if it is many-one and onto.
In such a mapping following two conditions are hold:
   a) if x,y∈A and x≠y ⇒f(x)=f(y) and
   b) the image of f is the entire co-domain, that is, f(A)=B
Example1: If A={2,3,4}, B={x,y}, then f={(2,x),(3,y),(4,y)} is a many-
one onto mapping.

7: Many one into:
A mapping f: A → B is said to be many-one into if it is many-one and
into.
In such a mapping following two conditions are hold:
   a) if x,y∈A and x≠y ⇒f(x)=f(y) and
   b) if there exits at least one element in B which is not the f-image of
       any element of A.
Example1: If A={-1,1,-3,3,4} and B={1,9,16}. Show that f:
AB={(x,y): y=x2, x∈A, y∈B} is a many-one onto mapping.
Proof: i) As f(-1)=f(1)=1; f(-3)=f(3)=9; and f(4)=16
            So every element of A has f-image in B. Thus it is a mapping.
         ii) f(-1)=f(1)=1 and f(-3)=f(3)=9 so two elements of A have the
same image in B, thus it is many-one mapping
     iii) Every element of B is f-image of some element of A. Thus it is
onto mapping. Therefore f is a many-one onto mapping.

Example1(P-68,69)-book
Example2: (p3.23)(SS)
Check your progress-4:



                                    31
1.11COMPOSITION OF FUNCTION

Let A,B,C be three sets and f and g be two functions such that f: AB
and g: BC; where the co-domain of f is the domain of g. Then we may
define a new function from A to C [(gof): AC], called the product or
composition of f and g and denoted by (gof), as follows:
 (gof)(x)=g[f(x)], ∀x∈A
That is, to find (gof)(x), first we have to find the image of x under f and
then find the image of f(x) under g.

Note: if we think f and g as relation then the composition of function is
same as the composition of relation. Only the notation is different. We
use the gof for the composition of f and g, instead of fog, which is used
for relation.

Theorem: (Associativity of composites of functions):
Let A,B,C and D be four sets and f, g, h be three functions such that f:
AB, g: BC, h: CD then
 (hog)of=ho(gof)
Proof: It can be easily seen that both (hog)f and ho(gof) are mapping of
AD. These two mappings will be equal if they assign the same image
to each element x in the domain A. i.e. if
[(hog)of](x)=[ho(gof)](x)
By the definition of composites of functions,
[(hog)of](x)=(hog)[f(x)]=h[g{f(x)}]=h[(gof)(x)]=[ho(gof)](x).
Hence (hog)of=ho(gof)
Example 1,2,3,4,5 (pundir)-p-32,33

Example3.8,3.9.3.10 (SS)-p-3.23,3.24,3.27.3.28.




1.12RECURSIVELY DEFINED FUNCTIONS:

A function is said to be recursively defined if the function definition
refers to itself or call itself repeatedly. The recursive definition must
have the following two properties:

                                                  32
A recursive definition has two parts:
  1. Base step (B): Definition of the smallest argument (usually f (0) or
     f (1)), for which the function does not call itself.
  2. Recursive step (R): Definition of f (n), given f (n - 1), f (n - 2), etc.
     In other words a rule (or rules) that show how to construct new
     elements of f from old ones. The argument of f must be closure to
     the Base value as defined in step-1.
   Here is an example of a recursively defined function:


   We can calculate the values of this function:
   f (0)=5
   f (1)= f (0) + 2 = 5 + 2 = 7
   f (2)= f (1) + 2 = 7 + 2 = 9
   f (3)= f (2) + 2 = 9 + 2 = 11
   This recursively defined function is equivalent to the explicitly
   defined (by a formula in terms of the variable) function f (n) = 2n + 5.
   However, the recursive function is defined only for nonnegative
   integers.
Here is another example of a recursively defined function:



The values of this function are:
f (0)=0
f (1)= f (0) + (2)(1) - 1 = 0 + 2 - 1 = 1
f (2)= f (1) + (2)(2) - 1 = 1 + 4 - 1 = 4
f (3)= f (2) + (2)(3) - 1 = 4 + 6 - 1 = 9
f (4)= f (3) + (2)(4) - 1 = 9 + 8 - 1 = 16
…….

This recursively defined function is equivalent to the explicitly defined
function f (n) = n2. Again, the recursive function is defined only for
nonnegative integers.




                                      33
Here is one more example of a recursively defined function:



The values of this function are:
f (0)= 1
f (1)= 1⋅f (0) = 1⋅1 = 1
f (2)= 2⋅f (1) = 2⋅1 = 2
f (3)= 3⋅f (2) = 3⋅2 = 6
f (4)= 4⋅f (3) = 4⋅6 = 24
f (5)= 5⋅f (4) = 5⋅24 = 120
…….
This is the recursive definition of the factorial function, F(n) = n!. Thus
a factorial function may also be defined as:
  a) If n=0, then f(n)=n!=1          {here 0 is a base value}
  b) If n>0, then f(n)=n!=n.(n-1)! { Here the n! is defined in terms of
               smaller value of n which is closure to the base value 0}.
Observe that this (and all the above) definition are recursive since all
these functions definition are refers to itself.

 Note: Not all recursively defined functions have an explicit definition
 (by a formula in terms of the variable).


Example1:
Let us calculate 3! using the recursive definitions. This calculation requires the
following seven Steps:

      1) 3! = 3 · 2!
      2)          2! = 2 · 1!
        3)                      1! = 1 · 0!
        4)                               0! = 1
        5)                    1! = 1 · 1 = 1
        6)             2! = 2 · 1 = 2
        7) 3! = 3 · 2 = 6




                                           34
Here we first defines 3! In terms of 2!, so we must postpone evaluating
3! Until we evaluate 2!. In step2 we define 2! in terms of 1!, so we must
postpone evaluating 2! Until we evaluate 1! An so on.
step5 can explicitly evaluate 0!(=1), which is the base value (i.e. 0) of
the recursive definition.
In step5 to step7, we backtrack, using 0! to find 1!, using 1! to find 2!,
and finally using 2! to find 3!. The final answer is 6.




2. The Fibonacci Numbers:


One special recursively defined function, which has no simple explicit
definition, yields the Fibonacci numbers (usually denoted by fn, f1, f2,
….}. The main characteristic of Fibonacci number is that the sums of
two previous numbers give a next number. If f0=0 and f1=1(base value)
then the sequence of Fibonacci numbers is:
0, 1, 1, 2, 3, 5, 8, 13, 21,…….
Thus a Fibonacci number can be defined recursively as:

  a)   If n = 0 or n= 1, then Fn = n.       {here 0 and 1 are base values}
  b)   If n > 1, then Fn = Fn – 2 + Fn – 1. {Here Fn is defined in terms of
          smaller value of n which is closure to the base values 0 and 1}.




  3. Ackermann Function:

The Ackermann function is a function with two arguments, each of
which can be assigned any non-negative integer, that is, 0, 1, 2 … The
Ackermann function is defined recursively for non-negative integer’s m
and n as follows:
                                     35
n+1             if m=0
  A(m,n)=           A(m-1,1)        if m>0 and n=0
                    A(m-1, A(m,n-1)) if m>0 and n>0


Observe that A (m, n) is explicitly given only when m = 0. The base
criteria are the pairs
             (0, 0), (0, 1), (0, 2), (0, 3),… (0, n), …
Although it is not obvious from the definition, the value of any A(m, n)
may eventually be expressed in terms of the value of the function on one
or more of the base pairs.
Lets see some special values for integer m:
      A(0,n)=n+1
      A(1,y)=n+2
      A(2,n)=2n+3
      A(3,n)=2n+3-3


      A(4,n)=

      Expressions of the latter form are sometimes called
      power towers.

 A(0,n) follows trivially from the definition. A(1,n) can be derived as
follows:
A(1,n)=A(0,A(1,n-1))
      =A(1,n-1)+1
      =A(0,A(1,n-2))+1
      =A(1,n-2)+2
      =….
      =A(1,0)+n
      =A(0,1)+n=2+n
Similarly we can calculate A(2,n)=2n+3.


Table of values of A(m,n): The following tables can be used for calculating the value for A(m,n).

mn    0        1        2                3               4                n
0      1        2        3                4               5                n+1
1      2        3        4                5               6                n + 2 = 2 + (n + 3) − 3
2      3        5        7                9               11               2n + 3 = 2 * (n + 3) − 3

                                                   36
3      5          13     29             61             125             2(n + 3) − 3
                          65536
4      13         6553   2        −3    22↑65536-3     A(3, A(4, 3))   2 (2 (2 (... 2))) - 3 (n + 3 twos)
                  3                                                    =2   (n + 3) - 3

5      6553              A(4, A(5, 1)   A(4, A(5, 2)   A(4, A(5, 3))   A(4, A(5, n-1))
       3                 )              )
*see Wikipedia.
Note that from the table:
    A(1, n) = 2 + (n + 3) - 3
    A(2, n) = 2 × (n + 3) - 3
    A(3, n) = 2↑(n + 3) - 3
    A(4, n) = 2 (2 (2 (... 2))) - 3 (n + 3 twos) = 2 (n + 3) - 3
    A(5, n) = 2    (n + 3) - 3 etc.
Example1:
By using the definition of the Ackermann function, find the value of
A(1,3).
Solution:
1. A(1,3)=A(0,A(1,2))
2.         A(1,2)=A(0,A(1,1))
3.                  A(1,1)=A(0,(1,0))
4.                           A(1,0)=A(0,1)
5.                                  A(0,1)=1+1=2
6.                           A(1,0)=2
7.                  A(1,1)=A(0,2)
8.                          A(0,2)=2+1=3
9.                  A(1,1)=3
10.          A(1,2)=A(0,3)
11.                  A(0,3)=3+1=4
12.          A(1,2)=4
13. A(1,3)=A(0,4)
14.         A(0,4)=4+1=5
15. A(1,3)=5


So here we can see that the value of A (1, 3) is requires 15 steps. In the
above calculation Forward movement means we are postponing an
evaluation and calling the definition. The backward movement means
we are backtracking. The result of A(1,3)=5 can also be verified from
the above table.

                                                 37
Check your progress-5:

Q.1 P-3.33, Q3.30,3.31(SS)




1.13: Piano’s Axiom

In mathematical logic, the Peano axioms, also known as the Dedekind-Peano axioms or the Peano
postulates, are a set of axioms for the natural numbers presented by the 19th century Italian
mathematician Giuseppe Peano. The Peano axioms define the properties of natural numbers,
usually represented as a set N. Peano defines natural numbers in terms of three postulates (called
Peano’s Pastulates in his honour).


   N is a set with the following properties:

   P1: 1 is a natural number i.e. 1∈N
   P2: For each n∈N, there exist a unique successor n*∈N such that
     i)        m*=n* if and only if m=n {i.e. Two numbers of which the successors are equal are themselves
               equal}.

     ii) There is no element k∈N such that k*=1 {i.e. for every natural number n, n* ≠ 1. That is, there is
                                                          no natural number whose successor is 1}.
   P3: (induction axiom):
       Let K be a subset on N such that
       • 1∈K and
       • For every natural number n, if n is in K, then n* (successor of n) is in K,
      then K contains every natural number i.e. K=N.
        (i.e. If a set K of natural numbers contains 1 and also the successor of every natural number in K, then every
             natural number is in K}.



The elements of N are called the natural numbers. The successor n* of n is nothing but n+1 in
the usual sense. Thus
2=1*
3=2*=(1*)*
4=3*=(2*)*=((1*)*)* etc.
In this way all the natural numbers can be obtained.


1.13: Mathematical Induction

P-105(DU book)

                                                        38
P-1.22 (SS)

Example-1,2,3,(P-105)




                        39

Mais conteúdo relacionado

Mais procurados

Chapter 2: Relations
Chapter 2: RelationsChapter 2: Relations
Chapter 2: Relationsnszakir
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFAMaulik Togadiya
 
Regular expression to NFA (Nondeterministic Finite Automata)
Regular expression to NFA (Nondeterministic Finite Automata)Regular expression to NFA (Nondeterministic Finite Automata)
Regular expression to NFA (Nondeterministic Finite Automata)Niloy Biswas
 
equivalence and countability
equivalence and countabilityequivalence and countability
equivalence and countabilityROHAN GAIKWAD
 
Ppt on matrices and Determinants
Ppt on matrices and DeterminantsPpt on matrices and Determinants
Ppt on matrices and DeterminantsNirmalaSolapur
 
Software Engineering MCQs
Software Engineering MCQsSoftware Engineering MCQs
Software Engineering MCQsGurpreet singh
 
Relations & functions.pps
Relations  &  functions.ppsRelations  &  functions.pps
Relations & functions.ppsindu psthakur
 
Exponential and logrithmic functions
Exponential and logrithmic functionsExponential and logrithmic functions
Exponential and logrithmic functionsMalikahmad105
 
Types Of Set
Types Of SetTypes Of Set
Types Of SetPkwebbs
 
mathematical functions
mathematical functions mathematical functions
mathematical functions Anshul gour
 
Inverse trigonometric functions
Inverse trigonometric functionsInverse trigonometric functions
Inverse trigonometric functionsLeo Crisologo
 
BCA_Semester-II-Discrete Mathematics_unit-i Group theory
BCA_Semester-II-Discrete Mathematics_unit-i Group theoryBCA_Semester-II-Discrete Mathematics_unit-i Group theory
BCA_Semester-II-Discrete Mathematics_unit-i Group theoryRai University
 
Theory of Automata Lesson 02
Theory of Automata Lesson 02Theory of Automata Lesson 02
Theory of Automata Lesson 02hamzamughal39
 

Mais procurados (20)

Functions
FunctionsFunctions
Functions
 
Chapter 2: Relations
Chapter 2: RelationsChapter 2: Relations
Chapter 2: Relations
 
Functions
FunctionsFunctions
Functions
 
Regular expression with DFA
Regular expression with DFARegular expression with DFA
Regular expression with DFA
 
6 operators-in-c
6 operators-in-c6 operators-in-c
6 operators-in-c
 
Regular expression to NFA (Nondeterministic Finite Automata)
Regular expression to NFA (Nondeterministic Finite Automata)Regular expression to NFA (Nondeterministic Finite Automata)
Regular expression to NFA (Nondeterministic Finite Automata)
 
equivalence and countability
equivalence and countabilityequivalence and countability
equivalence and countability
 
Relations
RelationsRelations
Relations
 
C – operators and expressions
C – operators and expressionsC – operators and expressions
C – operators and expressions
 
Ppt on matrices and Determinants
Ppt on matrices and DeterminantsPpt on matrices and Determinants
Ppt on matrices and Determinants
 
Automata theory -RE to NFA-ε
Automata theory -RE to  NFA-εAutomata theory -RE to  NFA-ε
Automata theory -RE to NFA-ε
 
Software Engineering MCQs
Software Engineering MCQsSoftware Engineering MCQs
Software Engineering MCQs
 
Relations & functions.pps
Relations  &  functions.ppsRelations  &  functions.pps
Relations & functions.pps
 
Exponential and logrithmic functions
Exponential and logrithmic functionsExponential and logrithmic functions
Exponential and logrithmic functions
 
Types Of Set
Types Of SetTypes Of Set
Types Of Set
 
mathematical functions
mathematical functions mathematical functions
mathematical functions
 
Inverse trigonometric functions
Inverse trigonometric functionsInverse trigonometric functions
Inverse trigonometric functions
 
Data types in c++
Data types in c++Data types in c++
Data types in c++
 
BCA_Semester-II-Discrete Mathematics_unit-i Group theory
BCA_Semester-II-Discrete Mathematics_unit-i Group theoryBCA_Semester-II-Discrete Mathematics_unit-i Group theory
BCA_Semester-II-Discrete Mathematics_unit-i Group theory
 
Theory of Automata Lesson 02
Theory of Automata Lesson 02Theory of Automata Lesson 02
Theory of Automata Lesson 02
 

Semelhante a Final relation1 m_tech(cse)

dm_13_RelationsAndTheirProperties (1).pptx
dm_13_RelationsAndTheirProperties (1).pptxdm_13_RelationsAndTheirProperties (1).pptx
dm_13_RelationsAndTheirProperties (1).pptxRockyIslam5
 
dm_13_RelationsAndTheirProperties (1).pdf
dm_13_RelationsAndTheirProperties (1).pdfdm_13_RelationsAndTheirProperties (1).pdf
dm_13_RelationsAndTheirProperties (1).pdfSanjanaAdri
 
Relations
RelationsRelations
RelationsGaditek
 
Ncert class-12-mathematics-part-1
Ncert class-12-mathematics-part-1Ncert class-12-mathematics-part-1
Ncert class-12-mathematics-part-1RAHUL SINGH
 
Week 5 ( basic concept of relation )
Week 5 ( basic concept of relation )Week 5 ( basic concept of relation )
Week 5 ( basic concept of relation )OliverBaltazar2
 
Relation in Discrete Mathematics
Relation in Discrete Mathematics Relation in Discrete Mathematics
Relation in Discrete Mathematics NANDINI SHARMA
 
CMSC 56 | Lecture 13: Relations and their Properties
CMSC 56 | Lecture 13: Relations and their PropertiesCMSC 56 | Lecture 13: Relations and their Properties
CMSC 56 | Lecture 13: Relations and their Propertiesallyn joy calcaben
 
Discrete-Chapter 08 Relations
Discrete-Chapter 08 RelationsDiscrete-Chapter 08 Relations
Discrete-Chapter 08 RelationsWongyos Keardsri
 
Relation and function
Relation and functionRelation and function
Relation and functionAadityaGera
 
Matematika terapan minggu ke-4
Matematika terapan minggu ke-4Matematika terapan minggu ke-4
Matematika terapan minggu ke-4Fisma Ananda
 
Matematika terapan week 4
Matematika terapan week 4 Matematika terapan week 4
Matematika terapan week 4 nellylawar
 

Semelhante a Final relation1 m_tech(cse) (20)

dm_13_RelationsAndTheirProperties (1).pptx
dm_13_RelationsAndTheirProperties (1).pptxdm_13_RelationsAndTheirProperties (1).pptx
dm_13_RelationsAndTheirProperties (1).pptx
 
dm_13_RelationsAndTheirProperties (1).pdf
dm_13_RelationsAndTheirProperties (1).pdfdm_13_RelationsAndTheirProperties (1).pdf
dm_13_RelationsAndTheirProperties (1).pdf
 
Relations
RelationsRelations
Relations
 
Relations
RelationsRelations
Relations
 
Relation and function_xii
Relation and function_xiiRelation and function_xii
Relation and function_xii
 
Ncert class-12-mathematics-part-1
Ncert class-12-mathematics-part-1Ncert class-12-mathematics-part-1
Ncert class-12-mathematics-part-1
 
Lemh101
Lemh101Lemh101
Lemh101
 
Relations in Discrete Math
Relations in Discrete MathRelations in Discrete Math
Relations in Discrete Math
 
Week 5 ( basic concept of relation )
Week 5 ( basic concept of relation )Week 5 ( basic concept of relation )
Week 5 ( basic concept of relation )
 
Relation in Discrete Mathematics
Relation in Discrete Mathematics Relation in Discrete Mathematics
Relation in Discrete Mathematics
 
CMSC 56 | Lecture 13: Relations and their Properties
CMSC 56 | Lecture 13: Relations and their PropertiesCMSC 56 | Lecture 13: Relations and their Properties
CMSC 56 | Lecture 13: Relations and their Properties
 
Discrete-Chapter 08 Relations
Discrete-Chapter 08 RelationsDiscrete-Chapter 08 Relations
Discrete-Chapter 08 Relations
 
Relations
RelationsRelations
Relations
 
Per5 relasi
Per5 relasiPer5 relasi
Per5 relasi
 
Introductions to Relations
Introductions to RelationsIntroductions to Relations
Introductions to Relations
 
Relation and function
Relation and functionRelation and function
Relation and function
 
Matematika terapan minggu ke-4
Matematika terapan minggu ke-4Matematika terapan minggu ke-4
Matematika terapan minggu ke-4
 
Set theory
Set theorySet theory
Set theory
 
Sets and relations
Sets and relationsSets and relations
Sets and relations
 
Matematika terapan week 4
Matematika terapan week 4 Matematika terapan week 4
Matematika terapan week 4
 

Último

AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 

Último (20)

AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 

Final relation1 m_tech(cse)

  • 1. UNIT-I: Relation 1.0 Introduction 1.1 Objective 1.2 Relation 1.3 Type of relation 1.4 composition of relations 1.5 Pictorial representation of relations 1.6 Closures of relations 1.7 Equivalence relations 1.8 Partial ordering relation. 1.9 Function 1.10 Various types of functions 1.11 Composition of function 1.12 Recursively defined function 1.13 Mathematical Induction: Piano’s axioms 1.14 Mathematical Induction 1.15 Discrete numeric functions 1.16 Generating functions 1.17 Simple recurrence relation with constant coefficients 1.18 Linear recurrence relation with constant coefficients. 1.19 Asymptotic behavior of functions 1.0 INTRODUCTION (Relation) We start by considering a simple example. Let S denote the set of all students at UPTec University, Lucknow and Let T denote the set of all teaching staff there. For every student s∈S and every teaching staff t∈T, exactly one of the following is true: • s has attended a lecture given by t, or • s has not attended a lecture given by t. We now define a relation R as follows. Let s∈S and t∈T. We say that sRt if s has attended a lecture given by t. If we now look at all possible pairs (s,t) of students and teaching staff, then some of these pairs will satisfy the relation while other pairs may not. 1
  • 2. To put it in a slightly different way, we can say that the relation R can be represented by the collection of all pairs (s,t) where sRt. This is a sub collection of the set of all possible pairs (s,t). Formally, we define a relation in terms of these “ordered pairs”. Relations, as noted above, will be defined in terms of ordered pairs (a, b) of elements, where a is designated as the first element and b as the second element. There are three kinds of relations which play a major role in our theory: (i) Equivalence relations, (ii) Partial order relations, (iii) Functions. All these relations will be discussed here. 1.1 OBJECTIVE After going through this unit-I you will be able to: • Define a Relation and various types of relations • Discuss a pictorial representation of relations. • Explain the closure of reflexive, symmetric and transitive relations. • Define and explain the Equivalence relations and partial order relation (POSet). • Define and explain the difference between a relation and a function. • Discuss the various types of functions such as One-One, into, onto and Inverse functions. • Discuss the composition of functions • Discuss the Recursively defined functions. 2
  • 3. • Discuss various proof methods such as proof by Counterexample, by Contra positive and by Contradictions • Define and explain Piano’s axioms and mathematical induction 1.1Some definitions required to define relation Definition1: Ordered Pair: Let A and B are two sets and let a∈A and b∈B then a set of two elements whose elements have been listed in a specific order is called an ordered pair. It is denoted by (a,b). Particularly:  For different a and b: (a,b)≠(b,a) and  If (a1,b1)=(a2,b2) ⇔ a1=a2 and b1=b2 Thus in case of relation (a,b)≠(b,a) unless a=b, whereas in case of Sets, the order of elements is irrelevant; for example {2,3}={3,2}. Definition2: (Cartesian product of two sets): Let A and B be two nonempty sets. The set A×B = {(a,b) : a∈A and b∈B} is called the Cartesian product of the sets A and B. In other words, A×B is the set of all ordered pairs (a,b), where a∈A and b∈B. In short this product A×B is read as “A cross B”. Example1.1: Let A = {1, 2} and B= {a, b, c}. Then A×B = {(1,a),(1,b),(1,c),(2,a),(2,b),(2,c)} BXA = {(a, 1), (a, 2) (b, 1) (b, 2), (c, 1), (c, 2)} And AXA = {(1, 1), (1,2),(2,1),(2,2)} Clearly, from this example, we can note down the following points: 3
  • 4. A×B≠B×A  If A has n elements and B has m elements than A×B has m.n elements.  If A=φ and (or) B=φ then A×B=φ  If either A or B has infinite set then A×B is also an infinite set.  If A×B=B×A ⇔ A=B 1.2RELATION Let A and B are two nonempty sets. A binary relation or, simply, relation from A to B is a subset of A X B i.e. R is a relation from A to B ⇔ R⊆ (A×B) Example1.2: Let A = {1, 2,3} and B= {a, b, c} Then A×B={(1,a),(1,b),(1,c),(2,a),(2,b),(2,c),(3,a),(3,b),(3,c)} R1={(1,a),(1,c)} R2={(1,a),(2,a),(2,c)} R3={(3,c)} are all examples of relations from A to B. Suppose R is a relation from A to B (i.e. R⊆ (A×B)). Then R is a set of ordered pairs where each first element comes from A and each second element comes from B. That is, for each pair a∈A and b∈B, exactly one of the following is true: (i) (a,b)∈R, we then say “a is R-related to b”. We write aRb. (ii) (a, b)∉R, we then say “a is not R-related to b”. We write a Rb . / 4
  • 5. There are many instances when A = B. In this case, R is a relation from a set A to itself i.e. R is a subset of A2=A X A. Then we say that R is a relation on A. Definition1: Domain and Range of a relation: If R⊆ (A×B) is a relation from A×B, then Domain(R)={a: (a,b)∈R} and Range(R)={b: (a,b)∈R}. The domain of a relation R is the set of all first elements of the ordered pairs which belong to R, and the range of R is the set of second elements. Example2.3: In the example1.2 above, for relation R2={(1,a),(2,a),(2,c)} Domain(R)={1,2} Range(R)={a,c}. Example2.4: Let A={1,2,3,4}. Define a relation R on A by writing (x,y)∈R if x < y. Then R = {(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}. Example2.5: Let A={1,2,3}. Define a relation R on A as R={{a,b}: a is divisible by b. We have R = {(1,1),(2,1),(3,1), (2,2),(3,3)}. 5
  • 6. Example2.6:Let Abe the power set of the set {1,2} in other words, A= {φ,{1},{2},{1,2}} is the set of subsets of the set {1,2}. Write a relation on A, where (P,Q)∈R, if P⊂Q. In this case we have: R= {(φ,{1}), (φ,{2}), (φ,{1,2}), ({1},{1,2}), ({2},{1,2})}. Example2.7 :If set A has n elements and B has m elements, how many relations are there on the set A×B. Let|A|=nand|B|=m.WeknowthatR⊆ (A×B) and | A×B|=m.n, Also set of all possible subsets of A×B is power set of A×B i.e. P(A×B). Thus if | A×B|=m.n, then |P(A×B)|=2mn. Hence If set A has n elements and B has m elements, then there are 2mn relations on it. Definition2: (Inverse Relation): If R⊆ (A×B) is a relation from A×B then the inverse relation of R (denoted by R-1), is a relation from B to A. It is defined as R-1={(b,a): (a,b)∈R}. Also the domain and range of R-1 are equal to the range and domain of R. Clearly for any relation R, (R-1)-1=R. Example2.8: Let A={1,2,3} and B={a,b,c}, if R is a relation from A to B such that R={(1,b),(2,a),(2,b)}; Dom(R)={1,2}andRange(R)={a,b},then R-1={(b,1),(a,2),(b,2)} and Dom(R-1)={a,b} and range(R-1)={1,2}. 6
  • 7. Check your progress-1: Q.1: Define the following: a) Identity relation b) Universal relation c) Void relation Q.2: Let A={1,2,3,4,5,6} and let R be a relation on A defined by “x divides y”. Write R as a set of ordered pairs. Q.3: Find the inverse relation on the relation R, above, i.e. “x is multiple of y”. Q.4: Let S be the relation on the set N of +ve integers, defined by the equation x+3y=13 i.e. S={(x,y): x+3y=13}. Find the relation S? Q.5: Find the Domain and Range of the above relation? Q.5: Find the inverse of the following relations a) is shorter than b) “is younger than” c) “is child of” d) “is a sibling of” e) “is parallel to” f) “lies above” g) “is perpendicular to” 1.3 TYPES OF RELATIONS: Let A be a given non empty set then a relation R⊆A×A is called a binary relation on A. Binary relations that satisfy certain special properties can be very useful in solving computation problems. So let’s discuss some of these properties: We have following types of properties in a (Binary) relation on a given set A. 1. Reflexive 2. Irreflexive 3. Symmetric 7
  • 8. 4. Asymmetric 5. Anti-symmetric 6. Transitive 1. Reflexive Relations A relation R on a set A is reflexive if for every a∈A, aRa. that is, a relation R in a set A is said to be reflexive if every element of A is related to itself i.e. aRa is true for every a∈A. Definition2: (In terms of directed graph): R is reflexive if there must be a loop at each node a∈A. Example1: Let A be the set of all straight lines in a plane. The relation R “x is parallel to y” is reflexive since every straight line is parallel to itself. Example2: Let A be the set of numbers and relation R in A is defined by “x is equal to y” is reflexive” since each number is equal to itself. Example3: Let A={1,2,3} and the relation R in A is defined by R={(1,1),(2,2),(2,3)} is not reflexive because (3,3) does not belongs to R. The given relation R will be reflexive, if every ordered pair (a,a)∈R for all a∈A. Example4: Consider the following five relations on the set A = {1, 2, 3, 4, 5}: R1 = {(1, 1), (1, 2), (2,2),(2, 3), (1, 3), (3,3),(4,2),(4, 4),(5,5)} R2 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)} R3 = {(1, 3), (2, 1)} R4 = Ø, the empty relation R5 = A X A, the universal relation Determine which of the relations are reflexive. Solution: 8
  • 9. The only relations R1 and R5 are reflexive, since A contains the five elements 1, 2, 3, 4 and 5, a relation R on A is reflexive if it contains the five pairs (1, 1), (2, 2), (3, 3), (4, 4) and (5,5). Thus only R1 and R5 are reflexive. R2, R3, and R4 are not reflexive since, for example, (5, 5) does not belong to any of them. Check Your progress2: Consider the following five relations: 1. Relation ≤ (Less than or equal ) on the set Z of integers 2. Set inclusion ⊆ on a collection C of sets 3. Relation ┴ (perpendicular) on the set L of lines in the plane. 4. Relation││ (parallel) on the set L of lines in the plane. 5. Relation │ of divisibility on the set N of positive integers. (Recall x│y if there exists z such that xz = y.) Determine which of the relations are reflexive. The relation (3) is not reflexive since no line is perpendicular to itself. Also (4) is not reflexive since no line is parallel to itself. The other relations are reflexive; that is, x ≤ x for every integer x in Z, A⊆A for any set A in C, and n│n for every positive integer n in N. 2. Irreflexive Relations A relations R on a set is irreflexive if (a, a)∉R for every a є A. Thus R is not irreflexive if there exist at least one a∈A such that (a, a)∈R. Definition2: (In terms of directed graph): R is Irreflexive if there is no loop at any node a∈A. Example1: Let A= {1,2,3} and let R= {(1, 1),(3,2)}. 9
  • 10. Here R is not reflexive since (2,2) or (3,3)∉R. Also R is not irreflexive, since (1, 1)∈R. Example2: Let A={a,b,c}be a non empty set. Let R={(a,b),(b,c),(c,a)} Here R is irreflexive since (a,a) )∉R for every a∈A. Also note that there is no loop at any node. 3. Symmetric Relations: A relation R on a set A is symmetric if ∀a,b in A, if aRb, then bRa. In other words a relation R is symmetric if in R whenever (a, b)∈R then (b, a)∈R. Thus R is not symmetric if there exists a, b∈A such that (a, b)∈R but (b, a)∉R. Definition2: (In terms of directed graph): A relation (R) is symmetric; if one node (x) is connected to node (y) then there must be a return arc from node (y) to node (x). • A relation R is said to be symmetric if R=R-1 Example1: Let A={set of all straight lines in a plane}. The Relation R on A is defined by “ a is perpendicular to be” is a symmetric relation because a⊥b ⇒ b⊥a. Example2: Let N={set of Natural numbers}. The Relation R on N is defined by “ a is equal to b” is symmetric since aRb⇒bRa. Example3: Consider the following five relations on the set A = {1, 2, 3, 4, 5}: R1 = {(1, 1), (1, 2), (2,2),(2, 3), (1, 3), (3,3),(4,2),(4, 4),(5,5)} R2 = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (4, 4)} R3 = {(1, 3), (2, 1)} R4 = Ø, the empty relation 10
  • 11. R5 = A X A, the universal relation. Determine which of the above relations are symmetric. Solution: The relations R2, R4 and R5 are symmetric, since in R whenever (a, b)∈R then (b, a)∈R . The other relations R1 and R3 are not symmetric, since in R1, (1, 2)∈R1 but (2, 1)∉R1 and in R3; (1, 3)∈R3 but (3, 1)∉R3. Example4: Each of the following defines a relation on set N of positive integers: R: x is greater than y S: x+y=10 T: x+4y=10 Determine which of the relation are reflexive and which of them are symmetric. Solution: a) None are reflexive. For example (1,1) ∉ R , S or T. b) Only S is symmetric, since whenever (a, b)∈S then (b, a)∈S. The other relations R and T are not symmetric. ************** 4: Anti-symmetric: A relation R on a set A is anti-symmetric if whenever aRb and bRa then a = b. That is if (a,b),(b,a)∈R then there must be the case that a=b. Thus R is not antisymmetric if there exists a, b∈A such that (a, b) and (b, a) belong to R, but a ≠ b • Definition2: A relation R is said to be Anti-symmetric if (a,b)∈R⇒(b,a)∉R unless a=b. • Definition3: (In terms of directed graph): R is anti-symmetric, if whenever there is an edge from xy, with x≠y, then there is no edge from yx. Note: Symmetric and anti-symmetric relations are not negatives to each other. For example, the relation R={(1,4),(4,1),(2,4)} is neither symmetric nor anti-symmetric and the relation S={(1,1),(2,2)} is both symmetric and anti symmetric. 11
  • 12. Example1: Let A be a set of positive integers and R be a relation on A such that R={(a,b): a,b∈A and a≥b}. This relation R is an anti-symmetric relation because if (a,b),(b,a)∈R ⇒a=b Example2: Determine which of the following in above example3 is antisymmetric. Solution: R2 is not anti-symmetric since (1,2),(2,1)∈R2, but 1≠2. Similarly R5 is also not a anti-symmetric. All the other relations are anti-symmetric. 5.Asymmetric Relation A relation R on set A is asymmetric if (a, b)∈R then (b, a)∉R. It means that R is not asymmetric if for some a and b from A both (a, b)∈R and (b, a)∈R. • Definition2: R is Asymmetric, if there is an edge from xy then there must not be an edge from yx. • Symmetric and Asymmetric relations are negatives to each other i.e. if a relation is symmetric then it will not be asymmetric or vice-versa. Example1: Let A = {a, b, c, d} and let R = {(a, b), (b, b), (b, d), (d, a)}. Determine whether the relation is symmetric, asymmetric and anti-symmetric. Solution: Here (a, b)∈R but (b, a)∉R, hence R is not symmetric. Also since (b, b)∈R, R is not asymmetric and since if a ≠ b, either (a, b)∉R or (b, a)∉R, ∀a,b∈A, the R is not anti- symmetric. Example 2 Let A be a set of integers and R be a relation on A such that R = {(x, y)│ x ∈A, y∈A and x<y}. Determine whether the relation is symmetric, asymmetric and anti-symmetric. Solution: 12
  • 13. Here for every (x, y)∈R such that x<y, it is true that (y, x)∉R, hence R is not symmetric. Also R is asymmetric. If x ≠ y, then either (a, b) Є R or (b, a) Є R, hence R is antisymmetric. 6. Transitive Relations: A relation R on a set A is said to be transitive if (a,b)∈R and (b,c)∈R ⇒(a,c)∈R, for all a,b,c∈A. In other words relation R is transitive if aRb and bRc implies that aRc, for all a,b,c∈A Thus R is not transitive if there exist a, b, c ∈A such that (a, b), (b, c)∈R but (a, c)∉R. Definition2: (In terms of directed graph): R is transitive, if whenever there is an edge from xy and yz then there must also be an edge from xz. Example1: Determine which of the relations in above Example3 are transitive. Solution: The relation R1 is not transitive since(4,2), (2,3)∈R1 but (4, 3)∉R1. All the other relations are transitive. Also the relation R3 is not transitive since (2,1), (1,3)∈R3, but (2, 3)∉R3. All the other relations are transitive relation. Example2: Determine which of the relations are transitive. a) Relation ≤ on the set Z of integers b) Relation || on the set of line in the plane. c) Relation set inclusion ⊆on the collection S of sets. Solution: Relations (a) and (c) are transitive whereas (b) is not transitive, since if a||b and b||a then a is not parallel to itself. 1.4: Composition of Relations 13
  • 14. Let A, B and C is sets, and let R1 be a relation from A to B and R2 be a relation from B to C. That is, R1⊆ (A×B) and R2⊆ (B×C). Then the composite of R1 and R2 is a relation from A to C, denoted by R2οR1 and defined by R1οR2={(a,c): there exists b∈B such that (a,b)∈R1 and (b,c)∈R2} The relation R1οR2 is called the composition of R1 and R2. Suppose R is a relation on a set A, that is R1⊆ (A×A). Then RοR, the composition of R with itself is always defined. RοR is sometimes denoted by R2. Similarly, R3= RοRοR, and so on. Thus Rn is defined for all positive n. To find composition of relations using Matrix form: We can also find the composition of relations R1 and R2 (i.e. R1οR2) using matrices. Suppose MR1 and MR2 denotes the matrices of the relations R1 and R2. Then by multiplying MR1 and MR2, we get the matrix MR1.MR2(=M). The nonzero entries of this matrix M gives us the elements related to R1οR2. Example 2.12: Let A = {1, 2, 3}, B = {a, b, c}, C= {x, y, z}. Consider the following relation R1 from A to B and R2 from B to C. R1= {(1, b), (2, a), (3, c)} and R2= {(a, z), (b, x), (c, y), (c, z)} a) Find the composite relation R1οR2. b) Find the matrix for MR1οR2 and compare the results obtained in part (a). Solution: (a) The arrow diagram of the relations R1 and R2 is shown in figure-1. A B C 1 a x b 14 2 y 3 c z Figure-1
  • 15. Since 1 in A is connected to x in C by the path 1bx , so (1,x)∈ R1οR2.. Similarly 2 in A is connected to z in C by the path 2az , so (2,z)∈ R1οR2 3 in A is connected to y in C by the path 3cy , so (3,y)∈ R1οR2 3 in A is connected to z in C by the path 3cz , so (3,z)∈ R1οR2 So finally R1οR2={(1,x),(2,z),(3,y),(3,z)} (b) The matrices for MR1 , MR2 and MR1oR2 can be obtained as follows: a b c x y z x y z 1 0 1 0 a 0 0 1 1 1 0 0 MR1= 2 1 0 0 MR2= b 1 0 0 MR1. MR2 = 2 0 0 1 3 0 0 1 c 0 1 0 3 0 1 1 The non zero entries in the matrix MR1.MR2 (=M) gives a elements belongs to R1oR2. So R1οR2={(1,x),(2,z),(3,y),(3,z)} Theorem 2.1: (Show that the composition of relations is Associative). Let A, B, C and D be sets. Suppose R is a relation from A to B, S is a relation from B to C, and T is a relation from C to D. Then (RοS)οT = Rο(SοT) Solution: L.H.S.: Suppose (a,d)∈ (RοS)οT ⇒ (a,c)∈RοS and (c,d)∈T Since (a,c)∈RοS ⇒ (a,b)∈R and (b,c)∈S Now (SοT) ⇒ (b,d)∈SοT Since (a,b)∈R and (b,d)∈SοT ⇒(a,d)∈ Rο(SοT) Hence proved. Note: 1) composition of relations is Associative i.e. (RοS)οT = Rο(SοT). 15
  • 16. 2) (RοS)≠(SοR) Check your progress-3: Q.1: Let R = {(1, 2), (3, 4), (2, 2)}and S = {(4, 2), (2, 5), (3, 1), (1, 3)}. Compute RοS, SοR, Rο(SοR), (RοS)οR, RοRοR. Solution: a) RοS = {(1,5), (3, 2), (2, 5)} SοR = {(4, 2), (3, 2), (1, 4)}. Clearly RοS≠ SοR b) Rο(SοR)= {(3, 2)}. (RοS)οR = {(3, 2)}. Clearly Rο(SοR)= (RοS)οR. c) RοRοR= {(1, 2), (2, 2)} Q.2: 1.5: PICTORIAL REPRESENTATION OF RELATIONS The diagrammatical representation (also called graph) of a relation R is called a pictorial representation of the given relation R. Example 2.9 Consider the relations R defined by the equation: x2 + y2 = 36 That is, R consists of all ordered pairs (x, y) which satisfy the given equation. The graph of the equation is a circle having its center at the origin and radius 6. The pictorial representation (graph) of this equation is shown in figure-1 6 -6 0 6 0 -6 16
  • 17. Figure-1: Graphical representation of the equation: x2 + y2 = 36 Method to represent a given relations (on finite set) in pictorial form: If A and B are finite sets, then there are two ways of picturing a relation R from A to B. 1. By using matrix of the relation 2. By using Arrow diagram 3. By using directed graph of relations • Matrix of the relation (denoted by MR) is a 2D rectangular array whose rows are labeled by the elements of A and whose columns are labeled by the elements of B. Put a 1 or 0 in each position of the array according as follows: 1 if (a,b)∈R MR= 0 if (a,b)∉R Where a∈A and b∈B . • In arrow diagram, we write down the elements of A and B in two disjoint disks, and then draw as arrow from a∈A to b∈B whenever (a,b)∈R. • Directed graph method is used when R is a relation from a finite set to itself. .First we write down the elements of the set, and when we draw an arrow from each element a to each element b whenever a is related to b. Example2.10: Suppose A={1,2,3} and B={a,b,c}, if R is a relation from A to B such that R={(1,b),(2,a),(2,c),(3,c)} The following figure-a and figure-b shows these two ways of representation. 17
  • 18. a b c 1 0 1 0 1 a 2 1 1 0 2 b 3 0 0 1 3 c Figure-a Figure-b Example2.11: Let A={1,2,3,4} and a relation R from A to itself i.e. R⊆ (A×A) is defined as: R= {(1, 2), (2, 2), (2, 4), (3, 2), (3,3), (3, 4), (4, 1)} 1 2 3 4 Check your progress-2: Q.1: Given a relation R={(1,y),(2,z),(3,y),(4,x),(4,z)} on sets A={1,2,3,4} and B={x,y,z} a) Draw the arrow diagram of R b) Find the Matrix of R c) Find the Inverse relation (R-1) of R in matrix form. d) Determine the Domain and Range of R. Q.2: Draw the directed graph of the following relation on a set A={1,2,3,4} i. R={(1,2)(2,2),(2,4),(3,2),(3,4)(4,1),(4,3)} ii. R={(1,1),(2,2),(2,3),(3,2),(4,2),(4,4)} 1.6: CLOSURE OF RELATIONS: If R is a binary relation and p is some property, and then the p closure of R is the smallest binary relation containing R that 18
  • 19. satisfies property p. Our goal is to construct closures for the reflexive, symmetric and transitive properties. These are commonly known as: • Reflexive closure (denoted by r(R)) • Symmetric closure (denoted by s(R)) • Transitive closure (denoted by t(R)) Closures of relations are used to make the given relation Reflexive, Symmetric and Transitive, whenever the given relation is not in proper form (i.e. reflexive, symmetric or transitive). Reflexive, Symmetric & Transitive Closures Let R be a relation on a set A. Then reflexive and symmetric closure of R, is defined as: 1. r(R)=R ∪ DA , where DA={(a,a):a∈A} is the diagonal or equality relation on A. 2. s(R)=R ∪ R-1, where R-1 is the inverse relation of R, i.e. R-1={(y,x): (x,y)∈R} 3. t(R)=R∪R2∪R3∪….. 4. If A is finite with n elements, then t(R)= R∪R2∪R3∪….Rn. In other words, If R is a binary relation on A, then the reflexive closure r(R) can be constructed by including all pairs (a,a) that are not already in R, and To construct symmetric closure s(R), we must include all pairs for (y,x) for which (x,y)∈R. To construct Transitive closure t(R), if R contains the pairs (a,b) and (b,c) then t(R) must contains the pair (a,b), for all a,b,c∈A. 19
  • 20. Finding t(R) can take a lot of time when A has a large number of elements. There exist an efficient way for computing t(R), known as warshall’s algorithm (which may be discussed latter). Example 1 Consider the following relation R on the set A = {1, 2, 3, 4}: R = {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3)}. Then r( R ) = R ∪ DA =R ∪ {(2, 2),(4, 4)}={(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3),(2,2),(4,4)} and s( R) = R ∪ R-1= R∪{(4, 2), (3, 4)}= {(1, 1), (1, 3), (2, 4), (3, 1), (3, 3), (4, 3),(4,2),(3,4) t(R)= R∪R2∪R3∪R4={…..} Example2: Determine which of the following is transitive relation: a) Relation ≤ on the set Z of integers. b) Relation || on the set of lines in the plane. Solution: a) The relation ≤ is transitive, since a≤b and b≤c then a≤c. b) The relation || is not transitive, since a||b and b||a then a is not || to a itself. 1.7: EQUIVALENCE RELATIONS (or RST relation): A relation R in a set A is said to be an equivalence relation if 1. R is Reflexive i.e. aRa ∀a∈A. 2. R is Symmetric i.e. aRa⇒bRa, ∀a,b∈A. 3. R is Transitive i.e. If aRb and bRc⇒ aRc ∀a,b,c∈A. Example1: Relation R on a set A defined by “a is equal to b” is an equivalence relation, since it is reflexive (a = a for every a∈A), symmetric (If a = b, then b = a , ∀a,b∈A) and transitive (If a = b and b = c, then a = c, ∀a,b,c∈A). 20
  • 21. Example2: Relation R in a set A defined by “ x is parallel to y” is also an equivalence relation since it it is reflexive, symmetric and transitive. Example3: The relation ⊆ (set inclusion) is not an equivalence relation, since it is reflexive and transitive, but it is not symmetric. Since A⊆B does not imply B⊆A. Example4: A = {1, 2, 3, 4, 5}. Let R be relation on A such that R = {(x, y) │ x + y = 5} We get R as {(1, 4), (2, 3), (4, 1), (3, 2)}. We can say that, R is not reflexive as for every a, (a, a)∈R. R is symmetric as if (a, b)∈R then (b, a)∈R and R is antisymmetric relation also. R is not transitive as (1, 4) ∈R and (4, 1)∈R but (1, 1)∉R. Hence R is not equivalence relation. PARTIAL ORDERING RELATIONS (POR): 1.8 A relation R on a set A is called a Partial ordering or a partial order relation, if it is: 1. Reflexive, i.e. aRa ∀a∈A. 2. Anti-symmetric, i.e. If aRb and bRa⇒ a=b ∀a,b∈A. 3. Transitive i.e. If aRb and bRc⇒ aRc ∀a,b,c∈A. The set over which a partial order is defined is called a partially ordered set (or POSET). It is denoted by (A,R) where A is a given set and R is a relation which satisfy the above three conditions. POSET is discussed in detail, in the Lattice chapter (Unit-II). Example1:The relation ⊆ of set inclusion is a partial ordering on any collection of sets since set inclusion has the following three desired properties. Reflexive, i.e. a ⊆ a ∀a∈A. Anti-symmetric, i.e. a ⊆ b and b⊆ a⇒ a=b, ∀a,b∈A Transitive i.e. if a⊆b and b⊆c, then a⊆c ∀a,b,c∈A. Example2: The relation ≤ (less than or equal to) on the set R of real numbers is a partial order relation. Since the relation (≤) is: 1. Reflexive i.e. a≤a, ∀a∈R 21
  • 22. 2. Anti-symmetric i.e. a ≤b and b≤ a⇒a=b, ∀a,b∈R 3. Transitive i.e a≤b and b≤c, ⇒a≤c ∀a,b,c∈R Example3: Let N be the set of all positive integers. The relation “a divides b” is a partial ordering on N. However, “a divides b” is not a partial ordering on the set Z of integers since a|b and b|a does not imply a = b. For example, 2|-2 and - 2│2 but 2 ≠ -2. Check your progress-3: 1.9: Functions: A function is a special kind of relation. For example suppose X= the set of students of UP Technical university, and Y=the set of their enrolment numbers. Now consider a relation R between A to B, i.e. R ={(a,b)∈AxB | b is enrollment number of a }. It is a ‘special’ relation, because to each a∈A ∃! b such that aRb. We call such a relation a function from A to B. Definition: Suppose X and Y be two nonempty sets. A rule or a correspondence which assign each element x∈X to a unique element y∈Y is called a function or mapping from X to Y and written as f: XY (read as “ f is a function which maps X into Y) • The main idea is that each element of X is associated with exactly one element of B. In other words if x∈X is associated with y∈Y, then x is not associated with any other elements of Y. • The element y is called the image of x under f and is denoted by f(x) i.e. y=f(x) • The element x is called the pre-image of y. 22
  • 23. Domain: The set X is called the domain of the function f, and • Co-domain: The set B is called the co-domain of the function f. • Range of f: The range of f, denoted by Range (f), is the subset of elements in the co-domain Y that are associated with some element of X. In other words Range (f)={f(x): x∈X}. It is also denoted as f(X). • Given an element x∈X, the unique element of Y to which the function f associates, is denoted by f (x) and is called the f-image (or image) of x or the value of the function f for x. We also say that f maps x to f(x). The element x is referred to as the pre-image of f (x). Example1: If A = {1,2,3,4,5}, B = {1,8,27,64,125}, and the rule f assigns to each member in A its cube, then f is a function from A to B. The domain of f is A, its co-domain is B and its range is {1,8,27,64}. Example2: Find the domain and range for f : f(x) =x/1-x Solution: We can see that 1–x = 0, if x = 1, in this case f(x) will be undefined. Domain of f can be taken as R~{1}and co-domain can be R. (Necessary conditions to be a function f: XY): • A single element in domain X cannot have more than one image in Y. However, two or more than two elements in X may have the same image in Y (see figure-1). • Every element in domain X must have its image in Y but every element in Y may not have its pre- image in X (otherwise it is not a function, see figure- a 1 a 1 b 2 b 2 c 3 c 3 Figure1-2: Two associations (mapping) that are not function 23
  • 24. Frequently, a function can be expressed by means of a mathematical formula. For example, consider the function f, which maps each natural number N to its square. We may describe this function by the formula: f(x) = x2 or y = x2 In the first notation, x is called a variable and the letter f denotes the function. In the second notation, x is called the independent variable and y is called the dependent variable since the value of y will depend on the value of x. Remark: Whenever a function is given by a formula in terms of a variable x, we assume, unless it is otherwise stated, that the domain of the function is R (or the largest subset of R for which the formula has meaning) and the co-domain in R. Example1: Suppose A ={1,2,3}, B= {1,4,9,11} and f assigns to each member in A its square values. Then f is a function from A to B. But if A={1,2,3,4}, B={1,4,9,10} and f is the same rule, then f is not a function from A to B since no member of B is assigned to the element 4 in A. Example1: Let X={1,2,3,4,5} and Y={a,b,c,d,e}. Determine whether or not each relation below is a function from XY. If they are functions, give the domain, co-domain and Range of each, if they are not tell why? a) f={(1,a),(2,b),(3,b),(5,e)} b) g={(1,e),(5,d),(3,a),(2,b),(1,d),(4,a)} c) h={(5,a),(1,e),(4,b),(3,c),(2,d)} 24
  • 25. Solution: a) f is not a function, since 4∈X is not associated with any element of Y or f(4) don’t have any image inY. b) g is not a function since 1∈X is associated with two different elements, namely e and d. c) h is a function from X to Y since each member of X appears as the first coordinate in exactly one ordered pair in function (say f); here f(1)=e, f(2)=d, f(3)=c, f(4)=b and f(5)=a. Domain={1,2,3,4,5}, Co- domain={a,b,c,d,e} and Range(h)={a,b,c,d,e} Remark: Every relation is not necessarily a function but every function is a relation. Example2: State whether or not each diagram in figure-1 defines a function from X={a,b,c} into Y={1,2,3}. a 1 a 1 a 1 b 2 b 2 b 2 c 3 c 3 c 3 Figure-a figure-b Figure-c Solution: a) No. There is nothing to assigned to the element b∈A b) No. f(c) has two images x and z in Y. c) Yes. Difference between Relation and function: • Every function f: XY gives rise a relation from X to Y. • Every relation (R⊆X×Y) is not necessarily a function (f: XY).. Example1: Let X={1,2,3,4} and Y={a,b,c}. Consider the following relations R1 and R2 (i.e. R1,R2⊆X×Y: 25
  • 26. R1={(1,a),(2,a),(3,b),(4,c)} R2={(1,a),(2,b),(1,c),(3,a),(4,b)} Determine whether or not each relation below is a function from X to Y. Solution: Yes, R1 is a function from X to Y. Each element of X appears as the first element in one and only one ordered pair in R1, i.e. every element in X must have its image in Y. Obviously R1 is also a relation from X to Y. But R2 is not a function from X to Y since 1 is associated with two different elements a and c of Y. Hence every relation is not necessarily a function. Example 2: Consider the following relations on the set A = {1, 2, 3}: f = {(1, 3), (2, 3), (3, 1)} g= {(1, 2), (3, 1)} h= {(1, 3), (2, 1), (1, 2), (3, 1)} Determine whether or not each relation above is a function from A into A. Solution: f is a function from A into A since each member of A appears as the first coordinate in exactly one ordered pair in f; here f(1) = 3, f(2) = 3 and f(3) =1. g is not a function from A into A since 2 Є A is not the first coordinate of any pair in g and so g does not assign any image to 2. Also h is not a function from A into A since 1 Є A appears as the first coordinate of two distinct ordered pairs in h, (1, 3) and (1, 2). If h is to be a function it cannot assign both 3 and 2 to the element 1 Є A. Equality of two functions: Two functions f and g of AB are said to be equal iff f(x)=g(x) for all x∈A, and we write f=g. Note that two equal function f and g are defined on same domain A. For two unequal mappings from A to B, there must exist at least one element x∈A such that f(x)≠g(x). Example1: If f(x)=x3+1 where x is any real number and g(x)= x3+1 where x is any complex number then f≠g because the domain of f and g are different. Example2: Let A={3,4} and B={2,4,9,16}. Let a function f be defined from A to B by f(x)= x2 and g={(3,9),(4,16)}, then f=g because f and g 26
  • 27. both have the same domain={3,4} and each of them assigns the same image to each element in the domain. 1.10 TYPES OF FUNCTIONS (or mappings): Let f: AB is a given function. We have following types of functions (or mapping) between A to B. 1. One-to-one mapping 2. Onto mapping 3. Invertible function (i.e. one-one onto) 4. Into mapping 5. Many one 6. Many one onto 7. Many one into 1.0 One-one mapping: A function f: A → B is said to be one-to-one or one-one or injective, written as 1-1, if different elements in the domain A have different images in B. Another way to say this is that f is one-one if f(x) =f(y) implies x= y (x,y∈A). An injective function is called an injection. The following figure-1 illustrates an injection from AB. 1 a 2 b 3 c d Figure-1: An injection For example f: RR be defined by f(x) = 2x+1, x∈R, then for x1 ,x2∈R (x1≠x2) we have f(x1)≠f(x2). So, f is 1–1. 27
  • 28. 2: Onto mapping A function f: A → B is said to be an onto or surjective if each element of B is the image of some element of A. In other words, f: A → B is onto if the image of f is the entire co-domain, that is, f(A)=B. [Equivalently, we say that f is onto if Range(f)=B]. If a function is mapping of A onto B, we write: onto f: A B. An surjective function is called an surjection. The following figure-2 illustrates an injection from AB. 1 a 2 b 3 c 4 Figure-2: A surjection For example, f: ZZ : f(x) = x+1, x∈Z, then every element y in the co-domain Z has a pre-image y–1 in the domain Z. Therefore, f(Z) = Z ,and f is an onto mapping. 3: Invertible (one-one and Onto) Mapping A function f; A→ B is invertible (or bijective) if its inverse relation f -1 is a function from B to A. In general, the inverse relation f -1 may not be a function. Another term for bijective is “one-to-one and onto”. A bijective function is called a bijection or a “one-to-one correspondence” The following figure-3 illustrates an bijection from AB. 1 a 2 b 3 c 4 d 28 Figure-3: A bijection
  • 29. The following theorem gives a necessary condition for invertible (or one-one and onto) function: Theorem1: A function f: A → B is invertible if and only if f is both one-to-one (i.e. 1-1) and onto. • If f: A→ B is both one-to-one and onto, then f is called a one-to- one correspondence between A and B. This is called so because each element of A corresponds to a unique element of B and vice versa. • In this case, each element of A maps to a distinct element of B, and vice-versa. For example, f: ZZ : f(x) = x+2, x∈Z is both injective and surjective. So, f is bijective. Example1: Consider the functions e: AB, f: BC, g: CD and h; DE defined by the following diagram: Determine whether the above functions are one-one, onto and invertible function. Solution: e: is one-to-one as no element in B is image of more than one element in A. f: is one-to-one as no element in C is image of more than one element in B. but g: is not one-to-one as g(r)=g(u)=v h: is not 1-1 as h(v)=h(w)=z. e: is not onto since 3∈B is not the image under e of any element of A. f: is onto since every element of C is the image under f of some element of B, i.e. f(B)=C 29
  • 30. g: is onto since every element of D is the image under g of some element of C, i.e. g(C)=D. h: is not onto since x,y∈E are not the image under h of any element of D. only f is invertible since f-1 is exist and it is a function from C to B. Example2: Let A be set of employees of a company and let B be the set of their telephone extensions. Assuming that all the employees are listed and that every person has his/her own extension, then the mapping from A to B is invertible. Example3:Thefunctione: RR; e(x) = x2 is neither 1-1 nor onto. Example4: Thefunctionf: RR; f(x) = 2x is 1-1 and not onto. Example5: the function h(x) = x3 is 1-1 and onto. Note:increasingfunctionsare1-1. Example6: corman p.163: Example1: Example2: Example3: 4: Into mapping: A function f: A → B is said to be into function if there exits at least one element in (co-domain set) B which is not the f-image of any element in (domain set) A. We say that f is a mapping of A ‘into’ B. In this case the range of f is a proper subset of the co-domain of f i.e. f(A)⊂B. 1 a 2 b 3 c Figure-2: An into mapping 5: Many one: A mapping f: A → B is said to be many-one if two (or more than two) distinct elements in A has the same image in B i.e. x,y∈A and x≠y ⇒f(x)=f(y). -2 4 Figure-2: Many-one mapping 9 30 2 3 (Because two different elements in A (i.e. -2,2} have the same f-image in B) 4 16
  • 31. 6: many-one onto: A mapping f: A → B is said to be many-one onto mapping if it is many-one and onto. In such a mapping following two conditions are hold: a) if x,y∈A and x≠y ⇒f(x)=f(y) and b) the image of f is the entire co-domain, that is, f(A)=B Example1: If A={2,3,4}, B={x,y}, then f={(2,x),(3,y),(4,y)} is a many- one onto mapping. 7: Many one into: A mapping f: A → B is said to be many-one into if it is many-one and into. In such a mapping following two conditions are hold: a) if x,y∈A and x≠y ⇒f(x)=f(y) and b) if there exits at least one element in B which is not the f-image of any element of A. Example1: If A={-1,1,-3,3,4} and B={1,9,16}. Show that f: AB={(x,y): y=x2, x∈A, y∈B} is a many-one onto mapping. Proof: i) As f(-1)=f(1)=1; f(-3)=f(3)=9; and f(4)=16 So every element of A has f-image in B. Thus it is a mapping. ii) f(-1)=f(1)=1 and f(-3)=f(3)=9 so two elements of A have the same image in B, thus it is many-one mapping iii) Every element of B is f-image of some element of A. Thus it is onto mapping. Therefore f is a many-one onto mapping. Example1(P-68,69)-book Example2: (p3.23)(SS) Check your progress-4: 31
  • 32. 1.11COMPOSITION OF FUNCTION Let A,B,C be three sets and f and g be two functions such that f: AB and g: BC; where the co-domain of f is the domain of g. Then we may define a new function from A to C [(gof): AC], called the product or composition of f and g and denoted by (gof), as follows: (gof)(x)=g[f(x)], ∀x∈A That is, to find (gof)(x), first we have to find the image of x under f and then find the image of f(x) under g. Note: if we think f and g as relation then the composition of function is same as the composition of relation. Only the notation is different. We use the gof for the composition of f and g, instead of fog, which is used for relation. Theorem: (Associativity of composites of functions): Let A,B,C and D be four sets and f, g, h be three functions such that f: AB, g: BC, h: CD then (hog)of=ho(gof) Proof: It can be easily seen that both (hog)f and ho(gof) are mapping of AD. These two mappings will be equal if they assign the same image to each element x in the domain A. i.e. if [(hog)of](x)=[ho(gof)](x) By the definition of composites of functions, [(hog)of](x)=(hog)[f(x)]=h[g{f(x)}]=h[(gof)(x)]=[ho(gof)](x). Hence (hog)of=ho(gof) Example 1,2,3,4,5 (pundir)-p-32,33 Example3.8,3.9.3.10 (SS)-p-3.23,3.24,3.27.3.28. 1.12RECURSIVELY DEFINED FUNCTIONS: A function is said to be recursively defined if the function definition refers to itself or call itself repeatedly. The recursive definition must have the following two properties: 32
  • 33. A recursive definition has two parts: 1. Base step (B): Definition of the smallest argument (usually f (0) or f (1)), for which the function does not call itself. 2. Recursive step (R): Definition of f (n), given f (n - 1), f (n - 2), etc. In other words a rule (or rules) that show how to construct new elements of f from old ones. The argument of f must be closure to the Base value as defined in step-1. Here is an example of a recursively defined function: We can calculate the values of this function: f (0)=5 f (1)= f (0) + 2 = 5 + 2 = 7 f (2)= f (1) + 2 = 7 + 2 = 9 f (3)= f (2) + 2 = 9 + 2 = 11 This recursively defined function is equivalent to the explicitly defined (by a formula in terms of the variable) function f (n) = 2n + 5. However, the recursive function is defined only for nonnegative integers. Here is another example of a recursively defined function: The values of this function are: f (0)=0 f (1)= f (0) + (2)(1) - 1 = 0 + 2 - 1 = 1 f (2)= f (1) + (2)(2) - 1 = 1 + 4 - 1 = 4 f (3)= f (2) + (2)(3) - 1 = 4 + 6 - 1 = 9 f (4)= f (3) + (2)(4) - 1 = 9 + 8 - 1 = 16 ……. This recursively defined function is equivalent to the explicitly defined function f (n) = n2. Again, the recursive function is defined only for nonnegative integers. 33
  • 34. Here is one more example of a recursively defined function: The values of this function are: f (0)= 1 f (1)= 1⋅f (0) = 1⋅1 = 1 f (2)= 2⋅f (1) = 2⋅1 = 2 f (3)= 3⋅f (2) = 3⋅2 = 6 f (4)= 4⋅f (3) = 4⋅6 = 24 f (5)= 5⋅f (4) = 5⋅24 = 120 ……. This is the recursive definition of the factorial function, F(n) = n!. Thus a factorial function may also be defined as: a) If n=0, then f(n)=n!=1 {here 0 is a base value} b) If n>0, then f(n)=n!=n.(n-1)! { Here the n! is defined in terms of smaller value of n which is closure to the base value 0}. Observe that this (and all the above) definition are recursive since all these functions definition are refers to itself. Note: Not all recursively defined functions have an explicit definition (by a formula in terms of the variable). Example1: Let us calculate 3! using the recursive definitions. This calculation requires the following seven Steps: 1) 3! = 3 · 2! 2) 2! = 2 · 1! 3) 1! = 1 · 0! 4) 0! = 1 5) 1! = 1 · 1 = 1 6) 2! = 2 · 1 = 2 7) 3! = 3 · 2 = 6 34
  • 35. Here we first defines 3! In terms of 2!, so we must postpone evaluating 3! Until we evaluate 2!. In step2 we define 2! in terms of 1!, so we must postpone evaluating 2! Until we evaluate 1! An so on. step5 can explicitly evaluate 0!(=1), which is the base value (i.e. 0) of the recursive definition. In step5 to step7, we backtrack, using 0! to find 1!, using 1! to find 2!, and finally using 2! to find 3!. The final answer is 6. 2. The Fibonacci Numbers: One special recursively defined function, which has no simple explicit definition, yields the Fibonacci numbers (usually denoted by fn, f1, f2, ….}. The main characteristic of Fibonacci number is that the sums of two previous numbers give a next number. If f0=0 and f1=1(base value) then the sequence of Fibonacci numbers is: 0, 1, 1, 2, 3, 5, 8, 13, 21,……. Thus a Fibonacci number can be defined recursively as: a) If n = 0 or n= 1, then Fn = n. {here 0 and 1 are base values} b) If n > 1, then Fn = Fn – 2 + Fn – 1. {Here Fn is defined in terms of smaller value of n which is closure to the base values 0 and 1}. 3. Ackermann Function: The Ackermann function is a function with two arguments, each of which can be assigned any non-negative integer, that is, 0, 1, 2 … The Ackermann function is defined recursively for non-negative integer’s m and n as follows: 35
  • 36. n+1 if m=0 A(m,n)= A(m-1,1) if m>0 and n=0 A(m-1, A(m,n-1)) if m>0 and n>0 Observe that A (m, n) is explicitly given only when m = 0. The base criteria are the pairs (0, 0), (0, 1), (0, 2), (0, 3),… (0, n), … Although it is not obvious from the definition, the value of any A(m, n) may eventually be expressed in terms of the value of the function on one or more of the base pairs. Lets see some special values for integer m: A(0,n)=n+1 A(1,y)=n+2 A(2,n)=2n+3 A(3,n)=2n+3-3 A(4,n)= Expressions of the latter form are sometimes called power towers. A(0,n) follows trivially from the definition. A(1,n) can be derived as follows: A(1,n)=A(0,A(1,n-1)) =A(1,n-1)+1 =A(0,A(1,n-2))+1 =A(1,n-2)+2 =…. =A(1,0)+n =A(0,1)+n=2+n Similarly we can calculate A(2,n)=2n+3. Table of values of A(m,n): The following tables can be used for calculating the value for A(m,n). mn 0 1 2 3 4 n 0 1 2 3 4 5 n+1 1 2 3 4 5 6 n + 2 = 2 + (n + 3) − 3 2 3 5 7 9 11 2n + 3 = 2 * (n + 3) − 3 36
  • 37. 3 5 13 29 61 125 2(n + 3) − 3 65536 4 13 6553 2 −3 22↑65536-3 A(3, A(4, 3)) 2 (2 (2 (... 2))) - 3 (n + 3 twos) 3 =2 (n + 3) - 3 5 6553 A(4, A(5, 1) A(4, A(5, 2) A(4, A(5, 3)) A(4, A(5, n-1)) 3 ) ) *see Wikipedia. Note that from the table: A(1, n) = 2 + (n + 3) - 3 A(2, n) = 2 × (n + 3) - 3 A(3, n) = 2↑(n + 3) - 3 A(4, n) = 2 (2 (2 (... 2))) - 3 (n + 3 twos) = 2 (n + 3) - 3 A(5, n) = 2 (n + 3) - 3 etc. Example1: By using the definition of the Ackermann function, find the value of A(1,3). Solution: 1. A(1,3)=A(0,A(1,2)) 2. A(1,2)=A(0,A(1,1)) 3. A(1,1)=A(0,(1,0)) 4. A(1,0)=A(0,1) 5. A(0,1)=1+1=2 6. A(1,0)=2 7. A(1,1)=A(0,2) 8. A(0,2)=2+1=3 9. A(1,1)=3 10. A(1,2)=A(0,3) 11. A(0,3)=3+1=4 12. A(1,2)=4 13. A(1,3)=A(0,4) 14. A(0,4)=4+1=5 15. A(1,3)=5 So here we can see that the value of A (1, 3) is requires 15 steps. In the above calculation Forward movement means we are postponing an evaluation and calling the definition. The backward movement means we are backtracking. The result of A(1,3)=5 can also be verified from the above table. 37
  • 38. Check your progress-5: Q.1 P-3.33, Q3.30,3.31(SS) 1.13: Piano’s Axiom In mathematical logic, the Peano axioms, also known as the Dedekind-Peano axioms or the Peano postulates, are a set of axioms for the natural numbers presented by the 19th century Italian mathematician Giuseppe Peano. The Peano axioms define the properties of natural numbers, usually represented as a set N. Peano defines natural numbers in terms of three postulates (called Peano’s Pastulates in his honour). N is a set with the following properties: P1: 1 is a natural number i.e. 1∈N P2: For each n∈N, there exist a unique successor n*∈N such that i) m*=n* if and only if m=n {i.e. Two numbers of which the successors are equal are themselves equal}. ii) There is no element k∈N such that k*=1 {i.e. for every natural number n, n* ≠ 1. That is, there is no natural number whose successor is 1}. P3: (induction axiom): Let K be a subset on N such that • 1∈K and • For every natural number n, if n is in K, then n* (successor of n) is in K, then K contains every natural number i.e. K=N. (i.e. If a set K of natural numbers contains 1 and also the successor of every natural number in K, then every natural number is in K}. The elements of N are called the natural numbers. The successor n* of n is nothing but n+1 in the usual sense. Thus 2=1* 3=2*=(1*)* 4=3*=(2*)*=((1*)*)* etc. In this way all the natural numbers can be obtained. 1.13: Mathematical Induction P-105(DU book) 38