# 1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)

## Presentation on theme: "1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)"— Presentation transcript:

1 Non Deterministic Automata

2 Alphabet = Nondeterministic Finite Accepter (NFA)

3 Two choices Alphabet = Nondeterministic Finite Accepter (NFA)

4 No transition Two choices No transition Alphabet = Nondeterministic Finite Accepter (NFA)

5 First Choice

6

7

8 “accept” First Choice

9 Second Choice

10 Second Choice

11 Second Choice No transition: the automaton hangs

12 Second Choice “reject”

13 Observation An NFA accepts a string if there is a computation of the NFA that accepts the string

14 Example is accepted by the NFA:

15 Lambda Transitions

16

17

19

20 “accept” String is accepted

21 Language accepted:

22 Another NFA Example

23

24

25

26 “accept”

27 Another String

28

29

30

31

32

33

34 “accept”

35 Language accepted

36 Another NFA Example

37 Language accepted

38 Formal Definition of NFAs Set of states, i.e. Input aplhabet, i.e. Transition function Initial state Final states

39 Transition Function

40

41

42

43 Extended Transition Function

44

45

46 Formally It holds if and only if there is a walk from to with label

47 The Language of an NFA

48

49

50

51

52 Formally The language accepted by NFA is: where and there is some (final state)

53

54 Equivalence of NFAs and DFAs

55 Equivalence of Machines For DFAs or NFAs: Machine is equivalent to machine if

56 Example NFA DFA

57 Since machines and are equivalent DFA NFA

58 Equivalence of NFAs and DFAs Question: NFAs = DFAs ? Same power? Accept the same languages?

59 Equivalence of NFAs and DFAs Question: NFAs = DFAs ? Same power? Accept the same languages? YES!

60 We will prove: Languages accepted by NFAs Languages accepted by DFAs

61 We will prove: Languages accepted by NFAs Languages accepted by DFAs NFAs and DFAs have the same computation power

62 Languages accepted by NFAs Languages accepted by DFAs Step 1

63 Languages accepted by NFAs Languages accepted by DFAs Step 1 Proof: Every DFA is also an NFA

64 Languages accepted by NFAs Languages accepted by DFAs Step 1 Proof: Every DFA is also an NFA A language accepted by a DFA is also accepted by an NFA

65 Languages accepted by NFAs Languages accepted by DFAs Step 2

66 Languages accepted by NFAs Languages accepted by DFAs Step 2 Proof: Any NFA can be converted to an equivalent DFA

67 Languages accepted by NFAs Languages accepted by DFAs Step 2 Proof: Any NFA can be converted to an equivalent DFA A language accepted by an NFA is also accepted by a DFA

68 NFA to DFA NFA DFA

69 NFA to DFA NFA DFA

70 NFA to DFA NFA DFA

71 NFA to DFA NFA DFA

72 NFA to DFA NFA DFA

73 NFA to DFA NFA DFA

74 NFA to DFA NFA DFA

75 NFA to DFA: Remarks We are given an NFA We want to convert it to an equivalent DFA With

76 If the NFA has states the DFA has states in the powerset

77 Procedure NFA to DFA 1. Initial state of NFA: Initial state of DFA:

78 Example NFA DFA

79 Procedure NFA to DFA 2. For every DFA’s state Compute in the NFA Add transition

80 Exampe NFA DFA

81 Procedure NFA to DFA Repeat Step 2 for all letters in alphabet, until no more transitions can be added.

82 Example NFA DFA

83 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

84 Example NFA DFA

85 Theorem Take NFA Apply procedure to obtain DFA Then and are equivalent :

86 Finally We have proven Languages accepted by NFAs Languages accepted by DFAs

87 Languages accepted by NFAs Languages accepted by DFAs We have proven Regular Languages

88 Languages accepted by NFAs Languages accepted by DFAs We have proven Regular Languages

Download ppt "1 Non Deterministic Automata. 2 Alphabet = Nondeterministic Finite Accepter (NFA)"

Similar presentations