Fouzia Jabeen: Theory of Automata
Fouzia Jabeen: Theory of Automata
Chapter 1
Fouzia Jabeen
Automata
It is the plural of automaton, and it means
“something that works automatically”
There are two types of languages
Formal Languages (Syntactic languages)
Informal Languages (Semantic languages)
Automata theory deals with definitions, properties
of different computation models e.g.
Finite automata (text processing, compilers, hardware desi)
Context free grammers (Programming lang, Artificial intelli)
Turing machines (Abstract model of simple PC)
Alphabets
Alphabets: A finite non-empty set of
symbols (called letters), is called an
alphabet. It is denoted by Σ ( Greek letter
sigma).
Example is Σ = {a,b}
Σ = {0,1} (important as this is the language
alphabet.
Conclusion
Σ1= {B, aB, bab, B}
Σ2= {B, Ba, bab, B}
Σ1 is a valid alphabet while Σ2 is an in-valid
alphabet.
Length of Strings
The length of string s, denoted by |s|, is the
number of letters in the string.
Example 01 :
Σ={a,b}
s=ababa
|s|=5
Example 02 :
Σ= {B, aB, bab, d}
s=BaBbabBd
Tokenizing=(B), (aB), (bab), (B), (d)
|s|=5
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 01:
If s=abc is a string defined over Σ={a,b,c} ,then
Rev(s) or sr = cba
Example 02 :
Σ= {B, aB, bab, d}
s=BaBbabBd
Rev(s)=dBbabaBB
Defining Languages
The languages can be defined in different ways ,
such as Descriptive definition, Recursive definition,
using Regular Expressions(RE) and using Finite
Automaton(FA) etc.
Descriptive definition of language :
The language is defined, describing the conditions imposed
on its words.
Example 01 :
The language L of strings of odd length, defined over Σ={a},
can be written as
L={a, aaa, aaaaa,…..}
Descriptive examples
Example 02 :
The language L of strings that does not start with a,
defined over Σ ={a,b,c}, can be written as
L ={Λ, b, c, ba, bb, bc, ca, cb, cc, …}
Example 03 :
The language L of strings of length 2, defined over Σ
={0,1,2}, can be written as
L={00, 01, 02,10, 11,12,20,21,22}
Example 04 :
The language L of strings ending in 0, defined over Σ
={0,1}, can be written as
L={0,00,10,000,010,100,110,…}
Languages
EQUAL language :
The language EQUAL, of strings with number of a’s equal to
number of b’s, defined over Σ={a,b}, can be written as
{Λ ,ab,aabb,abab,baba,abba,…}
EVEN-EVEN language :
The language EVEN-EVEN, of strings with even number of
a’s and even number of b’s, defined over Σ={a,b}, can be
written as
{Λ, aa, bb, aaaa,aabb,abab, abba, baab, baba, bbaa, bbbb,
…}
Languages
INTEGER language :
The language INTEGER, of strings defined over
Σ={-,0,1,2,3,4,5,6,7,8,9}, can be written as
INTEGER = {…,-2,-1,0,1,2,…}
EVEN language :
The language EVEN, of stings defined over
Σ={-,0,1,2,3,4,5,6,7,8,9}, can be written as
EVEN = { …,-4,-2,0,2,4,…}
Languages
Language a to the power n & b to the power n :
The language {aⁿbⁿ }, of strings defined over Σ={a,b}, as
{aⁿbⁿ : n=1,2,3,…}, can be written as
{ab, aabb, aaabbb,aaaabbbb,…}
Language a,b,a to the power n :
The language {aⁿbⁿaⁿ }, of strings defined over Σ={a,b}, as
{aⁿbⁿaⁿ : n=1,2,3,…}, can be written as
{aba, aabbaa, aaabbbaaa,aaaabbbbaaaa,…}
Languages
Language factorial :
The language factorial, of strings defined over
Σ={0,1,2,3,4,5,6,7,8,9} i.e.
{1,2,6,24,120,…}
Language FACTORIAL :
The language FACTORIAL, of strings defined over Σ={a}, as
{aⁿᵎ! : n=1,2,3,…}, can be written as
{a,aa,aaaaaa,…}. It is to be noted that the language
FACTORIAL can be defined over any single letter alphabet.
Languages
Language DOUBLEFACTORIAL :
The language DOUBLEFACTORIAL, of strings defined over
Σ={a, b}, as {aⁿᵎ bⁿᵎ : n=1,2,3,…}, can be written as
{ab, aabb, aaaaaabbbbbb,…}
Language SQUARE :
The language SQUARE, of strings defined over Σ={a}, as
{aⁿ2 : n=1,2,3,…}, can be written as
{a, aaaa, aaaaaaaaa,…}
Languages
Language DOUBLESQUARE :
The language DOUBLESQUARE, of strings defined over
Σ={a,b}, as {aⁿ2 bⁿ2 : n=1,2,3,…}, can be written as
{ab, aaaabbbb, aaaaaaaaabbbbbbbbb,…}
Language PRIME :
The language PRIME, of strings defined over Σ={a}, as
{aᵖ : p is prime}, can be written as
{aa,aaa,aaaaa,aaaaaaa,aaaaaaaaaaa…}
PALINDROME
The language consisting of Λ and the strings s
defined over Σ such that Rev(s)=s.
It is to be denoted that the words of PALINDROME
For Σ={a,b},
bbb, ...}
Palindrome
Remark
There are as many palindromes of length 2n as
https://www.tutorialspoint.com/automata_th
eory/automata_theory_tutorial.pdf