You are on page 1of 42

Mathematics-II

Unit-1

BCA-102.
Unit 1- Sets, Relations & Functions.
Unit- 1: Syllabus
SETS: Sets, Subsets, Equal Sets Universal Sets, Finite and Infinite Sets,
Operation on Sets, Union, Intersection and Complements of Sets,
Cartesian Product, Cardinality of Set, Simple Applications.
RELATIONS AND FUNCTIONS: Properties of Relations, Equivalence
Relation, Partial Order Relation Function: Domain and Range, Onto, Into
and One to One Functions, Composite and Inverse Functions, Hashing
functions, Recursive function.
[No. of Hrs: 11]
Sets.
A set is a collection of well defined elements or objects.

Sets can be represented as:


1. Simple statement form- Set of all vowels in the english alphabet
2. Roster or tabular form- {a, e, i, o, u}
3. Rule or set builder form- {x : x is a vowel }

Eg:
● {1, 2, 3}
● { x : x is a real number} = R
● { x : X is an integer and x>1} = {2, 3, 4, 5, 6, ……}
Different Notations in Sets

N Set of natural numbers = {1, 2, 3, ……}


W Set of whole numbers = {0, 1, 2, 3, ………}
I or Z Set of integers = {………, -2, -1, 0, 1, 2, ………}
Z+ Set of all positive integers
Q Set of all rational numbers
Q+ Set of all positive rational numbers
R Set of all real numbers
R+ Set of all positive real numbers
C Set of all complex numbers
E → Even numbers

O → Odd numbers

P → Prime numbers

ɸ → Empty set = Null set = { }

Example of Empty set, {x: x is a real number satisfy x2 = -1 }

Q. Write five empty sets with mathematical condition & non mathematical
condition, each.

● Finite Sets: Finite sets are the sets having a finite/countable number of
members.
● Cardinality : The cardinality of a set is its size. For a finite set, the
cardinality of a set is the number of members it contains. In symbolic
notation the size of a set S is written |S|.
Symmetric Difference : The symmetric difference of two sets S and T is the
set of objects that are in one and only one of the sets.

S∆T = (S - T) U (T - S) = (T - S) U (S - T)

S = { a,b,c,d,e } T = { b,c }

S - T = { a,d,e } T-S=ɸ

S∆T = { a,d,e } = T∆S

Power Set : The set of all subsets of a set S is called the powerset of S. The
notation for the powerset of S is P(S)

S = { a,b,c}

ɸ is subset of S, and so are: {a}, {b}, {c}, {a,b}, {b,c}, {a,c}, {a,b,c}.

{ {a}, {b}, {c}, {a,b}, {b,c}, {a,c}, {a,b,c} } = P(S) = Power Set of S
Q: ‘inbox’ S = {i,n,b,o,x} Write power set of S.

● A = B ⇔ A⊆B and B⊆A

To prove 2 sets are equal, we can prove they are subset of each other. But,
A = {1,2,3} is equal to B = {1,2,3,3} because A⊆B and B⊆A
● (S U T)c = Sc ∩ Tc

Let x ∈ (S U T)c

⇔ x ∉S U T

⇔ x ∉S & x ∉ T

⇔ x ∈ S c & x ∈ Tc

⇔ x ∈ S c ∩ Tc

⇔ (S U T)c ⊆ Sc ∩ Tc → (1)
Similarly,
Let x ∈ SC∩TC
=> SC∩TC ∈ (S U T)C → (2)
Using (1) and (2)
(S U T)C = SC∩TC
Alternate:
=> x ∈ SC∩TC
=> x ∈ SC & x ∈ TC
=> x ∉ S & x ∈ T
=> x ∉ S U T
=> x ∈ ( S U T )C
{ 2K + 1; 0 ≤ K ≤ 49 } = EC

Q. Disprove A Δ ( B U C ) = ( A Δ B ) U C
Let x ∈ L.H.S

L.H.S [A-(BUC)]U[(BUC)-A]

A = { 1,2,3 } C = { c,d }

B = { a,b } U = { 1,2,3,a,b,c,d }

=> x ∈ [ A - ( B U C ) ] or

=> x ∈ [ ( B U C ) - A ] or

=> x ∈ A - ( B U C ) & x∈(BUC)-A


● Disjoint set :- Two sets are called disjoint if their intersection is the empty
set.

A∩B=ϕ

● Mutually Disjoint

The sets in A are mutually disjoint if no two of them have any elements in
common.

A1, A2, …, An : Ai ∩ Aj = ϕ i≠j

1≤i j≤n

● If A ∩ B = ϕ then | A U B | = |A| + |B|


● A ∩ B = ϕ then | A U B | = |A| + |B| - | A ∩ B |
Q. How many engineers have to be appointed for the purpose?

60 → Java programming job (A)

35 → C++ programming job (B)

15 → Both language programming job ( A ∩ B )

Solution:

| A U B | = |A| + |B| - | A ∩ B |

= 60 + 35 - 15

= 80

So, 80 engineers have to be appointed for the purpose.


Cartesian Product :

Let A, B be two sets.


A × B = {(a , b) : a ∈ A ,b ∈ B}

If
A = Ø , B = Ø then A × B = Ø
A ≠ Ø , B = Ø then A × B = Ø
A = Ø , B ≠ Ø then A × B = Ø

#
2

B=A; A×A=A
|A| = m ,|B| = n ,|A × B| = m × n
A = {1 , 2 , 3} , B = {a , b}

A × B = { (1 , a) , (2 , a) , (2 , b) , (1 , b) , (3 , b) , (3 , a) }

Q. A × B ≠ B×A?
Relation : Let A and B be two sets .
Then a subset R of A × B is called a Relation in A and B.
If
(a , b) ∈ A × B ⇔ a is related to b by R .
⇔aRb

⇔a~b

The set of first components of pair in R is called Domain of R.


That Set of last components of pair in R is called Range of R.
# { (1 , a) ,(2 , a) } = R 1 , A={1, 2 ,3} , B={a , b}

R1 ⊆ A × B

R1 is a relation in A and B .

1~a,2~a

{ (1 , a) , (2 , a) , (3 , a) , (2 , b) } = R2 ⊆ A × B

1~a,2~a,3~a,2~b
A = {1 , 2 , 3}
| A ×A | = 9

29 = 512

# Equivalence Relation :
Relation R on a set A is said to be an equivalence relation if it satisfies the
following conditions :
(1) Reflexivity : (a , a) ∈ R for all a ∈ A
(2) Symmetry : (a , b) ∈ R => (b , a) ∈ R for all a,b ∈ A
(3) Transitivity : (a , b) ∈ R & (b , c) ∈ R
=> (a , c) ∈ R for all a,b,c ∈ A
# A = {1 , 2 , 3} : A ×A = { }
R1 = { (1 , 1) , (1 , 2) , (2 , 1) , (2 , 2) , (3 , 3) }
is R1 an equivalence relation ?
(1 , 1) , (2 , 2) , (3 , 3) R => Reflexive .
=> R1 is Symmetric .
(1 , 1) , (1 , 2) ∈ R1 => (1 , 2) ∈ R1
(1 , 1) , (2 , 1) ∈ R1 => (1 , 1) ∈ R1
(1 , 2) , (2 , 2) ∈ R1 => (1 , 2) ∈ R1
(2 , 2) , (2 , 1) ∈ R1 => (2 , 1) ∈ R1
# Let X be a Set and S = { A : A ⊆ X }

Q R is a relation on S
R ⊆ S x S , R = { (A , B) : A ⊆ B ; A,B ∈ S }

Is R an Equivalence Relation .

# Let T be a set of Δ‘s in a plane , and define R as the set .

R = { (a , b) : a,b ∈ T , a is congruent to b }

Is R an equivalence relation?
(a , a) ∈ R because every △ is congruent to itself .

=> R Reflexive

(a , b) ∈ R => (b , a) ∈ R

=> a ≅ b => b ≅ a => (b , a) ∈ R

(a , b) , (b , c) ∈ R => (a , c) ∈ R

a ≅ b , b ≅ c => (a , c) ∈ R

=> a ≅ c
The Congruence Modulo Relation
If ‘m’ is a fixed integer, then the integers ‘a’ and ‘b’ are said to be

congruent modulo m, iff the integer ‘m’ divides a-b, i.e.

OR

where ‘k’ is any integer.


Also, the following may be safely deduced:
Is the congruence modulo an equivalence relation?
Let’s see:

To show reflexivity:

Let a∈Z such that it satisfies a≡a(mod m)

⇒ a-a = mk

a-a = 0, which is divisible by m.

Hence, this function is reflexive.


Is the congruence modulo an equivalence relation?
Let’s see:

To show symmetricity:

Let a,b ∈ Z and (a,b) ∈ R , then

a-b = mk ⇒ b-a = m(-k) ⇒ (b,a) ∈ R

Where k is an integer.

Hence, this function is symmetric.


Is the congruence modulo an equivalence relation?
Let’s see:
To show transitivity:
Let a,b,c ∈ Z,
(a,b), (b,c) ∈ R , then
a-b = mk (1)
b-c = mk (2)
Where k is an integer.
Adding (1) and (2), we get:
a-c = ( 2m ) k
Hence, (a,c) ∈ R.
Hence, this function is transitive.
Partition of sets
❏ Let A: A₁ ∪ A₂ ∪ A₃ ∪ … Aₘ be a partition of a set A. A relation R is said to
be a relation induced by the partition if for all a,b ∈ A,
a R b ⇔ there is a subset Aₓ of the partition such that both a and b are in A.
❏ A = { a, b, c, d, e, f, g }
B = { { a }, { b, c, d }, { e, f }, { g } }
B is a partition of A.
Equivalence Classes
❏ Let R be an equivalence relation on A and a ∈ A, then the set
❏ { b ∈ A : ( a,b ) ∈ R }

is called equivalence class of a (small a) denoted by [a].

Example:

Then,
Equivalence Classes
Example:

Then, find [0], [1], [2], [-1], [-2].

Sol:

[PTO]
❏ Every equivalence relation divides the set it is defined
upon into equivalence classes/ partitions.

❏ These partitions are disjoint and finite.

Example:
Practice and examples
❏ Let Rₘ be the relation defined as “congruent modulo m” relation defined
on .

Find 5 elements of the relation Rₘ where m = 2.


Practice and examples
❏ Let X be a set and
R is a relation on S:

Is R an equivalence relation?
* Graphical representation of a relation on a finite set:

#Arrow Diagram : A = {1,2} , B = {1,2,3}

R = { (1,2), (1,3), (2,2), (2,3) }

Matrix representation of a relation :


Relation is A to B

MR =

# DIRECTED GRAPH : A = {1, 2, 3 }

R = { (1,1), (1,2), (1,3), (3,1), (2,3), (2,1)}


MAPPING OR FUNCTION
Let A and B be two sets, A mapping or function is a relation, denoted as

F : A ---> B, such that

i) Every element x ∈ A have some element y ∈ B such that (x,y) ∈ f

ii) (x,y) and (x,z) ∈ f => y = z

x∈A , y∈B
* A = {1,2,3} , B=(a,b,c,d,e}
f = { (1,a) , (2,c) , (3,b) }
Dom f = {1,2,3} , Range f = {a,c,b}
* Dom f = { x∈ A : (x f( x1) ∈d}
*Range f = { f(x) : x∈ A }

# Types of mapping :
1) One - One function / injective function :
f : A ---> B be a one - one function if

f( x1) = f( x2 ) => x1 = x2 , x1, x2 ∈ A


EXAMPLE :
f = { (x,y) x∈Z , y∈Y , y = 2x }
Z = set of integer , Y = set of even +ve integer

f (x1 ) = f( x2)

=> 2x1 = 2x2 => x 1 = x2


2. Onto function / surjective
A function f : A --> B is called onto if f(A) = B = { f(x) = x ∈A }
Example : f : X --> Y , f(x) : ax+b
X , Y both are set of real no.
F(x) = ax+b
=> Y = ax+b

=> x = y - b

a
=> F(x) = Y => f is onto.

3. Many One Function

f = { x,y) : y = x , -∞ <x< ∞ }
f(x) = { (x,y) : y ≡ x mod 3 }
Bijective Function:
injective + surjective
A function is said to be bijective or bijection, if a function f: A → B satisfies
both the injective (one-to-one function) and surjective function (onto
function) properties.

It means that every element “b” in the codomain B, there is exactly one
element “a” in the domain A. such that f(a) = b.

● Inverse of a function exists only if it is bijective, similarly,


● If a function is bijective, then its inverse exists.
Inverse of a Function
An inverse function or an anti function is defined as a
function, which can reverse into another function. In
simple words, if any function “f” takes x to y then, the
inverse of “f” will take y to x. If the function is denoted
by 'f', then the inverse function is denoted by f-1.

For example:
Composition of Functions
Any two functions f and g are said to be composite functions iff the Range of g
is equal to the Domain of f.

f∘g = f( g(x) )
={ (1,α) , (2,α) , (3,γ) , (4,α) }
Q. A= ( 1, 2 , 3 ) ; R= { (1,1) , (1,2) , (2,3) , (3,1) }
Find self-composition of function.

1 1 1 1
2 2 2 2
3 3 3 3
R

R∘R R∘R∘R ?

R2= R∘R = { (1,1) , (1,2) , (1,3) , (2,1) , (3,1) , (3,2) }

R3= R∘R∘R = { (1,1) , (1,2) , (1,3) , (2,1) , (2,2) , (3,1) , (3,2) , (3,3) }
● In previous slide, R3 is relatively closed,
● R3 is not symmetrically closed.

Hashing Function:
H:K L is a Hashing function if it is one-to-one.
{ if K1 = K2 => H(K1) = H(K2) }
➢ In other words, a collision free function is called a Hash function.

Division Method: H:K L


H(K) = k(mod m) , k ∈ K

➢ Usually, we choose m as a prime number.


Efforts by
Lalit, Anuj Verma, Prakhar, Ritu and Jasmehr.

You might also like