Chapter No.1
Chapter No.1
Chapter No.1
1
What does Automata mean?
What does Automata Theory mean?
The Central Concepts of Automata Theory
Introduction to Defining languages
Concept of Regular Expression(RE)
Languages Associated with Regular
Expression
Concept of Regular Language(RL)
What does Automata mean?
OR
A mechanism that can move automatically
The Central Concepts of Automata Theory
• Alphabets
• Strings
• Empty String or Null String:
• Strings Length:
• Reverse of a String
• Words
• Kleene Star Closure
• Plus Operation (+) in Kleene Star
Alphabets
A finite non-empty set of symbols ( letters), is
called an alphabet. It is denoted by Σ ( Greek
letter sigma).
Example:
Σ = {a,b}
Σ = {0,1} (important as this is the language
which the computer understands.)
Strings
Example
Empty String or Null String
Sometimes a string with no symbol at all is
used, denoted by (Small Greek letter Lambda)
λ or (Capital Greek letter Lambda) Λ, is called
an empty string or null string. The capital
lambda will mostly be used to denote the
empty string, in further discussion.
Strings Length
The length of string s, denoted by |s|, is the number of letters
in the string.
Example:
Σ = {a,b}
s =ababab
|s| =6
Example:
Σ = {ba , baa , caa , d}
s =babaacaad
|s| =4
Reverse of a String
The reverse of a string s denoted by Rev(s) or sr, is
obtained by writing the letters of s in reverse order.
Example:
If s=abc is a string defined over Σ={a,b,c}
then
Rev(s) or sr = cba
Example:
If s= abcde is a string defined over Σ= {a,b,c,d,e}
then
Rev(s) or sr = edcba
Words
Example
If Σ = {0,1}
Then Σ* = {Λ, 0, 1, 00, 01, 10, 11, ….}
Plus Operation (+) in Kleene Star
Plus Operation is same as Kleene Star Closure
except that it does not generate Λ (null string),
automatically.
Example
If Σ = {0,1}
Then Σ+ = {0, 1, 00, 01, 10, 11, ….}
Example
If Σ = {aab, c}
Then Σ+ = {aab, c, aabaab, aabc, caab, cc, ….}
Introduction to Defining languages
The set of language-defining rules can be of two
kinds. They can either tell us how to test a string of
alphabet letters that we might be presented with, to
see if it is a valid word, or they can tell us how to
construct all the words in the language by some
clear procedures.
Let us consider some simple examples of languages.
If we start with an alphabet having only one letter x.
Σ = {x}
Introduction to Defining languages
Example:
we can define a language by saying that any
nonempty string of alphabet characters is a
word:
L={x , xx , xxx , xxxx.........}
We could write this in an alternate form:
L={xn for n=1 2 3 .......}
Introduction to Defining languages
Example:
we can define a language by saying that any
empty string of alphabet characters is a word:
L={ Λ , x , xx , xxx , xxxx ,.........}
We could write this in an alternate form:
L={xn for n=0 1 2 3 .......}
Introduction to Defining languages
Example:
If we take two words are concatenation they produce another
word in the language.
L={x ,xxx , xxxxx ,xxxxxxx .......}
={xodd}
L={x2n+1 for n=0 1 2 3.......}
Example
The language {anbn }, of strings defined over Σ={a,b}, as
{an bn : n=1,2,3,…}, can be written as
{ab, aabb, aaabbb,aaaabbbb,…}
Introduction to Defining languages
Example
The language {anbnan }, of strings defined over
Σ={a,b}, as
{an bn an: n=1,2,3,…}, can be written as
{aba, aabbaa, aaabbbaaa,aaaabbbbaaaa,…}
Regular Expression
r is a regular expression if it is:
1. a for some a in the alphabet , standing for the
language {a}
2. Λ, standing for the language { Λ}
3. r1+r2 where r1 and r2 are regular expressions, and +
signifies union (sometimes | is used)
4. r1r2 where r1 and r2 are regular expressions and this
signifies concatenation
5. r* where r is a regular expression and signifies closure
6. (r) where r is a regular expression, then a parenthesized r
is also a regular expression.
Regular Expression
The symbols that appear in regular expressions are the
letters of the alphabet Σ, the symbol for null string Λ,
parentheses, the star operator, and the plus sign.
As discussed earlier that a* generates Λ, a, aa, aaa, … and a+
generates a, aa, aaa, aaaa, …, so the language L1= {Λ, a, aa,
aaa, …} and L2 = {a, aa, aaa, aaaa, …} can simply be
expressed by a* and a+, respectively.
a* and a+ are called the regular expressions (RE) for L1 and
L2 respectively.
Note a+, aa* and a*a generate L2.
Recursive definition of Regular Expression(RE)
Rule 1:
Every letter of Σ including Λ is a regular expression.
Rule 2:
If r1 and r2 are regular expressions then
(r1)
r1 r2
r1 + r2
r1*
are also regular expressions.
Rule 3:
ii-
language(r1+r2)=L1+L2
iii-
The language associated with the regular expression (r1)* is L1, the Kleene