Professional Documents
Culture Documents
1.TOC Lecture1
1.TOC Lecture1
Lecture – 01 : Introduction
• Credits = 4
• 3 Classes/week, 1hr/Class
3. Grading Pattern
• Attendance : 05%
Michael Sipser, Introduction to the Theory of Computation, 3rd Edition, CENGAGE learning.
Course Description:
• will discuss both the inherent capabilities and limitations of these computational models as well as
their relationships with formal languages.
• Enhances/develops student’s ability to understand and conduct mathematical proofs for computation
and algorithms.
Topics to be covered:
❖ Be able to design and analyze finite automata, and equivalent regular expression for describing
regular languages
❖ Be able to design and analyze pushdown automata, and context-free grammars and languages.
❑ Computability Theory
• Finite Automata
▪ Turing Machine
Complexity Theory
• The objective is to classify the problem according to their computational difficulties
• With the help of time and space complexity of algorithms we can classify problems
• complexity theory helps computer scientists determine the limits of what a computational
• With this, We can ask what a computational model can and can’t do
• Computational Models:
• Turing Machine : a machine capable of solving all the problems that can be solved
by a computer.
• Each model determines what can be expressed and what can’t be.
• Graphs
• Boolean Logic
Sets
• A set is a group of objects, order doesn't matter
• Example 1.1: A set of natural numbers equal to or less than 5 can be represented: in
• Subset (A ⊆ B or A ⊇ B)
A∪B A∩B
• order matters
• Functions have three main parts: the input, the relationship and the output.
• The function always maps the input to output using a relationship and hence called a mapping
• The set of possible inputs to a function is the domain and the set of possible outputs of a function
is the range
• f : A -> B, where the set A is called the domain of the function and the set B is called the co-domain
of the function.
• mathematically we can say, A relation R from a set ‘A’ to a set ‘B’ is any subset of A × B and is
represented as R : A ->B
As there are 29 subset of A × B is possible, number of relations possible is 29. Some of those relations are R1={(a, 2),
(b, 1)} R2={(a, 3), (b, 2)} , R3={(c, 2), (b, 1)} etc.
• The points are called nodes or vertices(V ), and the lines are called edges(E)
• A subgraph S of a graph G is a graph whose vertex set V (S) is a subset of the vertex set V (G) that is
V (S) ⊆ V (G), and whose edge set E(S), is a subset of the edge set E(G), that is E(S) ⊆ E(G).
Graphs III
• The degree of a vertex is the number of edges touching it
• A simple path is a path that does not repeat nodes of the graph.
• The nodes of degree 1 in a tree, other than the root, are called the leaves of the tree.
• The number of arrows pointing from a particular node is the outdegree of that node, and
• A directed graph is strongly connected if a directed path connects every two nodes.
Strings and Languages:
• A non empty finite set of symbols is called alphabet .
• Generally capital Greek letters ∑ and Γ are used to designate alphabets and a typewriter font for
symbols.
• Examples of alphabets are ∑1 = {0, 1}, ∑2 = {a, b, c}, etc.
• A string over an alphabet is a finite sequence of symbols from that alphabet, usually written next to
• Reverse of a string, is the string obtained by writing a string w in the opposite order and is
represented as WR
• If the language takes all possible strings of length 2 over ∑ = {a, b}, then L = { ab, aa, ba, bb }
• Disjunction or OR operation ( ∨)
• Equality operation (↔ )
• Implication operation (→ )
Boolean Logic II
• The Boolean operations are used for combining simple statements into more complex Boolean
expressions.
• For example,
• if P is the Boolean value representing the truth of the statement “the sun is shining” and
• Q is the Boolean value that represents the truth of the statement “today is Monday”, then
• P ∧ Q , represent the truth value of the statement “the sun is shining and today is Monday”
and
• similarly P ∨ Q represent “the sun is shining or today is Monday”
P Q P∧ Q
0 0 0
0 1 0
1 0 0
1 1 1
Boolean Logic IV
• Disjunction or OR operation ( ∨ )
• The disjunction of two Boolean values is 1 if either of those values is 1.
• Ex: 0 ∨ 1 = 1
P Q P∨ Q
0 0 0
0 1 1
1 0 1
1 1 1
Boolean Logic V
• “Exclusive or” or XOR operation ( ⊕ )
• The Exclusive or” or XOR operation of two Boolean values is 1 if either of those values is 1 but not both
of its two operands are same .
• Ex: 0 ⊕ 0 = 0 and 1 ⊕ 1 = 0
P Q P⊕ Q
0 0 0
0 1 1
1 0 1
1 1 0
Boolean Logic VI
• Equality operation (↔ )
• The equality operation of two Boolean values is 1 if both of its operands have the same value
• Ex: 0 ↔ 0 = 1 and 1 ↔ 1 = 1
P Q P⊕ Q
0 0 1
0 1 0
1 0 0
1 1 1
Boolean Logic VII
• Implication operation (→ )
• The implication operation of two Boolean values is 0 if its first operand is 1 and its second
• operand is 0; otherwise, it is 1.
• Ex: 0 → 0 = 1 and 1 → 1 = 1
P Q P⊕ Q
0 0 1
0 1 1
1 0 0
1 1 1
Boolean Logic VIII
• All Boolean operations can be expressed in terms of the AND & NOT operations
• Note: The dual of a Boolean expression is obtained by interchanging sums and products and
interchanging 0 and 1.
• For example, the dual of xy is (x + y)
• The dual of xy +1 is (x + y) · 0
SUMMARY OF MATHEMATICAL TERMS
• Alphabet A finite, nonempty set of objects called symbols
• Argument An input to a function
• Binary relation A relation whose domain is a set of pairs
• Boolean operation An operation on Boolean values
• Boolean value The values TRUE or FALSE, often represented by 1 or 0
• Cartesian product An operation on sets forming a set of all tuples of elements from respective sets
• Complement An operation on a set, forming the set of all elements not present
• Concatenation An operation that joins strings together
• Conjunction Boolean AND operation
• Connected graph A graph with paths connecting every two nodes
SUMMARY OF MATHEMATICAL TERMS
• Cycle A path that starts and ends in the same node
• Directed graph A collection of points and arrows connecting some pairs of points
• Disjunction Boolean OR operation
• Domain The set of possible inputs to a function
• Edge A line in a graph
• Element An object in a set
• Empty set The set with no members
• Empty string The string of length zero
• Equivalence relation A binary relation that is reflexive, symmetric, and transitive
• Function An operation that translates inputs into outputs
• Graph A collection of points and lines connecting some pairs of points
• Intersection An operation on sets forming the set of common elements
SUMMARY OF MATHEMATICAL TERMS
• k-tuple A list of k objects
• Language A set of strings
• Member An object in a set
• Node A point in a graph
• Ordered pair A list of two elements
• Path A sequence of nodes in a graph connected by edges
• Predicate A function whose range is {TRUE, FALSE}
• Property A predicate
• Range The set from which outputs of a function are drawn
• Relation A predicate, most typically when the domain is a set of k-tuples
• Sequence A list of objects
SUMMARY OF MATHEMATICAL TERMS
• Set A group of objects
• Simple path A path without repetition
• Singleton set A set with one member
• String A finite list of symbols from an alphabet
• Symbol A member of an alphabet
• Union An operation on sets combining all elements into a single set
• Unordered pair A set with two members
• Vertex A point in a graph
Exercise:
0.1 Examine the following formal descriptions of sets so that you understand which members they
a. {1, 3, 5, 7, . . . }
b. { . . . ,−4,−2, 0, 2, 4, . . . }
c. The set containing all natural numbers that are less than 5
a. Is A a subset of B?
b. Is B a subset of A?
c. What is A ∪ B?
d. What is A ∩ B?
e. What is A × B?
0.5 If C is a set with c elements, how many elements are in the power set of C?
0.8 Consider the undirected graph G=(V,E) where V , the set of nodes, is {1, 2, 3, 4} and E, the set of edges,
is {{1, 2}, {2, 3}, {1, 3}, {2, 4}, {1, 4}}. Draw the graph G. What are the degrees of each node?