Introduction To Sets and Functions
Introduction To Sets and Functions
Srikrishnan Divakaran
School of Engineering and Applied Sciences, Ahmedabad University
Lecture Set 3
Contents
1. Basic Definitions
2. Set Operations
3. Functions
Basic Set Definitions
A set is an unordered collection of objects. The objects in a set are
called the elements or members of the set. A set is said to contain
its elements.
Other examples:
The set of all polynomials with degree at most three: {1, x, x2, x3, 2x+3x2,…}.
x( x A x B )
x ( x A x B )
Basic Set Definitions
o The size or cardinality of a set S, denoted by |S|, is defined as
the number of elements contained in S.
o Given a set S, the power set of S is the set of all subsets of the
set S. The power set of S is denoted by P(S).
Let A and B be sets. The union of the sets A and B, denoted by A U B , is the set
That contains those elements that are either in A or B, or in both.
A B {x | ( x A) ( x B)}
Set Intersection
Let A and B be sets. The intersection of the sets A and B, denoted by A ∩ B , is the
set That contains those elements that are present in both A and B.
A B {x | ( x A) ( x B)}
Two sets are called dis-joint if their intersection is the empty set.
A
A
Set Difference Operation
Let A and B be sets. The difference of A and B, denoted by A-B, is the set containing
Those elements that are in A but not in B. The difference of A and B is also called
The complement of B with respect to A.
A B {x | ( x A) ( x B)}
That is, A = U – A.
Set Identities (1)
Double complement: ( A) A
Commutative: AB=BA AB=BA
Associative: A(BC)=(AB)C
A(BC)=(AB)C
Set Identities (2)
Demorgan’s Law:
A B A B
A B A B
Generalized Union and Intersection
AA2…An((…((A1A2)…)An) :
i 1
Ai
Russell’s Paradox
W is the set that contains all the sets that don’t contain themselves.
If W is in W, then W contains itself. But W contains only those sets that don’t
contain themselves. So W is not in W.
If W is not in W, then W does not contain itself. But W contains those sets that
don’t contain themselves. So W is in W.
Functions
A B
Some Function Terminology
15
Examples of Functions
domain = R
Co-domain = R>0
domain = R>C
codomain = R
domain = R
codomain = [-1,1]
domain = R>=0
codomain = R>=0
Examples of Functions
not a function,
f(student-name) = student-ID since one input could have
more than one output
18
One-to-One (injective) Functions
f : A B is an one-to-one function if and only if f(a) = f(b) implies that a =
b for all a and b in the domain of f.
≤ 1 arrow in
f( ) =
A B
|A| ≤ |B|
Onto (Surjective) functions
f : A B is an onto function if and only if for every element
b B there
is an element a A with f(a) = b.
f( ) = 1 arrow in
A B
|A| ≥ |B|
One-to-One correspondence (Bijection)
f : A B is a one-to-one correspondence if it is one-to-one and onto.
f( ) =
A B
|A| = |B|
Inverse Functions
Let f be a one-to-one correspondence from the set A to the set B. The inverse
function of f is the function that assigns to an element b in B the unique element a
in A such that f(a) = b. The inverse of function f is denoted by f-1.
B
A
Inverse of a function
23
Function Composition
24
Inverse of a function (cont’d)
25
A Couple of Key Functions
26
Acknowledgements
1. Introduction to Discrete Mathematics, Lectures of Prof. Lap Chi Lau,
Chinese University of Honk Kong.
2. Mathematics for Computer Science, Lectures of Prof. Tom Leighton,
MIT open courseware.
3. Discrete Mathematics and its Applications, Kenneth Rosen, 6th
edition, McGraw Hill Publishing.