Chapter No.1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 31

Chapter No.

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?

It is the plural of automaton, and it means


“something that works automatically”.

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

• Concatenation of finite number of letters from


the alphabet is called a string.

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

Words are strings belonging to some language.


 
Example

 If Σ= {x} then a language L can be defined as


L={xn : n=1,2,3,…..} or L={x, xx, xxx,….}
Here x, xx,… are the words of L
 
Kleene Star Closure
Given Σ, then the Kleene Star Closure of the
alphabet Σ, denoted by Σ*, is the collection of all
strings defined over Σ, including Λ. It is to be noted
that Kleene Star Closure can be defined over any
set of strings.
 
Note: Λ Λ = Λ , concept of Σ* and Σ+
 
Then Σ* in which we used Null String (Λ) and Σ+ in which we cannot used Null String (Λ)
Kleene Star Closure
Example
Kleene Star Closure
Example
If Σ = {x}
Then Σ* = {Λ, x, xx, xxx, xxxx, ….}

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:

Nothing else is a regular expression.


 
Examples of Regular Expressions
Consider the language L={Λ, x, xx, xxx,…} of
strings, defined over Σ = {x}.
 
We can write this language as the Kleene star
closure of alphabet Σ or L=Σ*={x}* .
 
This language can also be expressed by the
regular expression x*.
Examples of Regular Expressions
Consider the language L={ x, xx, xxx,…} of
strings, defined over Σ = {x}.
 
We can write this language as the Kleene star
closure of alphabet Σ or L=Σ+={x} + .
 
This language can also be expressed by the
regular expression x+.
Examples of Regular Expressions
Now consider another language L, of even
length, defined over Σ = {a, b}, then it’s regular
expression may be
((a+b)(a+b))*.
Now consider another language L, of odd
length, defined over Σ = {a, b}, then it’s regular
expression may be
(a+b)((a+b)(a+b))* or ((a+b)(a+b))*(a+b).
Languages Associated with Regular
Expression
The following rules define the language associated
expression with any regular Expression:
 
Rule 1:
The language associated with the regular
expression that is just a single letter is that one-
letter word alone and the language associated
with Λ is just {Λ}, a one-word language.
 
Languages Associated with Regular
Expression
Rule 2:
The r1 is a regular expression with associated
language L1 and r2 is a regular expression
associated language L2, then:

i- The regular expression (r1)(r2) is associated with


the product L1L2 that is the language L1 times L2
  language (r1 r2) = L1L2
Languages Associated with Regular
Expression

ii-

The regular expression r1 + r2 is associated with the language formed by the

union of the sets L1 and L2:

language(r1+r2)=L1+L2

iii-

The language associated with the regular expression (r1)* is L1, the Kleene

closure of the set as a set of words:


*
language(r1)* =L1
Regular Language
• A Regular Language is a formal language that can be expressed using a 
regular expression.
Formal Definition

1) The collection of regular languages over an alphabet Σ is defined


recursively as follows:
2) The empty language Ø is a regular language.
3) For each a ∈ Σ (a belongs to Σ), the singleton language {a} is a regular
language.
4) If A and B are regular languages,
then A ∪ B (union), A • B (concatenation), and A* (Kleene star) are
regular languages.
5) No other languages over Σ are regular.
Equivalent Properties
 

• It is the language of a regular expression (by the above


definition)
• It is the language accepted by a 
Nondeterministic Finite Automaton (NFA)
• It is the language accepted by a 
Deterministic Finite Automaton (DFA)
• It can be generated by a Regular Grammar
• It is the language accepted by an 
Alternating Finite Automaton
• It can be accepted by a read-only Turing Machine
END

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy