Prerequisite

Theory Of Computation
Pre-requisite
© Bharati Vidyapeeth’s Institute of Computer Applications and Management , New Delhi-63, by Manish Kumar
PRE. ‹#›
Learning Objective


Understanding the basic concepts of sets
properties
Understanding of Functions
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
and
PRE. ‹#›
Introduction
© Bharati Vidyapeeth’s Institute of Computer Applications and Management , New Delhi-63, by Manish Kumar
PRE. ‹#›
Basic Concepts of Set
• Roughly speaking, a set is a collection of objects that
satisfy a certain property, but in set theory, the words
“set” and “element” are intentionally left as undefined.
• There is also another undefined relation , called the
“membership” relation.
• If S is a set and a is an element of S, then we write a
S, and we can say that a belongs to S.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Basic Concepts of Set
• The { } notation
• If a set M has only a finite number of elements say, 3,
7, and 11, then we can write
M = {3, 7, 11}
(the order in which they appear is unimportant.)
• A set can also be specified by a defining property, for
instance
S = {x   : -2 < x < 5}
(this is almost always the way to define an infinite set).
= Set of Real numbers
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Basic Concepts of Set
• Two sets are equal if and only if they have the same
elements.
For example, {1, 2, 3} = {3, 1, 2} = {1, 2, 3, 2}
Subsets:
Given two sets A and B, we say that A is a subset
of B, denoted by
A B
In other words, A is a subset of B if all elements in A
are also in B.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Basic Concepts of Sets
• An example of subset:
• Let E be the English alphabet, hence it is a set of 26
letters
E = {a, b, c, … , x, y , z}
• In the Hawaiian alphabet however, it contains only 7
consonants
H = { a, e, i, o, u, h, k, l, m, n, p, w}
• Hence H is a subset of E.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Basic Concepts of Sets
Proper Subsets:
Given two sets A and B, we say that A is a proper
subset of B, denoted by
A B
if
A  B
and
A  B
In other words, A is a proper subset of B if all
elements in A are also in B but A is “smaller” than
B.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Basic Concepts of Set
Exercises
Determine whether each statement is true or false.
a) 3 {1,2,3} True
False
f) {2}  {1, {2},{3}}
b) 1  {1}
False
g) {1}  {1, 2} True
c) {2}  {1, 2} False
h) 1  {{1}, 2} False
d) {3}  {1, {2}, {3}} True i) {1}  {1, {2}}True
e) 1  {1}
True
j) {1}  {1}
True
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
What is an Operating System?
Operations of Sets:
Let A and B be two subsets of a larger set U, we
can define the following,
1. Union of A and B,
A  B  {x U : x  A or x  B}
2. Intersection of A and B,
A  B  {x U : x  A and x  B}
3. Difference of B minus A,
B  A  {x U : x  B and x  A}
4. Complement of A,
AC  {x U : x  A}
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Basic Concepts of Set
Cartesian Products:
For any two sets A and B, the Cartesian Product of A
and B, denoted by A×B (read A cross B), is the set of all
ordered pairs of the form (a, b) where aA and bB.
A  B  {(a, b) : a  A and b  B}
e.g. {a,b}{1,2} = {(a,1),(a,2),(b,1),(b,2)}
Given sets A1, A2 , … , An we can define the Cartesian
product
A1 × A2 × · · ·× An
as the set of all ordered n-tuples.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Laws of Set theory
DeMorgan Law
DeMorgan
Law
DeMorgan
Law
A B  A B
A
BBAA
A

BB
A B  A B
A
BBAA
A

BB
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Function
•A function “f “ from a set A to a set B is an
assignment of exactly one element of B to each
element of A.
We write
f(a) = b
if b is the unique element of B assigned by the function
f to the element a of A.
If f is a function from A to B, we write
f: AB
•(note: Here, ““ has nothing to do with if… then)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Function Cont.
•If f:AB, we say that A is the domain of “f” and B is
the codomain of function f.
•If f(a) = b, we say that b is the image of a and a is the
pre-image of b.
•The range of f:AB is the set of all images of
elements of A.
We say that f:AB maps A to B.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Function Cont.
•Let us take a look at the function f:PC with
P = {Linda, Max, Kathy, Peter}
C = {Boston, New York, Hong Kong, Moscow}
f(Linda) = Moscow
f(Max) = Boston
f(Kathy) = Hong Kong
f(Peter) = New York
Here, the range of f is C.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Function Cont.
Let us re-specify f as follows:
f(Linda) = Moscow
f(Max) = Boston
f(Kathy) = Hong Kong
f(Peter) = Boston
Is f still a function?
yes
What is its range?
{Moscow, Boston, Hong Kong}
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Function Cont.
•Other ways to represent f:
x
f(x)
Linda
Moscow
Max
Boston
Linda
Boston
Max
New York
Hong Kong
Kathy
Hong
Kong
Kathy
Peter
Boston
Peter
Moscow
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
Function Cont.
If the domain of our function f is large, it is
convenient to specify f with a formula, e.g.:
f:RR
f(x) = 2x
This leads to:
f(1) = 2
f(3) = 6
f(-3) = -6
…
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›
References
•
•
•
•
•
www.csee.umbc.edu/~artola
www.csie.ndhu.edu.tw/~rschang
www.grossmont.edu/carylee/Ma245/presentations
www.mgt.ncu.edu.tw/~ylchen/dismath
Kenneth H. Rosen, “Discrete mathematics and its
applications”, Forth Edition ,
© Bharati Vidyapeeth’s Institute of Computer Applications and Management,, New Delhi-63, by Manish Kumar
PRE. ‹#›