0% found this document useful (0 votes)
3 views

lec-2

The lecture covers nondeterminism in finite automata, demonstrating that NFAs and DFAs are equivalent in power. It discusses closure properties for regular languages, including closure under union, concatenation, and Kleene star, along with proofs for each. Additionally, it explains the conversion of regular expressions to NFAs, reinforcing the relationship between these concepts.

Uploaded by

rsrmmit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

lec-2

The lecture covers nondeterminism in finite automata, demonstrating that NFAs and DFAs are equivalent in power. It discusses closure properties for regular languages, including closure under union, concatenation, and Kleene star, along with proofs for each. Additionally, it explains the conversion of regular expressions to NFAs, reinforcing the relationship between these concepts.

Uploaded by

rsrmmit
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Lecture 2

Last time:
- Finite automata, regular languages
- Regular operations
- Regular expressions
- Closure under

Today:
- Nondeterminism
- Closure under and
- Regular expressions → finite automata
Goal: Show finite automata equivalent to regular expressions

1
Closure Properties for Regular Languages
Theorem: If are regular languages, so is (closure under )
Recall proof attempt: Let recognize
recognize
Construct recognizing

𝑀1 𝑀2

should accept input


if where
accepts and accepts .
𝑀
𝑤
𝑥 𝑦
Doesn’t work: Where to split ?
Hold off. Need new concept.

3
Nondeterministic Finite Automata(NFA)
𝑁1 a a
b a,ε
𝑞1 𝑞2 𝑞3 𝑞4
b

New features of nondeterminism:


- multiple paths possible (0, 1 or many at each step)
- ε-transition is a “free” move without reading input
- Accept input if some path leads to accept
Check-in 2.1
Example inputs:
- ab accept What does do on input aab
Nondeterminism ?
doesn’t
- aa reject (a) Accept
correspond to a physical
- aba accept (b)machine
Reject
- abb reject
we can build.
(c) Both Accept and
However, Reject
it is useful Check-in 2.1

4mathematically.
NFA – Formal Definition
𝑁1 a a
b a,ε
𝑞1 𝑞2 𝑞3 𝑞4
b

Defn: A nondeterministic finite automaton (NFA)


is a 5-tuple a
Ways to think about
sta alp tran sta cce
tes ha siti rt s pt
be o ta st
t n f te ate
nondeterminism:
un s
cti
on Computational: Fork new parallel
- all same as before except thread and accept if any thread
- leads to an accept state.
power set
Σ ∪{ε } Mathematical: Tree with
- In the example: branches.
Accept if any branch leads to an
accept state.
5
Magical: Guess at each
Converting NFAs to DFAs
Theorem: If an NFA recognizes then is regular
Proof: Let NFA recognize
Construct DFA recognizing
(Ignore the ε-transitions, can easily modify to handle them)
ID E A : D FA keeps track of the subset of possible states in
NFA .
Check-in 2.2
𝑀 𝑀′ Construction of :
If has states,
𝑞 3 how many
states does have by this
construction? , for some
(a)
𝑞7
(b)
(c) intersects
NFA DFA
Check-in 2.2
6
Return to Closure Properties
Recall Theorem: If are regular languages, so is
(The class of regular languages is closed under
union)
New Proof (sketch): Given DFAs and recognizing
and
𝑀 𝑀1 Construct NFA recognizing
Nondetermini
sm
ε parallelism
vs
𝑀2 guessing
ε

7
Closure under (concatenation)
Theorem: If are regular languages, so is
Proof sketch: Given DFAs and recognizing and
Construct NFA recognizing

𝑀
𝑀1 𝑀2
ε
should accept input
ε if where
accepts and accepts .

𝑤=¿ 𝑥 𝑦
Nondeterministic has the option to
jump to when accepts.

8
Closure under (star/kleen)
Theorem: If is a regular language, so is
Proof sketch: Given DFA recognizing
Construct NFA recognizing

𝑀′
Check-in 2.3
𝑀 ε should accept input
ε If has states,
if how many states does
ε
have bywhere
this construction?
and accepts each
(a)
(b) 𝑤=¿
𝑥1 𝑥 2 𝑥 3 𝑥4
Make sure accepts ε (c)

9
Regular Expressions NFA
Theorem: If is a regular expr and then is regular
Proof: Convert to equivalent NFA :

If is atomic: Equivalent is:


𝑎 Example:
for
Convert to equivalent NFA
: a
: b
: a ε b
If is composite:

}
: ε a
Use closure constructions ε a ε b
:
a ε
ε ε a ε b
ε
10 ε
Quick review of today

1. Nondeterministic fi nite automata (NFA)


2. Proved: NFA and DFA are equivalent in power
3. Proved: Class of regular languages is closed
under
4. Conversion of regular expressions to NFA

Check-in 2.4

11

You might also like