Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)

Similar presentations


Presentation on theme: "Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)"— Presentation transcript:

1 Fall 2004COMP 3351 Another NFA Example

2 Fall 2004COMP 3352 Language accepted (redundant state)

3 Fall 2004COMP 3353 Remarks: The symbol never appears on the input tape Simple automata:

4 Fall 2004COMP 3354 NFA DFA NFAs are interesting because we can express languages easier than DFAs

5 Fall 2004COMP 3355 Formal Definition of NFAs Set of states, i.e. Input aphabet, i.e. Transition function Initial state Final states

6 Fall 2004COMP 3356 Transition Function

7 Fall 2004COMP 3357

8 Fall 2004COMP 3358

9 Fall 2004COMP 3359

10 Fall 2004COMP 33510 Extended Transition Function

11 Fall 2004COMP 33511

12 Fall 2004COMP 33512

13 Fall 2004COMP 33513 Formally : there is a walk from to with label

14 Fall 2004COMP 33514 The Language of an NFA

15 Fall 2004COMP 33515

16 Fall 2004COMP 33516

17 Fall 2004COMP 33517

18 Fall 2004COMP 33518

19 Fall 2004COMP 33519 Formally The language accepted by NFA is: where and there is some (final state)

20 Fall 2004COMP 33520

21 Fall 2004COMP 33521 NFA accept Regular Languages

22 Fall 2004COMP 33522 Equivalence of FA Definition: An FA is equivalent to FA if that is if both accept the same language.

23 Fall 2004COMP 33523 Example of equivalent FA NFA DFA

24 Fall 2004COMP 33524 We will prove: Languages accepted by NFA Regular Languages That is, NFA and DFA have the same computation power Languages accepted by DFA

25 Fall 2004COMP 33525 Languages accepted by NFA Regular Languages Step 1 Proof: Every DFA is trivially an NFA Any language accepted by a DFA is also accepted by an NFA

26 Fall 2004COMP 33526 Languages accepted by NFA Regular Languages Step 2 Proof: Any NFA can be converted into an equivalent DFA Any language accepted by an NFA is also accepted by a DFA

27 Fall 2004COMP 33527 Convert NFA to DFA NFA DFA

28 Fall 2004COMP 33528 Convert NFA to DFA NFA DFA

29 Fall 2004COMP 33529 Convert NFA to DFA NFA DFA

30 Fall 2004COMP 33530 Convert NFA to DFA NFA DFA

31 Fall 2004COMP 33531 Convert NFA to DFA NFA DFA

32 Fall 2004COMP 33532 Convert NFA to DFA NFA DFA

33 Fall 2004COMP 33533 Convert NFA to DFA NFA DFA

34 Fall 2004COMP 33534 NFA to DFA: Remarks We are given an NFA We want to convert it into an equivalent DFA That is,

35 Fall 2004COMP 33535 If the NFA has states Then the DFA has states in the powerset

36 Fall 2004COMP 33536 Procedure NFA to DFA 1. Initial state of NFA: Initial state of DFA:

37 Fall 2004COMP 33537 Example NFA DFA

38 Fall 2004COMP 33538 Procedure NFA to DFA 2. For every DFA’s state Compute in the NFA Add the following transition to the DFA

39 Fall 2004COMP 33539 Example NFA DFA

40 Fall 2004COMP 33540 Procedure NFA to DFA Repeat step 2 for all symbols in the alphabet ∑, until no more transitions can be added.

41 Fall 2004COMP 33541 Example NFA DFA

42 Fall 2004COMP 33542 Procedure 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

43 Fall 2004COMP 33543 Example NFA DFA

44 Fall 2004COMP 33544 Theorem Take NFA Apply the procedure to obtain DFA Then, and are equivalent:

45 Fall 2004COMP 33545 Proof AND

46 Fall 2004COMP 33546 First we show: Take arbitrary string : We will prove:

47 Fall 2004COMP 33547

48 Fall 2004COMP 33548 We will show that if

49 Fall 2004COMP 33549 More generally, we will show that if in : (arbitrary string)

50 Fall 2004COMP 33550 Proof by induction on The basis case:

51 Fall 2004COMP 33551 Induction hypothesis:

52 Fall 2004COMP 33552 Induction Step:

53 Fall 2004COMP 33553 Induction Step:

54 Fall 2004COMP 33554 Therefore if

55 Fall 2004COMP 33555 We have shown: We also need to show: (proof is similar)


Download ppt "Fall 2004COMP 3351 Another NFA Example. Fall 2004COMP 3352 Language accepted (redundant state)"

Similar presentations


Ads by Google