SlideShare a Scribd company logo
1
Chapter one
Introduction to theory of computation(ToC)
Chapter programme
ToC
Mathematical introductions
Basic ideas and terminologies of formal langue and
automata theory
automata
2
Introduction to the theory of computation
The Theory of Computation, which tries to answer the Following questions:
 What are the mathematical properties of computer hardware and software?
 What is a computation and what is an algorithm? Can we give rigorous
mathematical definitions of these notions?
 What are the limitations of computers? Can “everything” be computed?
Purpose of the Theory of Computation: Develop formal mathematical models of
computation that reflect real-world computers.
Nowadays, the Theory of Computation can be divided into the following three areas:
Complexity Theory, Computability Theory, and Automata Theory.
Mathematical preliminaries
A set is an unordered collection of different elements.
 A set of all the planets in the solar system
 A set of all the states in India
 A set of all the lowercase letters of the alphabet
 N − the set of all natural numbers = {1, 2, 3, 4, .....}
 Z − the set of all integers = {....., −3, −2, −1, 0, 1, 2, 3, .....}
 Z+ − the set of all positive integers
 Q − the set of all rational numbers
 R − the set of all real numbers
 W − the set of all whole numbers
Sets can be represented in two ways −
 Roster or Tabular Form
 Set Builder Notation
3
Set Builder Notation
The set is represented by listing all the elements comprising it. The elements are enclosed
within braces and separated by commas. Example :Set of vowels in English alphabet, A
= {a,e,i,o,u}
Roster or Tabular Form
If we are given a set A such that x is in A iff x has property P, then we write A = {x | x
has property P}A = { x : p(x)}. Example: Thus, P = {x | x is a prime number} is the
set of prime numbers. Similarly, if we want to only look at prime numbers of the form
n2
+1 we could write {x ∈ P | there exists a natural number n, such that x = n2 + 1.}
A more compact way of denoting this set is {x ∈ P | (∃n ∈ N) ∋ (x = n2 + 1)} or even
simply {x ∈ P | (∃n ∈ N)(x = n2 + 1)}.
Example − The set {a,e,i,o,u} is written as − A = { x : x is a vowel in English alphabet}.
Cardinality of a set S, denoted by |S|, is the number of elements of the set. If a set has an
infinite number of elements, its cardinality is ∞.
Example − |{1, 4, 3, 5}| = 4, |{1, 2, 3, 4, 5,…}| = ∞
Sets can be classified into many types. Some of which are finite, infinite, subset,
universal, proper, etc. A set which contains a definite number of elements is called a
finite set. Example − S = {x | x  N and 70 > x > 50}. A set which contains infinite
number of elements is called an infinite set. Example − S = {x | x  N and x > 10}
An empty set contains no elements. It is denoted by . As the n umber of elements in an
empty set is finite, empty set is a finite set. The cardinality of empty set or null set is zero.
If two sets contain the same elements they are said to be equal.
Example − If A = {1, 2, 6} and B = {6, 1, 2}, they are equal as every element of set A is
an element of set B and every element of set B is an element of set A.
If the cardinalities of two sets are same, they are called equivalent sets.
Example − If A = {1, 2, 6} and B = {16, 17, 22}, they are equivalent as cardinality of A
is equal to the cardinality of B. i.e. |A| = |B| = 3
4
If two sets C and D are disjoint sets as they do not have even one element in common.
The intersection of any two distinct sets is empty.
A relation associates elements of one set called the domain, with elements of another set
called the co domain (both sets are non-empty set) example: One set: set of students.
Another set: set of subjects.Functions are especial relations.
A graph is a pictorial representation of a set of objects where some pairs of objects are
connected by links. The interconnected objects are represented by points termed as
vertices, and the links that connect the vertices are called edges.
Formally Definition − A graph (denoted as G = (V, E)) consists of a non-empty set of
vertices or nodes V and a set of edges E.
Example − Let us consider, a Graph is G = (V, E) where V = {a, b, c, d} and E = {{a, b},
{a, c}, {b, c},{c, d}}
Take a look at the following graph –
a b
c d e
In the above graph,
V = {a, b, c, d, e}
E = {ab, ac, bd, cd, de}
Tree
Tree is a special form of graph having no loops, no circuits and no self-loops. A
connected acyclic graph is called a tree. In other words, a connected graph with no cycles
is called a tree. The edges of a tree are known as branches. Elements of trees are called
their nodes. The nodes without child nodes are called leaf nodes.
5
Basic concepts of automata and Language Theory
Formal language theory, the discipline which studies formal grammars and languages,
is a branch of applied mathematics computer science. Its applications are found in
theoretical computer science, theoretical linguistics, formal semantics, mathematical
logic, and other areas.
A formal grammar (sometimes simply called a grammar) is a set of rules for forming
strings in a formal language. The rules describe how to form strings from the language's
alphabet that are valid according to the language's syntax. A grammar does not describe
the meaning of the strings or what can be done with them in whatever context – only their
Form, i.e. their internal structural patterns.
An alphabet is any finite, non-empty set of symbols, usually denoted by the symbol ∑
(sigma) and write Σ = {a1, . . . , ak}. The ai are called the symbols of the alphabet.
Examples:
Binary: ∑ = {0,1}
All lower case letters: ∑ = {a,b,c,..z}
Alphanumeric: ∑ = {a-z, A-Z, 0-9}
A string (sometimes a word) is a finite sequence of symbols chosen from ∑. Length of a
string w, denoted by “|w|”, is equal to the number of (non- ) characters in the string(or
positions). The empty string, denoted by  (or “epsilon”), is the string having length zero.
For example, if the alphabet  is equal to {0, 1}, then 10, 1000, 0, 101, and  are strings
over, having lengths 2, 4, 1, 3, and 0, respectively.
E.g., x = 010100 |x| = 6
x = 01  0  1  00  |x| = ?
If w=„cabcad‟, |w|= 6
If |w|= 0, it is called an empty string (Denoted by λ or ε)
6
The set of all strings over Σ of length n is denoted  n
. For example, if Σ = (0, 1), then
 2
= {00, 01, 10, 11}. Note that  0
= {ε} for any alphabet Σ, power of an alphabet
Examples:
If ={0,1}, then
0
:{} regardless what the alphabet  is.
1
= {0, 1}.
2
= {00, 01, 10, 11}.
3
= {000, 001, 010, 011, 100, 101, 110, 111}.
Kleene star (or Kleene operator or Kleene closure)
The set of all strings over Σ of any length is the Kleene star of Σ and Is denoted Σ*.
Representation: Σ*= Σ0
∪Σ1
∪Σ2
∪. . .
For example, if Σ = (0, 1), Σ* = (ε, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011 …).
Example − If Σ = {a, b}, Σ*= { ε, a, b, aa, ab, ba, bb,………..}
Languages: “A language is a collection of sentences (words) of finite length all
constructed from a finite alphabet of symbols”.
A language L is a possibly infinite set of strings over a finite alphabet Σ. If Σ is an
alphabet, and L ⊆ Σ *, then L is a formal language over Σ. (formal definition)
Operations on Languages
Operations that can be used to construct languages from other languages are language
operations. Since languages are sets, we can use the usual set operations, Union, L1∪L2,
Intersection, L1∩L2, Complement, Lc, Set difference, L1-L2. The intersection L1 ∩ L2
of L1 and L2 consists of all strings which are contained in both languages and the
complement ¬L of a language with respect to a given alphabet consists of all strings over
the alphabets that are not in the language.
7
We also have new operations defined especially for sets of strings:
 Concatenation, L1◦L2 or justL1L2
 Star, L*
Concatenation
L1◦L2 = { x y | x ∈L1and y ∈L2 } x and y are strings
–Pick one string from each language and concatenate them.
•Example: Σ= { 0, 1 }, L1= { 0, 00 }, L2 = { 01, 001 }
L1◦L2 = { 001, 0001, 00001 }
•Notes: | L1◦L2 | ≤| L1| ×|L2 |, not necessarily equal.
L ◦L does not mean { x x | x ∈L }, but rather, { x y | x and y are both in L}.
Example: Σ= { 0, 1 }, L1= { 0, 00 }, L2 = { 01, 001
L1◦L2 = { 001, 0001, 00001 }
L2◦L2 = { 0101, 01001, 00101, 001001 }
Example: ∅◦L= { x y | x ∈∅and y ∈L} = ∅
_____ { ε} ◦L={ x y | x ∈{ ε} and y ∈L} = L
______L1◦L2 = { x y | x ∈L1and y ∈L2 }
Write L ◦L as L2
, L ◦L ◦…◦L as Ln
, which is { x1x2…xn| all x‟s are in L }
Example: L = { 0, 11 },L3
= { 000, 0011, 0110, 01111, 1100, 11011, 11110, 111111 }
Example: L = { 0, 00 },L3
= { 000, 0000, 00000, 000000 }
Boundary cases: L1 = L
Define L
0
= { ε}, for every L__Implies that L0
Ln
={ ε} Ln
= Ln
, Special case of general
rule La
Lb
= La+b
.
The Star Operation
•L* = { x | x = y1y2…yk for some k ≥0, where every y is in L }
= L0
∪L1
∪L2
∪…
8
Note: ε is in L* for every L, since it‟s in L0
.
Example: What is ∅* ? –Apply the definition: ∅* = ∅0
∪ ∅1
∪ ∅2
∪…= { ε}.
∅0
is { ε},by the convention that L0
=
{ ε}.
The rest of these are just
∅.
Example: What is { a }* ?
–Apply the definition:
{ a }*= { a }
0
∪{ a }
1
∪{ a }
2
∪…
= { ε} ∪{ a } ∪{ a a } ∪…
= { ε, a, a a, a a a, …}
–Abbreviate this to just a*.
–Note this is not just one string, but a set of strings---any number of a‟s
Example: What is Σ*?
–We‟ve already defined this to be the set of all finite strings over Σ.
–But now it has a new formal definition: Σ*= Σ0
∪Σ1
∪Σ2
∪…
= {ε} ∪ {strings of length 1 over Σ}
∪ {strings of length 2 over Σ}
∪…
= { all finite strings over Σ}
 L is a said to be a language over alphabet ∑, only if L∑* this is because ∑* is the set
of all strings (of all possible length including 0) over the given alphabet ∑
 Examples:
1. Let L be the language of all strings consisting of n 0‟s followed by n 1‟s: L =
{,01,0011,000111,…}
2. Let L be the language of all strings of with equal number of 0‟s and 1‟s:
L{,01,10,0011,1100,0101,1010,1001,…}
 Definition: Ø denotes the Empty language
Let L = {}; Is L=Ø? NO, why?
9
Automata theory
Automata theory is the study of abstract machines (or more appropriately, abstract
„mathematical‟ machines or systems) and the computational problems that can be solved
Using these machines. These abstract machines are called automata (singular
,automaton).
Automata Theory deals with definitions and properties of different types of
“Computation models”. Examples of such models are:
 Finite Automata. These are used in text processing, compilers, and hardware
design.
 Context-Free Grammars. These are used to define programming languages and in
Artificial Intelligence.
 Turing Machines. These form a simple abstract model of a “real” computer, such
as your PC at home.
The above figure illustrates a finite state machine, which is one well-known variety of
automata. This automaton consists of states (represented in the figure by circles), and
transitions (represented by arrows). As the automaton sees a symbol of input, it makes a
transition (or jump) to another state, according to its transition function (which takes the
current state and the recent symbol as its inputs).

More Related Content

PDF
Sets and Functions By Saleh ElShehabey
PDF
Set theory
PPTX
Theory of Computation "Chapter 1, introduction"
PDF
Sets in discrete mathematics
PPTX
Sets
PPT
Class1
PDF
Set, Relations and Functions
PPTX
2.1 Sets
Sets and Functions By Saleh ElShehabey
Set theory
Theory of Computation "Chapter 1, introduction"
Sets in discrete mathematics
Sets
Class1
Set, Relations and Functions
2.1 Sets

What's hot (17)

PDF
Maths
PPT
Set concepts
PPTX
MIT Math Syllabus 10-3 Lesson 1: Sets and the real number system
PDF
Flat unit 1
PPTX
Module week 1 Q1
PDF
Digital text book sets
PPTX
Set _Number System
PPTX
Set and its types
PPTX
Math 7 | lesson 1 Sets
PDF
Steiner Tree Parameterized by Treewidth
PDF
BCA_Semester-I_Mathematics-I_Set theory and function
PPT
Pertemuan 5_Relation Matriks_01 (17)
PPTX
Theory of computation Lec1
PPTX
Lesson 1.1 basic ideas of sets part 2
PPTX
Formal language
PDF
Sets of numbers
PDF
Presentation4
Maths
Set concepts
MIT Math Syllabus 10-3 Lesson 1: Sets and the real number system
Flat unit 1
Module week 1 Q1
Digital text book sets
Set _Number System
Set and its types
Math 7 | lesson 1 Sets
Steiner Tree Parameterized by Treewidth
BCA_Semester-I_Mathematics-I_Set theory and function
Pertemuan 5_Relation Matriks_01 (17)
Theory of computation Lec1
Lesson 1.1 basic ideas of sets part 2
Formal language
Sets of numbers
Presentation4
Ad

Similar to Theory of computation (20)

PPTX
Language of Sets (mathematics in the modern world) Lesson 2.pptx
PPTX
LECTURE_2_DISCRETE mathematics slides.pptx
PPT
4898850.ppt
PPTX
PresentationMaths.pptx based on set theory
PPTX
Explore the foundational concepts of sets in discrete mathematics
PPTX
INTRODUCTION TO Set Theory- Unit 4 .pptx
PDF
Sets functions-sequences-exercises
PPTX
Discrete mathematics OR Structure
PPT
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
PPT
discrete maths notes.ppt
PDF
Algorithms on Strings
PPTX
SETS PPT-XI.pptx
PDF
Anubhav.pdf
PPT
Set concepts
PDF
Set and Set operations, UITM KPPIM DUNGUN
PPTX
Set theory- Introduction, symbols with its meaning
PPT
Maths Project 11 class(SETS)
PPT
PPT
7-Sets-1.ppt
PPTX
Sets and functions daniyal khan
Language of Sets (mathematics in the modern world) Lesson 2.pptx
LECTURE_2_DISCRETE mathematics slides.pptx
4898850.ppt
PresentationMaths.pptx based on set theory
Explore the foundational concepts of sets in discrete mathematics
INTRODUCTION TO Set Theory- Unit 4 .pptx
Sets functions-sequences-exercises
Discrete mathematics OR Structure
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
discrete maths notes.ppt
Algorithms on Strings
SETS PPT-XI.pptx
Anubhav.pdf
Set concepts
Set and Set operations, UITM KPPIM DUNGUN
Set theory- Introduction, symbols with its meaning
Maths Project 11 class(SETS)
7-Sets-1.ppt
Sets and functions daniyal khan
Ad

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PDF
cuic standard and advanced reporting.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Modernizing your data center with Dell and AMD
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
A Presentation on Artificial Intelligence
PDF
Electronic commerce courselecture one. Pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
cuic standard and advanced reporting.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Dropbox Q2 2025 Financial Results & Investor Presentation
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Modernizing your data center with Dell and AMD
The AUB Centre for AI in Media Proposal.docx
A Presentation on Artificial Intelligence
Electronic commerce courselecture one. Pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
NewMind AI Weekly Chronicles - August'25 Week I
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Empathic Computing: Creating Shared Understanding
Understanding_Digital_Forensics_Presentation.pptx
Review of recent advances in non-invasive hemoglobin estimation

Theory of computation

  • 1. 1 Chapter one Introduction to theory of computation(ToC) Chapter programme ToC Mathematical introductions Basic ideas and terminologies of formal langue and automata theory automata
  • 2. 2 Introduction to the theory of computation The Theory of Computation, which tries to answer the Following questions:  What are the mathematical properties of computer hardware and software?  What is a computation and what is an algorithm? Can we give rigorous mathematical definitions of these notions?  What are the limitations of computers? Can “everything” be computed? Purpose of the Theory of Computation: Develop formal mathematical models of computation that reflect real-world computers. Nowadays, the Theory of Computation can be divided into the following three areas: Complexity Theory, Computability Theory, and Automata Theory. Mathematical preliminaries A set is an unordered collection of different elements.  A set of all the planets in the solar system  A set of all the states in India  A set of all the lowercase letters of the alphabet  N − the set of all natural numbers = {1, 2, 3, 4, .....}  Z − the set of all integers = {....., −3, −2, −1, 0, 1, 2, 3, .....}  Z+ − the set of all positive integers  Q − the set of all rational numbers  R − the set of all real numbers  W − the set of all whole numbers Sets can be represented in two ways −  Roster or Tabular Form  Set Builder Notation
  • 3. 3 Set Builder Notation The set is represented by listing all the elements comprising it. The elements are enclosed within braces and separated by commas. Example :Set of vowels in English alphabet, A = {a,e,i,o,u} Roster or Tabular Form If we are given a set A such that x is in A iff x has property P, then we write A = {x | x has property P}A = { x : p(x)}. Example: Thus, P = {x | x is a prime number} is the set of prime numbers. Similarly, if we want to only look at prime numbers of the form n2 +1 we could write {x ∈ P | there exists a natural number n, such that x = n2 + 1.} A more compact way of denoting this set is {x ∈ P | (∃n ∈ N) ∋ (x = n2 + 1)} or even simply {x ∈ P | (∃n ∈ N)(x = n2 + 1)}. Example − The set {a,e,i,o,u} is written as − A = { x : x is a vowel in English alphabet}. Cardinality of a set S, denoted by |S|, is the number of elements of the set. If a set has an infinite number of elements, its cardinality is ∞. Example − |{1, 4, 3, 5}| = 4, |{1, 2, 3, 4, 5,…}| = ∞ Sets can be classified into many types. Some of which are finite, infinite, subset, universal, proper, etc. A set which contains a definite number of elements is called a finite set. Example − S = {x | x  N and 70 > x > 50}. A set which contains infinite number of elements is called an infinite set. Example − S = {x | x  N and x > 10} An empty set contains no elements. It is denoted by . As the n umber of elements in an empty set is finite, empty set is a finite set. The cardinality of empty set or null set is zero. If two sets contain the same elements they are said to be equal. Example − If A = {1, 2, 6} and B = {6, 1, 2}, they are equal as every element of set A is an element of set B and every element of set B is an element of set A. If the cardinalities of two sets are same, they are called equivalent sets. Example − If A = {1, 2, 6} and B = {16, 17, 22}, they are equivalent as cardinality of A is equal to the cardinality of B. i.e. |A| = |B| = 3
  • 4. 4 If two sets C and D are disjoint sets as they do not have even one element in common. The intersection of any two distinct sets is empty. A relation associates elements of one set called the domain, with elements of another set called the co domain (both sets are non-empty set) example: One set: set of students. Another set: set of subjects.Functions are especial relations. A graph is a pictorial representation of a set of objects where some pairs of objects are connected by links. The interconnected objects are represented by points termed as vertices, and the links that connect the vertices are called edges. Formally Definition − A graph (denoted as G = (V, E)) consists of a non-empty set of vertices or nodes V and a set of edges E. Example − Let us consider, a Graph is G = (V, E) where V = {a, b, c, d} and E = {{a, b}, {a, c}, {b, c},{c, d}} Take a look at the following graph – a b c d e In the above graph, V = {a, b, c, d, e} E = {ab, ac, bd, cd, de} Tree Tree is a special form of graph having no loops, no circuits and no self-loops. A connected acyclic graph is called a tree. In other words, a connected graph with no cycles is called a tree. The edges of a tree are known as branches. Elements of trees are called their nodes. The nodes without child nodes are called leaf nodes.
  • 5. 5 Basic concepts of automata and Language Theory Formal language theory, the discipline which studies formal grammars and languages, is a branch of applied mathematics computer science. Its applications are found in theoretical computer science, theoretical linguistics, formal semantics, mathematical logic, and other areas. A formal grammar (sometimes simply called a grammar) is a set of rules for forming strings in a formal language. The rules describe how to form strings from the language's alphabet that are valid according to the language's syntax. A grammar does not describe the meaning of the strings or what can be done with them in whatever context – only their Form, i.e. their internal structural patterns. An alphabet is any finite, non-empty set of symbols, usually denoted by the symbol ∑ (sigma) and write Σ = {a1, . . . , ak}. The ai are called the symbols of the alphabet. Examples: Binary: ∑ = {0,1} All lower case letters: ∑ = {a,b,c,..z} Alphanumeric: ∑ = {a-z, A-Z, 0-9} A string (sometimes a word) is a finite sequence of symbols chosen from ∑. Length of a string w, denoted by “|w|”, is equal to the number of (non- ) characters in the string(or positions). The empty string, denoted by  (or “epsilon”), is the string having length zero. For example, if the alphabet  is equal to {0, 1}, then 10, 1000, 0, 101, and  are strings over, having lengths 2, 4, 1, 3, and 0, respectively. E.g., x = 010100 |x| = 6 x = 01  0  1  00  |x| = ? If w=„cabcad‟, |w|= 6 If |w|= 0, it is called an empty string (Denoted by λ or ε)
  • 6. 6 The set of all strings over Σ of length n is denoted  n . For example, if Σ = (0, 1), then  2 = {00, 01, 10, 11}. Note that  0 = {ε} for any alphabet Σ, power of an alphabet Examples: If ={0,1}, then 0 :{} regardless what the alphabet  is. 1 = {0, 1}. 2 = {00, 01, 10, 11}. 3 = {000, 001, 010, 011, 100, 101, 110, 111}. Kleene star (or Kleene operator or Kleene closure) The set of all strings over Σ of any length is the Kleene star of Σ and Is denoted Σ*. Representation: Σ*= Σ0 ∪Σ1 ∪Σ2 ∪. . . For example, if Σ = (0, 1), Σ* = (ε, 0, 1, 00, 01, 10, 11, 000, 001, 010, 011 …). Example − If Σ = {a, b}, Σ*= { ε, a, b, aa, ab, ba, bb,………..} Languages: “A language is a collection of sentences (words) of finite length all constructed from a finite alphabet of symbols”. A language L is a possibly infinite set of strings over a finite alphabet Σ. If Σ is an alphabet, and L ⊆ Σ *, then L is a formal language over Σ. (formal definition) Operations on Languages Operations that can be used to construct languages from other languages are language operations. Since languages are sets, we can use the usual set operations, Union, L1∪L2, Intersection, L1∩L2, Complement, Lc, Set difference, L1-L2. The intersection L1 ∩ L2 of L1 and L2 consists of all strings which are contained in both languages and the complement ¬L of a language with respect to a given alphabet consists of all strings over the alphabets that are not in the language.
  • 7. 7 We also have new operations defined especially for sets of strings:  Concatenation, L1◦L2 or justL1L2  Star, L* Concatenation L1◦L2 = { x y | x ∈L1and y ∈L2 } x and y are strings –Pick one string from each language and concatenate them. •Example: Σ= { 0, 1 }, L1= { 0, 00 }, L2 = { 01, 001 } L1◦L2 = { 001, 0001, 00001 } •Notes: | L1◦L2 | ≤| L1| ×|L2 |, not necessarily equal. L ◦L does not mean { x x | x ∈L }, but rather, { x y | x and y are both in L}. Example: Σ= { 0, 1 }, L1= { 0, 00 }, L2 = { 01, 001 L1◦L2 = { 001, 0001, 00001 } L2◦L2 = { 0101, 01001, 00101, 001001 } Example: ∅◦L= { x y | x ∈∅and y ∈L} = ∅ _____ { ε} ◦L={ x y | x ∈{ ε} and y ∈L} = L ______L1◦L2 = { x y | x ∈L1and y ∈L2 } Write L ◦L as L2 , L ◦L ◦…◦L as Ln , which is { x1x2…xn| all x‟s are in L } Example: L = { 0, 11 },L3 = { 000, 0011, 0110, 01111, 1100, 11011, 11110, 111111 } Example: L = { 0, 00 },L3 = { 000, 0000, 00000, 000000 } Boundary cases: L1 = L Define L 0 = { ε}, for every L__Implies that L0 Ln ={ ε} Ln = Ln , Special case of general rule La Lb = La+b . The Star Operation •L* = { x | x = y1y2…yk for some k ≥0, where every y is in L } = L0 ∪L1 ∪L2 ∪…
  • 8. 8 Note: ε is in L* for every L, since it‟s in L0 . Example: What is ∅* ? –Apply the definition: ∅* = ∅0 ∪ ∅1 ∪ ∅2 ∪…= { ε}. ∅0 is { ε},by the convention that L0 = { ε}. The rest of these are just ∅. Example: What is { a }* ? –Apply the definition: { a }*= { a } 0 ∪{ a } 1 ∪{ a } 2 ∪… = { ε} ∪{ a } ∪{ a a } ∪… = { ε, a, a a, a a a, …} –Abbreviate this to just a*. –Note this is not just one string, but a set of strings---any number of a‟s Example: What is Σ*? –We‟ve already defined this to be the set of all finite strings over Σ. –But now it has a new formal definition: Σ*= Σ0 ∪Σ1 ∪Σ2 ∪… = {ε} ∪ {strings of length 1 over Σ} ∪ {strings of length 2 over Σ} ∪… = { all finite strings over Σ}  L is a said to be a language over alphabet ∑, only if L∑* this is because ∑* is the set of all strings (of all possible length including 0) over the given alphabet ∑  Examples: 1. Let L be the language of all strings consisting of n 0‟s followed by n 1‟s: L = {,01,0011,000111,…} 2. Let L be the language of all strings of with equal number of 0‟s and 1‟s: L{,01,10,0011,1100,0101,1010,1001,…}  Definition: Ø denotes the Empty language Let L = {}; Is L=Ø? NO, why?
  • 9. 9 Automata theory Automata theory is the study of abstract machines (or more appropriately, abstract „mathematical‟ machines or systems) and the computational problems that can be solved Using these machines. These abstract machines are called automata (singular ,automaton). Automata Theory deals with definitions and properties of different types of “Computation models”. Examples of such models are:  Finite Automata. These are used in text processing, compilers, and hardware design.  Context-Free Grammars. These are used to define programming languages and in Artificial Intelligence.  Turing Machines. These form a simple abstract model of a “real” computer, such as your PC at home. The above figure illustrates a finite state machine, which is one well-known variety of automata. This automaton consists of states (represented in the figure by circles), and transitions (represented by arrows). As the automaton sees a symbol of input, it makes a transition (or jump) to another state, according to its transition function (which takes the current state and the recent symbol as its inputs).