You are on page 1of 21

CSCE 551:

Theory of Computation

Chin-Tser Huang
huangct@cse.sc.edu

University of South Carolina


About Me
„ Chin-Tser Huang
g
„ Ph.D. in Computer Sciences, University of
Texas at Austin
„ Research in network security, network protocol
design and verification, distributed systems
„ My web page can be found at
http://www.cse.sc.edu/~huangct

01/11/2010 2
About What Students Think of Me

S T

01/11/2010 3
About the Course
„ A graduate/undergraduate course focusing on
answering
i the
th following
f ll i question:
ti
What are the fundamental capabilities and
limitations of computers?
„ We will study three areas
„ Automata: a formal mathematical model of a
computational device that can do rudimentary pattern
matching in a string
„ Computability: What problems are solvable?
„ Complexity: Why are problems easy? Hard?

01/11/2010 4
About the Course
„ We will cover the fundamental knowledgeg
you SHOULD know
„ We will also try to find out what you WANT
to learn
„ So we expect there will be abundant
So,
interaction between you and me

01/11/2010 5
Course Information Online
„ http://www.cse.sc.edu/~huangct/CSCE551
p // / g /
S10/index.htm
„ Syllabus, class schedule, office hours
„ Links to handouts and other useful links are
available on the page
„ Lecture slides will be available online too

01/11/2010 6
Your Best Strategy
„ Come to every lecture and take notes in class
„ Keep yourself exposed to interesting
computational problems, theorems, and their
proof
„ Finish each assigned reading and participate the
discussion
„ Do not wait till last minute to work on
assignments or prepare for exam
„ Enjoy the fun!

01/11/2010 7
Chapter 0: Introduction
Sets
„ A set is a g
groupp of objects,
j , called elements (or( members))
of this set. For example, the students in this room form a
set.
„ A sett can b
be defined
d fi d byb listing
li ti allll its
it elements
l t inside
i id
braces, e.g.: S = {7, 21, 57}
„ For large or infinite sets, an alternative way of defining a
set is by giving some criterion for membership in the set,
e.g.: S = {n | n is an even integer}
„ Th order
The d and d repetitions
titi off elements
l t in t do
i sets d nott
matter – for example,
{7, 21, 57} = {21, 57, 7} = {21, 7, 57, 7, 21}

01/11/2010 9
Members and Subsets
„ The membership p is denoted byy ∈ symbol.
y For example,
p ,
21 ∈ S but 10 ∉ S.
„ Two sets are equal if they have exactly the same
members.
b
„ For two sets A and B, we say A is a subset of B and write
A ⊆ B if every member of A is also a member of B.
„ We say that A is a proper subset of B and write A B if A
is a subset of B and not equal to B.
„ The set of all subsets of a set A is called the power set of
A and denoted 2A.
„ Q: How many distinct subsets are there in the set S? How
many of them are proper?
01/11/2010 10
Examples of Sets
„ The set with no elements is called the empty set
and denoted ∅. The empty set is a subset of any
other set.
„ Th sett off natural
The t l numbers
b N (or
( N):
)
N = {1, 2, 3, ...}
„ The set of integers Z (or Z):
Z = {…, -2, -1, 0, 1, 2, …}
„ It is clear that N ⊆ Z.

01/11/2010 11
Examples of Sets
„ The set of perfect squares {n | n = m2 for some
m ∈ N} is a subset of both N and Z.
„ The number of elements in a set A is called the
cardinality (or size) of the set and denoted by |A|.
„ We have |∅| = 0 and |N| = |Z| = ∞.
„ Q: For a finite set A, what is |2A|?

01/11/2010 12
Set Operations
„ For given two sets A and B, one can define the
following set operations:
„ Union: A B. Example: {1, 2, 3} {1, 3, 5} = {1, 2, 3,
5}.
5}
„ Intersection: A ∩ B. Example: {1, 2, 3} ∩ {1, 3, 5} =
{{1,, 3}.
}
„ Difference: A \ B. Example: {1, 2, 3} \ {1, 3, 5} = {2}.
„ In the case of B ⊂ A, the result of A \ B is also
called the complement of B in A.

01/11/2010 13
Venn Diagram
„ The Venn diagram
g is a convenient wayy to
illustrate the set operations.

01/11/2010 14
Sequences and Tuples

„ A sequence
q is a list of objects
j in some order. For
example, sequences of the students’ names in alphabetic
order such as (Alice, Bob).
„ I contrast
In t t tto sets,
t repetitions
titi and
d order
d matter
tt iin
sequences. For example, the sequences (7, 21, 57) and
(7, 7, 57, 21) are not equal.
„ Finite sequences are called tuples. In particular, a
sequence with k elements is called k-tuple (as well as
pair triple,
pair, triple quadruple,
quadruple etc.)
etc )

01/11/2010 15
Cartesian Product

„ All k-tuples
p (x1, x2, …,, xk ), where xi is taken from the set
Ai , form a set A1 × A2 × … × Ak , called the Cartesian
product or cross product of the sets A1, A2, …, Ak .
„ F example,
For l if A1 = {p,
{ q}} and d A2 = {1,
{1 22, 3} th
then
„ A1 × A2 = {(p, 1), (p, 2), (p, 3), (q, 1), (q, 2), (q, 3)}

01/11/2010 16
Functions

„ A function (mapping
pp g) f sets upp a correspondence
p
between the elements of one set A and elements of the
other set B, written f : A → B.
„ I particular,
In ti l if an element
l t a ∈ A corresponds
d to
t an
element b ∈ B under the function f , we write f (a) = b,
where a is called the input (or argument) and b is called
the output (or value) of f .
„ The set A is called the domain of f while the set B is
called the range of f .

01/11/2010 17
Example of Functions

„ For a finite set A, the function f : A → B can be defined


by a table that lists all possible inputs and gives the
output for each input.
„ example, for A = Z5 = {0,
For example {0 1,
1 2,
2 3,
3 4} (the set of
integers modulo 5), a function f : Z5 → Z5 that adds 1 to
its input and then outputs the result modulo 5 can be
specified as
a 0 1 2 3 4
f(a) 1 2 3 4 0

01/11/2010 18
Types of Functions

„ A function f : A1 × A2 × … × Ak → B is called a k-aryy function.


„ Unary functions correspond to the case k = 1 while binary

functions correspond to the case k = 2.


„ A function f : A → {TRUE,
{TRUE FALSE} is called a predicate or
property. For example, the property even defines evenness of
a given integer: even(4) = TRUE and even(5) = FALSE.
„ A property f : A × A × … × A → {TRUE,
{TRUE FALSE},
FALSE} whose
domain is the set of k-tuples, is called k-ary relation (on A).
An example is the beats relation between scissors, paper, and
stone
t ((see p.9
9 iin Sipser).
Si )
„ For binary relation R, we often use infix notation writing xRy
instead of R(x, y) = TRUE.

01/11/2010 19
Equivalence Relation

„ A binaryy relation R on a set A is called an equivalence


q
relation if R is:
„ Reflexive: for every x ∈ A, xRx;

„ Symmetric
S t i : for
f every x, y ∈ A, xRy
R implies
i li yRxR ;
„ Transitive: for every x, y, z ∈ A, xRy and yRz implies xRz.

„ The equality relation is an example of equivalence


relation.
„ Q: What other equivalence relations you know?
„ Q: Is the relation less or equal (≤) an equivalence
relation?

01/11/2010 20
Announcement
„ Reading
g assignment:
g Ch. 0

01/11/2010 21

You might also like