









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
maths cheat sheet for students in 3rd semested
Typology: Schemes and Mind Maps
1 / 17
This page cannot be seen from the preview
Don't miss anything!










Department of Applied Science & Humanities 3rd Semester B. Tech (CSE, IT) Discrete Mathematics ( 2 03191202) UNIT- 1 Sets, Relation & Functions
Overview:
Cartesian product of sets Relations and their properties Composition of relations POSets and equivalence sets Matrix representation of relations Digraph of relations Closures of relations n-tuples Database and Relations Cantor‘s diagonal argument The Power set theorem Schroder-Bernstein Theorem
Weightage: 11% Teaching Hours: 5
Introduction:
Much of mathematics is about finding a pattern – a recognisable link between quantities that change. In our daily life, we come across many patterns that characterise relations such as brother and sister, father and son, teacher and student. In mathematics also, we come across many relations such as number m is less than number n , line is parallel to line , set A is a subset of set B. In all these, we notice that a relation involves pairs of objects in certain order. In this Chapter, we will learn how to link pairs of objects from two sets and then introduce relations between the two objects in the pair. Finally, we will learn about special relations which will qualify to be functions. The concept of function is very important in mathematics since it captures the idea of a mathematically precise correspondence of one quantities with the other.
Prerequisites: Theory of sets: Definition Operations on sets Cardinality of sets Subset and Power set Application:
The time required to manipulate information in a database depends on how this information is stored. The operations of adding and deleting records, updating records, searching for records, and combining records from overlapping databases are performed millions of times each day in a large database. Because of the importance of these operations, various methods for representing databases have been developed. One of these methods, called the relational data model is based on the concept of a relation. The database query language SQL (short for Structured Query Language) can be used to carry out the operations we have described in this section. Example 12 illustrates how SQL commands are related to operations on n -ary relations.
The ordered n-tuple is the ordered collection ( ) that has as its first element, as its second element,…, and as its n th element. Two ordered n -tuples are equal if and only if each corresponding pair of their elements is equal. In other words, (^ )^ ( ) if and only if for
Definition
Let P and Q be two sets. The Cartesian product P × Q is the set of all ordered pairs (^ ) , where and
i.e. *( ) +
Note the following: The Cartesian product of the sets denoted by is the set of ordered n - tuples (^ ), where belongs to for. In other words, *( )| +The ordered pairs ( ) and ( ) are equal if and only if and. If either P or Q is the null set, then P × Q will also be empty set. If A and B are non-empty sets and either A or B is an infinite set, then so is A × B. If there are p elements in A and q elements in B, then there will be pq elements in A × B , i.e., if n(A) = p and n(B) = q, then n(A × B) = pq. *(^ )|^ +
Illustration
Consider the two sets: * +, where represent Delhi, Madhya Pradesh and Karnataka, respectively and *^ +^ representing codes for the licence plates of vehicles issued by DL, MP and KA.
If the three states, Delhi, Madhya Pradesh and Karnataka were making codes for the licence plates of vehicles, with the restriction that the code begins with an element from set A , which are the pairs available from these sets and how many such pairs will there be?
The available pairs are:
(DL,01), (DL,02), (DL,03), (MP,01), (MP,02), (MP,03), (KA,01), (KA,02), (KA,03) and the product of set A and set B is given by
A × B = {(DL,01), (DL,02), (DL,03), (MP,01), (MP,02), (MP,03), (KA,01), (KA,02), (KA,03)}.
It can easily be seen that there will be 9 such pairs in the Cartesian product, since there are 3 elements in each of the sets A and B. This gives us 9 possible codes.
Also note that the order in which these elements are paired is crucial.
For example , the code (DL, 01) will not be the same as the code (01, DL).
Problem. Let *^ +^ and *^ +^ and let *(^ )|^ +.
Problem. Consider these relations on the set of integers: *( ) | +, *( ) | + *( ) | + *( ) | + *( ) | + *( ) | + Which of these relations contain each of the pairs (1,1), (1,2), (2,1), (1,−1), and (2,2)? Solution: The pair (1,1) is in R 1 , R 3 , R 4 , and R 6 ; (1,2) is in R 1 and R 6 ; (2,1) is in R 2 , R 5 , and R 6 ; (1,−1) is in R 2 , R 3 , and R 6 ; and finally, (2,2) is in R 1 , R 3 , and R 4.
Exercise
1. Let * + Let a relation on be defined as *( ) +. Write down its domain, codomain and range. 2. Let * + and * +. Find the number of relations from to. Which of the following is not a relation from to? Justify your answer. (i) *( ) ( ) ( )+ (ii) *(^ ) (^ )+ (iii) *( ) ( ) ( )+ (iv) *( ) ( )+ 3. If *( ) ( ) ( )+ and *( ) ( ) ( )+ represents some relations on some
sets then what is 1) 2) 3) 4) – 5) R⊕S Also verify if (i) ( ) ( ) ( ) and (ii) ( ) ⊆ ( ) ( )
Definition Let be a relation from a set to a set and a relation from B to a set. The composite of and given by is the relation from to consisting of ordered pairs ( ) where , , and for which there exists an element such that ( ) and ( ) S. Thus, *( )|( ) ( ) +. In other words (^ )^ if and only if and for some.
Note:
Problem. Let *( ) ( ) ( ) ( ) ( )+ and * (^ ) (^ ) (^ ) (^ ) (^ )+^ be two relations on some sets. Check if is possible or not. If it is possible then write the elements of the relation .
Solution Here, (^ )^ *^ +^ is a subset of ( )^ *^ + Hence, is Possible. Further, *(^ ) (^ ) (^ ) (^ ) (^ ) (^ )+
Problem. Let *( ) ( ) ( ) ( )}. Find the powers Rn , n= 2,3,4,.... Solution *( ) ( ) ( ) ( )+ Further, *( ) ( ) ( ) ( )+ Similarly, *(^ ) (^ ) (^ ) (^ )+ It follows that for
Exercise:
Let be a set. Let be a relation on it.
The relation is said to be reflexive if (^ )^ for every In other words, a relation on A is reflexive if every element of A is related to itself. The relation is said to be transitive, if ( ) ( ) ( ) , for all The relation is said to be symmetric ( ) ( ) for all The relation is said to be anti-symmetric if (^ )^ (^ )^ ,for all
Function We can, visualise a function as a rule, which produces new elements out of some given elements. There are many terms such as ‗map‘ or ‗mapping‘ used to denote a function.
Definition A relation f from a set A to a set B is said to be a function if every element of set A has one and only one image in set B. In other words, A relation f is a function from a non-empty set A to a non-empty set B if (i) the domain of f is A (ii) no two distinct ordered pairs in f have the same first elements.
Note: If is a function from A to B and ( ) , then we write ( ) , where is called the image of under and is called the preimage of under f.
Problem. Examine each of the following relations given below and state in each case, giving reasons whether it is a function or not on the given domain?
(i) R = {(2,1),(3,1), (4,2)}, Domain * + (ii) R = {(2,2),(2,4),(3,3), (4,4)} , Domain * + (iii) R = {(1,2),(2,3),(3,4), (4,5), (5,6), (6,7)}, Domain *^ +
Representing Relations Using Matrices
A relation between finite sets can be represented using a zero–one matrix.
Suppose that R is a relation from * + to * +.
(Here the elements of the sets A and B have been listed in a particular, but arbitrary, order. Furthermore, when A = B we use the same ordering for A and B .)
The relation R can be represented by the matrix , - where {
In other words, the zero–one matrix representing R has a 1 as its( )th entry when is related to , and a 0 in this position if is not related to.
Note: Such a representation depends on the orderings used for A and B.
Problem. Suppose that * +and * + Let R be the relation from A to B containing ( ) if. What is the matrix representing R? Solution
Because *( ) ( ) ( )+, the matrix for R is MR = [ ]
Problem. Let * + and * +
Which ordered pairs are in the relation R represented by the matrix MR =[^ ]^?
Solution: Because R consists of those ordered pairs ( ) with , it follows that *( ) ( ) ( ) ( ) ( ) ( ) ( )+ Remark R is reflexive if and only if for. In other words, R is reflexive if all the elements on the main diagonal of MR are equal to 1. Note that the elements off the main diagonal can be either 0 or 1.
(The matrix for a reflexive relation)
The relation R is symmetric if and only if whenever.
This also means whenever. Consequently, R is symmetric if and only if , for all and. i.e. R is symmetric if and only if , i.e, R is symmetric if MR is a symmetric matrix. The relation R is anti-symmetric if and only if with ,then.
In other words, if then either. The form of the matrix for an antisymmetric relation is illustrated in Figure.
Matrix of Union and Intersection of two relations Suppose that R and S are relations on a set A represented by the matrices and , respectively. The matrix representing the union of these relations has a 1 in the positions where either or has a 1. The matrix representing the intersection of these relations has a 1 in the positions where both and have a 1. Thus, the matrices representing the union and intersection of these relations are and.
Problem.
Representing Relations Using Digraphs
There is another important way of representing a relation using a pictorial representation.
Each element of the set is represented by a point, and each ordered pair is represented using an arc with its direction indicated by an arrow.
We use such pictorial representations when we think of relations on a finite set as directed graphs , or digraphs.
Definition A directed graph, or digraph, consists of a set V of vertices (or nodes) together with a set E of ordered pairs of elements of V called edges (or arcs). The vertex ‗a‘ is called the initial vertex of the edge (a,b), and the vertex ‗ b‘ is called the terminal vertex of this edge. An edge of the form (a,a) is represented using an arc from the vertex ‗a‘ back to itself. Such an edge is called a loop.
REMARKS A relation R is reflexive if and only if there is a loop at every vertex of the directed graph, so that every ordered pair of the form ( ) occurs in the relation. A relation is transitive if and only if whenever there is an edge from a vertex x to a vertex y and an edge from a vertex y to a vertex z, there is an edge from x to z (completing a triangle where each side is a directed edge with the correct direction). A relation is symmetric if and only if for every edge between distinct vertices in its digraph there is an edge in the opposite direction , so that ( ) is in the relation whenever ( ) is in the relation. A relation is antisymmetric if and only if there are never two edges in opposite directions between distinct vertices.
Problem.1 Draw the directed graph of the relation *( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )+
Problem.2 Draw the directed graph of the relation *( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )+ Problem.3 Determine whether the relations for the directed graphs shown in the following figure are reflexive, symmetric, antisymmetric, and/or transitive.
(a) (b) (c) (d)
Problem.4 Write the relation represented by the following digraph and also write the matrix representing this relation.
(a) (b)
Solution.
(a) *(^ ) (^ ) (^ ) (^ ) (^ ) (^ ) (^ ) (^ ) (^ )+
(b) *( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )+
Exercise
1. Write the relation represented by the following matrices and also draw the corresponding digraph. (a) [ ]
(b)
(c) [ ]
Introduction
Let be a relation on a set.
may or may not have some property , such as reflexivity, symmetry, or transitivity. If there is a relation with property containing such that is a subset of every relation with property containing , then is called the closure of.
In other words, is the smallest superset of with the property.
Reflexive closure of R
For given a relation R on a set A , the reflexive closure of R can be formed by adding to R all pairs of the form ( ) with , not already in R.
The addition of these pairs produces a new relation that is reflexive, contains R, and is contained within any reflexive relation containing R. Consequently, it is the reflexive closure of.
Thus, the reflexive closure of R can be given by R Δ, where *( ) | +is the diagonal relation on A.
Problem.
The relation *( ) ( ) ( ) ( )+ on the set *^ +^ is not reflexive. Obtain the reflexive closure of R.
Solution Here, diagonal relation on is *( ) ( ) ( )+
and , - is the matrix of the composite relation
, - [^ ]
Hence,
[ ] [ ] [ ] [ ]
Exercise:
1. Let R be the relation on the set {0,1,2,3} containing the ordered pairs (0,1), (1,1), (1,2), (2,0), (2,2), and (3,0). Find a) reflexive closure of R. b) symmetric closure of R.
Concepts of relations have a strong application in the theory of relational databases. Definition: Let be sets. An n-ary relation on these sets is a subset of. The sets are called the domains of the relation, and n is called its degree. For example: Let R be the relation on consisting of triples ( ) where are integers with
. Then ( ) , but ( ) The degree of this relation is 3. Its domains are all equal to the set of natural numbers. For example: Let be the relation on consisting of all triples of integers ( ) in which form an arithmetic progression. That is, ( ) if and only if there is an integer such that and , or equivalently, such that and. Note that ( ) because and , but ( ) because while This relation has degree 3 and its domains are all equal to the set of integers. For example: Let R be the relation consisting of ( ) representing airplane flights, where is the airline, is the flight number, is the starting point, is the destination, and is the departure time. For instance, if Nadir Express Airlines has flight 963 from Newark to Bangor at 15:00, then (Nadir, 963, Newark, Bangor, 15:00) belongs to R. The degree of this relation is 5, and its domains are the set of all airlines, the set of flight numbers, the set of cities, the set of cities (again), and the set of times.
Database & relations: The time required to manipulate information in a database depends on how this information is stored. The operations of adding and deleting records, updating records, searching for records, and combining records from overlapping databases are performed millions of times each day in a large database. Because of the importance of these operations, various methods for representing databases have been developed. We will discuss one of these methods, called the relational data model , based on the concept of a relation. A database consists of records , which are n -tuples, made up of fields. The fields are the entries of the n -tuples. For instance, a database of student records may be made up of fields containing the name, student number, major, and grade point average of the student. The relational data model represents a database of records as an n -ary relation. Definition: (Selection operator) Let be an relation and be a condition that elements in may satisfy. Then the selection operator maps the relation to the relations of all n-tuples from R that satisfy the condition.
Definition: (Projection operator ) The projection where , maps the n -tuple ( ) to the m -tuple ( ), where. In other words, the projection deletes of the components of an n -tuple, leaving the and components. For example: Consider the student records given by the following table.
These student records can be given using of the form ( ) A sample database of six such records is ( ) ( ) ( ) ( ) ( ) ( ) To find the records of computer science majors in the relation shown in the above table, we use the operator , where is the condition The result is the two 4-tuples ( ) and ( ). Similarly, to find the records of students who have a grade point average above in this database, we use the operator , where is the condition. The result is the two 4-tuples ( ) and ( ). Finally, to find the records of computer science majors who have a GPA above 3.5, we use the operator , where is the condition ( ). The result consists of the single 4-tuple ( ). When the projection is used, the second and third columns of the table are deleted, and pairs representing student names and grade point averages are obtained. The following table displays the results of this projection.
Definition: (Join operator) Let be a relation of degree and be a relation of degree. The join (^ )^ where and , is a relation of degree that consists of all ( )
Finite and infinite sets: Let S be a set. If there are exactly n distinct elements in S where n is a nonnegative integer, we say that S is a finite set and that n is the cardinality of S. The cardinality of S is denoted by | S |. A set is said to be infinite if it is not finite.
Countable and uncountable sets: A set that is either finite or has the same cardinality as the set of positive integers is called countable. A set that is not countable is called uncountable. Note: Cantor’s diagonal argument A set is finite iff there is a bijection between and * + for some positive integer , and infinite otherwise. (i.e., if it makes sense to count its elements.) Two sets have the same cardinality iff there is a bijection between them. A set S is called countably infinite if there is a bijection between and. Such a set is countable because elements can be counted, but unlike a finite set, counting never ends. On the other hand, not all infinite sets are countably infinite. In fact, there are infinitely many sizes of infinite sets. Georg Cantor proved this astonishing fact in 1895 by showing that the set of real numbers is not countable. That is, it is impossible to construct a bijection between and. In fact, it‘s impossible to construct a bijection between and the interval , -. Theorem: The set of real numbers is not countable Proof: Suppose that , - is any function. Make a table of values of , where the 1st row contains the decimal expansion of ( ), the 2nd row contains the decimal expansion of ( ),... the nth row contains the decimal expansion of ( ), … Perhaps, ( ) ( ) ( ) ( ) √ ( ) , and so on, so that the table starts out like this.
Highlighting the digits in the main diagonal of the table.
The highlighted digits are 0.37210.... Suppose that we add 1 to each of these digits, to get the number 0.48321.... then this number can‘t be in the table. Because
So it can‘t equal f(n) for any n — that is, it can‘t appear in the table This looks like a trick, but in fact there are lots of numbers that are not in the table. As long as we highlight at least one digit in each row and at most one digit in each column, we can change each the digits to get another number not in the table. Therefore, there does not exist a bijection between and , -. Hence, , - is not a countable set. Since, cardinality of and , - is same, is also uncountable.
The Power set theorem Statement: For every set S, |S| < |P(S)| Proof: Let ( ) be any function and define * | ( )+. Suppose that ( ) for some If so, then either belongs to or it doesn‘t. But by the very definition of , if belongs to then it doesn‘t belong to ( ). And if it doesn‘t belong to then it belong to ( ). This situation is impossible. Hence, cannot equal ( ) for any. Using the Cantor‘s diagonal argument, this proves that cannot be onto.| Hence, | |^ | ( )|. Which gives |S| < |P(S)|.
Schroder-Bernstein Theorem If A and B are sets with | | | | and | | | |, then | | | |. In other words, if there are one- to-one functions f from A to B and g from B to A , then there is a one-to-one correspondence between A and B.