1 NFAs accept the Regular Languages
2 Equivalence of Machines Definition: Machine is equivalent to machine if
3 Example of equivalent machines NFA FA
4 We will prove: Languages accepted by NFAs Regular Languages NFAs and FAs have the same computation power Languages accepted by FAs
5 Languages accepted by NFAs Regular Languages accepted by NFAs Regular Languages We will show:
6 Languages accepted by NFAs Regular Languages Proof-Step 1 Proof: Every FA is trivially an NFA Any language accepted by a FA is also accepted by an NFA
7 Languages accepted by NFAs Regular Languages Proof-Step 2 Proof: Any NFA can be converted to an equivalent FA Any language accepted by an NFA is also accepted by a FA
8 Convert NFA to FA NFA FA
9 Convert NFA to FA NFA FA
10 Convert NFA to FA NFA FA
11 Convert NFA to FA NFA FA
12 Convert NFA to FA NFA FA
13 Convert NFA to FA NFA FA
14 Convert NFA to FA NFA FA
15 NFA to FA: Remarks We are given an NFA We want to convert it to an equivalent FA With
16 If the NFA has states the FA has states in the powerset
17 Procedure NFA to FA 1. Initial state of NFA: Initial state of FA:
18 Example NFA FA
19 Procedure NFA to FA 2. For every FA’s state Compute in the NFA Add transition to FA
20 Exampe NFA FA
21 Procedure NFA to FA Repeat Step 2 for all letters in alphabet, until no more transitions can be added.
22 Example NFA FA
23 Procedure NFA to FA 3. For any FA state If is accepting state in NFA Then, is accepting state in FA
24 Example NFA FA
25 Theorem Take NFA Apply procedure to obtain FA Then and are equivalent :
26 Proof AND
27 First we show: Take arbitrary: We will prove:
28
29 denotes
30 We will show that if then
31 More generally, we will show that if in : (arbitrary string) then
32 Proof by induction on Induction Basis: Is true by construction of
33 Induction hypothesis:
34 Induction Step:
35 Induction Step:
36 Therefore if then
37 We have shown: We also need to show: (proof is similar)
38 Single Accepting State for NFAs
39 Any NFA can be converted to an equivalent NFA with a single accepting state
40 NFA Equivalent NFA Example
41 NFA In General Equivalent NFA Single accepting state
42 Extreme Case NFA without accepting state Add an accepting state without transitions
43 Properties of Regular Languages
44 Concatenation: Star: Union: Are regular Languages For regular languages and we will prove that: Complement: Intersection: Reversal:
45 We say: Regular languages are closed under Concatenation: Star: Union: Complement: Intersection: Reversal:
46 Regular language Single accepting state NFA Single aceepting state Regular language NFA
47 Example
48 Union NFA for
49 Example NFA for
50 Concatenation NFA for
51 Example NFA for
52 Star Operation NFA for
53 Example NFA for
54 Reverse NFA for 1. Reverse all transitions 2. Make initial state accepting state and vice versa
55 Example
56 Complement 1. Take the FA that accepts 2. Make final states non-final, and vice-versa
57 Example
58 Intersection regular We show regular
59 DeMorgan’s Law: regular
60 Example regular
61 for FA Construct a new FA that accepts Machine simulates in parallel and Another Proof for Intersection Closure
62 States in State in
63 transition FA transition FA
64 initial state Initial state FA
65 accept state accept states FA Both constituents must be accepting states
66 Example:
67 Automaton for intersection
68 simulates in parallel and accepts stringif and only if accepts string and accepts string