1st BCA
1st BCA
Discrete Mathematics
History of sets
• The theory of sets was developed by German mathematician Georg
Cantor (1845-1918).
• He first encountered sets while working on “Problems on
Trigonometric Series” .
• SETS are being used in mathematics problem since they were
discovered.
Sets
• Collection of ordered or unordered objects is called a set
• In mathematics natural number, prime numbers etc will form set
• Examples: a pack of cards, a crowd of people, a cricket team etc
• The objects in a set are called the elements or members of sets
• Capital letters are used to represent set where as lowercase letters are
used to represent elements of sets
• Example: A={a, b, c, d}, B={g, w, u, o, p, d} etc….
Representation of Sets
There are two ways to represent sets
• Roster or tabular form
• all the elements of set are listed, the elements are being separated by commas
and are enclosed within braces { }
• Example: {1,2,3,4,5,6,7,8,9,10}, {a,b,c,j,o,k}
• Set-builder form
• In set-builder form, all the elements of a set possess a single common
property which is not possessed by an element outside the set.
• e.g. : set of natural numbers k or k= {x : x is a natural number}
Standard notations of set
• Ø = empty set or null set
• U = universal set
• N = set of all natural numbers
• I = set of all integers
• Z, Z-, Z+ = set of integers, negative, positive integers
• Q, Q-,Q+ = set of rational numbers, positive, negative numbers
Types of sets
• Finite set
• Infinite set
• Null set
• Singleton set
• Universal set
• Subset
• Equality of set
• Empty or null or void set : It contains no elements
For e.g A={}
• Equality of sets : Two sets X and Y have same elements , represented as X=Y
For e.g. A={1,2,3,4,5}, B={1,2,3,4,5} then A=B
• Singleton set: It contains only one element
For e.g. A={0}, B={i}
• Subset: If a set A contains elements which are all the elements of set B as
well, then A is known as the subset of B
For e.g. if A={-9,13,6}, then,
Subsets of A= ϕ, {-9}, {13}, {6}, {-9,13}, {13,6}, {6,-9}, {-9,13,6}
Operation on sets
• Union of sets
• Intersection of sets
• Complement of sets
• Cartesian product
• Cardinality of set
• De-morgan’s law
Union of sets
• Union of two given sets is the smallest set which contains all the
elements of both the sets.
• To find the union of two given sets A and B is a set which consists of
all the elements of A and all the elements of B such that no element is
repeated.
• Therefore, A ∪ B = {x : x ∈ A or x ∈ B}
Example
Let set A = {2, 4, 5, 6} and set B = {4, 6, 7, 8}
Taking every element of both the sets A and B, without repeating any
element, we get a new set = {2, 4, 5, 6, 7, 8}
In this two sets, the elements 3 and 5 are common. The set containing
these common elements i.e., {3, 5} is the intersection of set A and B.
• For example:
(i) Set A = {2, 4, 5, 9, 15} has 5 elements. Therefore, the cardinal
number of set A = 5. So, it is denoted as n(A) = 5.
(ii) Set B = {w, x, y, z} has 4 elements . Therefore, the cardinal number of
set B = 4. So, it is denoted as n(B) = 4.
(iii) Set C = {Florida, New York, California} has 3 elements ..n(C)=3
Questions
1. Write the cardinal number of each of the following sets:
(i) X = {letters in the word MALAYALAM}
(ii) Y = {5, 6, 6, 7, 11, 6, 13, 11, 8}
(iii) Z = {natural numbers between 20 and 50, which are divisible by 7}
2. Find the cardinal number of a set from each of the following:
(i) P = {x | x ∈ N and x2 < 30}
(ii) Q = {x | x is a factor of 20}
Cartesian product
• If A and B are two non-empty sets, then their Cartesian product A × B is the
set of all ordered pair of elements from A and B.
A × B = {(x, y) : x ∈ A, y ∈ B}
• Suppose, if A and B are two non-empty sets, then the Cartesian product of
two sets, A and set B is the set of all ordered pairs (a, b) such that a ∈A and
b∈B which is denoted as A × B
• 5 less than 9
This statement shows the relation between two numbers. The relation
(R) being ‘is less than’.
If A and B are two non-empty sets, then the relation R from A to B is a
subset of A x B, i.e., R ⊆ A x B.
If (a, b) ∈ R, then we write a R b and is read as 'a' related to 'b'
Domain and range of relation
• The domain of a relation R is the set of all first entries or coordinates of
the ordered pairs in R and it is denoted by DOM(R)
• The range of a relation R is the set of all second entries or coordinates of
the ordered pairs in R which is denoted by RAN(R)
• Ex: Let A={1,2,3,4} and the relation given by (x,y)€R if x<y defined on
A, then the relation is given by R= {(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}
Therefore, DOM(R) = {1,2,3} and RAN(R) = {2,3,4}
Representation of Relations
1. By language
2. By ordered pairs
3. By arrow form
4. By matrix form
5. By co-ordinates
6. By graph form
Example
Consider the set A={1,2,3}.Let R be the relation’>’ on A. Then the
different ways of representation of relation are as follows:
1. By Language : R = {(a, b) | a>b and ¥ a, b € A}
2. By Ordered pairs: R = {(2,1),(3,1),(3,2)}
3. By arrow form :
1. 1.
2. 2.
3. 3.
4. By matrix form:
1 2 3
0 0 0
1 0 0 0
1 0 0
2 1 0 0
MR 3 1 1 0
1 1 0
5. By co ordinates:
3
1 2 3
6. By graph form
2
Kinds of Relations
1. One to One
2. One to many
3. Many to one
4. Many to Many
1. One to one function
• The relation R from the set A to set B is said to be one to one relation
if(x1, y1) € R , (x2, y2) € R then y1=y2 x1=x2
2. One to Many
• The relation R from the set A to set B is said to be one to many relation
if(x1, y1) € R, (x1, y2) € R for some x1 € A and y1,y2 € B with
y1 not equal to y2
3. Many to one
• The relation R from the set A to set B is said to be many to one relation
if(x1, y1) € R, (x2, y1) € R for some y1 € B and x1,x2 € A with
x1 not equal to x2
4. Many to Many
• The relation R from the set A to set B is said to be many to many relation
if (x1, y1) € R, (x1, y2) € R , (x2, y1) € R, (x2, y2) € R for some x1,x2 € A
and y1,y2 € B with y1 not equal to y2 and x1 not equal to x2
Complement of a relation
• Consider a relation R from a set A to B. Then, the complement of
relation R denoted by 𝑅ത is a relation from A to B such that
𝑅ത = {(a, b) | (a, b) ∉ 𝑅} i. e 𝑅ത = (A ∗ B)- R
• If P={a, b, c ,d} Q={x, y, z} and R={(a, y),(b, y),(d, z),(c, x)} find 𝑅ത
• Example :
If A = {1, 2, 3, 4} then R = {(1, 1) (2, 2), (1, 3), (2, 4), (3, 3), (3, 4), (4, 4)}
The relation is reflexive as for every a ∈ A. (a, a) ∈ R,
i.e. (1, 1), (2, 2), (3,3) , (4, 4) ∈ R
Symmetric Relation
• A relation R on set A is said to be symmetric iff (a, b) ∈ R ⟺ (b, a) ∈
R.
• Example:
Let A = {1, 2, 3} and R = {(1, 1), (2, 2), (1, 2), (2, 1), (2, 3), (3, 2)}
The relation is symmetric as for every (a, b) ∈ R, we have (b, a) ∈ R,
i.e., (1, 2), (2, 1), (2, 3), (3, 2) ∈ R but not reflexive because (3, 3) ∉ R.
Transitive Relation
• A Relation R on set A is said to be transitive iff (a, b) ∈ R and (b, c) ∈
R ⟺ (a, c) ∈ R
• Example:
Let A = {1, 2, 3} and R = {(1, 2), (2, 1), (1, 1), (2, 2)}
The relation R is transitive as for every (a, b) (b, c) belong to R,
we have (a, c) ∈ R i.e, (1, 2) (2, 1) ∈ R ⇒ (1, 1) ∈ R.
• The relation is said to be non-transitive, if
(a, b) ∈ R and (b, c) ∈ R do not imply (a, c ) ∈ R
• For example:
If R is a relation on set A = {12,6} then {12,6}∈R implies 12>6, but
{6,12}∉R, since 6 is not greater than 12.
Anti- Symmetric Relation
• A relation R defined on a set A is said to be anti symmetric if
(a, b) ∈ R and (b, a) ∈ R, then a=b
• Example :
A = {1, 3, 5, 7}
R1={(1,1),(1,3),(3,5),(5,5),(5,7)}
R2={(1,1),(3,3),(7,7)}
R3={(3,3),(3,5),(5,3),(5,7),(7,5),(7,7)}
R1 and R2 are AS and R3 is not AS
Equivalence Relation
• A relation R on a set A is said to be an equivalence relation if and only
if the relation R is reflexive, symmetric and transitive
• Defined as 𝑅 −1 ={(b,a)|(a,b)∈R}
• Example :
If R={(1,2),(2,3)} then R′ will be {(2,1),(3,2)}
Examples
1. Let R be a relation in A={1,2,3,4,5,6} defined by ‘x’ and ‘y’ are
relatively prime. Find the relation R and draw R on a co ordinate
diagram of (A*A)
2. Let N be the set of all natural numbers .R be the relation in N
defined xRy if and only if x+3y. Examine the relation R is
i. Reflexive
ii. Symmetric
iii. Transistive
3. Show that the relation x≡y(mod5) defined on the set of integers, I is
an equivalence relation
4. Let A={2,4,6,8} B= {1,5,7,9} and let R be a relation from A to B
defined as xRy if and only if x ≤ y. Find the domain, range and inverse of
the relation R.
5. Let R be the relation on the set {1,2,3,4,5} defined by the rule (x,y)∈ 𝑅
If x+y ≤ 6. Find the following
i. List the elements of R,𝑅−1
ii. Domain of R, 𝑅−1
iii. Range of R, 𝑅−1
6. Let A=Z and R be a relation on A. Show that xRy x divides y. Then
verify R is an equivalence relation on A
7. Let A=Z+, the set of positive integers and R={(a,b) | a≤ b} is a relation
on the set A. Is R an equivalence relation
Functions
• Let A and B be two sets. A function from A to B, denoted f : A → B ,
is an assignment of exactly one element of B to each element of A
• We write f(a) = b to denote the assignment of b to an element a of A
by the function f
Domain Co-domain and Range of Function
Let : A → B (f be function from A to B), then