Title: Another NFA Example
1Another NFA Example
2Language accepted
(redundant state)
3Remarks
- The symbol never appears on the
- input tape
4- NFAs are interesting because we can
- express languages easier than DFAs
NFA
DFA
5Formal Definition of NFAs
Set of states, i.e.
Input aphabet, i.e.
Transition function
Initial state
Final states
6Transition Function
7(No Transcript)
8(No Transcript)
9(No Transcript)
10Extended Transition Function
11(No Transcript)
12(No Transcript)
13Formally
there is a walk from to with label
14The Language of an NFA
15 16 17 18 19Formally
- The language accepted by NFA is
- where
- and there is some
(final state)
20 21NFA accept Regular Languages
22Equivalence of FA
- Definition
- An FA is equivalent to FA
- if
- that is if both accept the same language.
23Example of equivalent FA
NFA
DFA
24We will prove
Languages accepted by NFA
Regular Languages
Languages accepted by DFA
That is, NFA and DFA have the same computation
power
25Step 1
Languages accepted by NFA
Regular Languages
Proof
Every DFA is trivially an NFA
Any language accepted by a DFA is also
accepted by an NFA
26Step 2
Languages accepted by NFA
Regular Languages
Any NFA can be converted into an equivalent DFA
Proof
Any language accepted by an NFA is also accepted
by a DFA
27Convert NFA to DFA
NFA
DFA
28Convert NFA to DFA
NFA
DFA
29Convert NFA to DFA
NFA
DFA
30Convert NFA to DFA
NFA
DFA
31Convert NFA to DFA
NFA
DFA
32Convert NFA to DFA
NFA
DFA
33Convert NFA to DFA
NFA
DFA
34NFA to DFA Remarks
- We are given an NFA
- We want to convert it
- into an equivalent DFA
- That is,
35- If the NFA has states
- Then the DFA has states in the powerset
-
36Procedure NFA to DFA
-
- 1. Initial state of NFA
-
- Initial state of DFA
37Example
NFA
DFA
38Procedure NFA to DFA
- 2. For every DFAs state
- Compute in the NFA
-
- Add the following transition to the DFA
39Example
NFA
DFA
40Procedure NFA to DFA
- Repeat step 2 for all symbols in the alphabet ?,
until no more transitions can be added.
41Example
NFA
DFA
42Procedure NFA to DFA
- 3. For any DFA state
- If some is a final state in the NFA
- Then,
- is a final state in the DFA
-
43Example
NFA
DFA
44Theorem
Take NFA
Apply the procedure to obtain DFA
Then, and are equivalent
45Proof
AND
46First we show
Take arbitrary string
We will prove
47(No Transcript)
48We will show that if
49More generally, we will show that if in
(arbitrary string)
50Proof by induction on
The basis case
51Induction hypothesis
52Induction Step
53Induction Step
54Therefore if
55We have shown
We also need to show
(proof is similar)