Presentation is loading. Please wait.

Presentation is loading. Please wait.

Courtesy Costas Busch - RPI1 Non Deterministic Automata.

Similar presentations


Presentation on theme: "Courtesy Costas Busch - RPI1 Non Deterministic Automata."— Presentation transcript:

1 Courtesy Costas Busch - RPI1 Non Deterministic Automata

2 Courtesy Costas Busch - RPI2 Alphabet = Nondeterministic Finite Accepter (NFA)

3 Courtesy Costas Busch - RPI3 Two choices Alphabet = Nondeterministic Finite Accepter (NFA)

4 Courtesy Costas Busch - RPI4 No transition Two choices No transition Alphabet = Nondeterministic Finite Accepter (NFA)

5 Courtesy Costas Busch - RPI5 First Choice

6 Courtesy Costas Busch - RPI6 First Choice

7 Courtesy Costas Busch - RPI7 First Choice

8 Courtesy Costas Busch - RPI8 “accept” First Choice All input is consumed

9 Courtesy Costas Busch - RPI9 Second Choice

10 Courtesy Costas Busch - RPI10 Second Choice

11 Courtesy Costas Busch - RPI11 Second Choice No transition: the automaton hangs

12 Courtesy Costas Busch - RPI12 Second Choice “reject” Input cannot be consumed

13 Courtesy Costas Busch - RPI13 An NFA accepts a string: when there is a computation of the NFA that accepts the string all the input is consumed and the automaton is in a final state AND

14 Courtesy Costas Busch - RPI14 Example is accepted by the NFA: “accept” “reject” because this computation accepts

15 Courtesy Costas Busch - RPI15 Rejection example

16 Courtesy Costas Busch - RPI16 First Choice

17 Courtesy Costas Busch - RPI17 First Choice “reject”

18 Courtesy Costas Busch - RPI18 Second Choice

19 Courtesy Costas Busch - RPI19 Second Choice

20 Courtesy Costas Busch - RPI20 Second Choice “reject”

21 Courtesy Costas Busch - RPI21 An NFA rejects a string: when there is no computation of the NFA that accepts the string: All the input is consumed and the automaton is in a non final state The input cannot be consumed OR

22 Courtesy Costas Busch - RPI22 Example is rejected by the NFA: “reject” All possible computations lead to rejection

23 Courtesy Costas Busch - RPI23 Rejection example

24 Courtesy Costas Busch - RPI24 First Choice

25 Courtesy Costas Busch - RPI25 First Choice No transition: the automaton hangs

26 Courtesy Costas Busch - RPI26 “reject” First Choice Input cannot be consumed

27 Courtesy Costas Busch - RPI27 Second Choice

28 Courtesy Costas Busch - RPI28 Second Choice

29 Courtesy Costas Busch - RPI29 Second Choice No transition: the automaton hangs

30 Courtesy Costas Busch - RPI30 Second Choice “reject” Input cannot be consumed

31 Courtesy Costas Busch - RPI31 is rejected by the NFA: “reject” All possible computations lead to rejection

32 Courtesy Costas Busch - RPI32 Language accepted:

33 Courtesy Costas Busch - RPI33 Lambda Transitions

34 Courtesy Costas Busch - RPI34

35 Courtesy Costas Busch - RPI35

36 Courtesy Costas Busch - RPI36 (read head does not move)

37 Courtesy Costas Busch - RPI37

38 Courtesy Costas Busch - RPI38 “accept” String is accepted all input is consumed

39 Courtesy Costas Busch - RPI39 Rejection Example

40 Courtesy Costas Busch - RPI40

41 Courtesy Costas Busch - RPI41 (read head doesn’t move)

42 Courtesy Costas Busch - RPI42 No transition: the automaton hangs

43 Courtesy Costas Busch - RPI43 “reject” String is rejected Input cannot be consumed

44 Courtesy Costas Busch - RPI44 Language accepted:

45 Courtesy Costas Busch - RPI45 Another NFA Example

46 Courtesy Costas Busch - RPI46

47 Courtesy Costas Busch - RPI47

48 Courtesy Costas Busch - RPI48

49 Courtesy Costas Busch - RPI49 “accept”

50 Courtesy Costas Busch - RPI50 Another String

51 Courtesy Costas Busch - RPI51

52 Courtesy Costas Busch - RPI52

53 Courtesy Costas Busch - RPI53

54 Courtesy Costas Busch - RPI54

55 Courtesy Costas Busch - RPI55

56 Courtesy Costas Busch - RPI56

57 Courtesy Costas Busch - RPI57 “accept”

58 Courtesy Costas Busch - RPI58 Language accepted

59 Courtesy Costas Busch - RPI59 Another NFA Example

60 Courtesy Costas Busch - RPI60 Language accepted (redundant state)

61 Courtesy Costas Busch - RPI61 Remarks: The symbol never appears on the input tape Simple automata:

62 Courtesy Costas Busch - RPI62 NFA DFA NFAs are interesting because we can express languages easier than DFAs

63 Courtesy Costas Busch - RPI63 Formal Definition of NFAs Set of states, i.e. Input aplhabet, i.e. Transition function Initial state Final states

64 Courtesy Costas Busch - RPI64 Transition Function

65 Courtesy Costas Busch - RPI65

66 Courtesy Costas Busch - RPI66

67 Courtesy Costas Busch - RPI67

68 Courtesy Costas Busch - RPI68 Extended Transition Function

69 Courtesy Costas Busch - RPI69

70 Courtesy Costas Busch - RPI70

71 Courtesy Costas Busch - RPI71 Formally : there is a walk from to with label

72 Courtesy Costas Busch - RPI72

73 73 Inductive Definition Basis: Induction: Suppose w = x a. Also Let Then

74 Courtesy Costas Busch - RPI74 The Language of an NFA

75 Courtesy Costas Busch - RPI75

76 Courtesy Costas Busch - RPI76

77 Courtesy Costas Busch - RPI77

78 Courtesy Costas Busch - RPI78

79 Courtesy Costas Busch - RPI79 Formally The language accepted by NFA is: where and there is some (final state)

80 Courtesy Costas Busch - RPI80

81 Courtesy Costas Busch - RPI81 NFAs accept the Regular Languages

82 Courtesy Costas Busch - RPI82 Equivalence of Machines Definition for Automata: Machine is equivalent to machine if

83 Courtesy Costas Busch - RPI83 Example of equivalent machines NFA DFA

84 Courtesy Costas Busch - RPI84 We will prove: Languages accepted by NFAs Regular Languages NFAs and DFAs have the same computation power Languages accepted by DFAs

85 Courtesy Costas Busch - RPI85 Languages accepted by NFAs Regular Languages Step 1 Proof: Every DFA is trivially an NFA Any language accepted by a DFA is also accepted by an NFA

86 Courtesy Costas Busch - RPI86 Languages accepted by NFAs Regular Languages Step 2 Proof: Any NFA can be converted to an equivalent DFA Any language accepted by an NFA is also accepted by a DFA

87 Courtesy Costas Busch - RPI87 Convert NFA to DFA NFA DFA

88 Courtesy Costas Busch - RPI88 Convert NFA to DFA NFA DFA

89 Courtesy Costas Busch - RPI89 Convert NFA to DFA NFA DFA

90 Courtesy Costas Busch - RPI90 Convert NFA to DFA NFA DFA

91 Courtesy Costas Busch - RPI91 Convert NFA to DFA NFA DFA

92 Courtesy Costas Busch - RPI92 Convert NFA to DFA NFA DFA

93 Courtesy Costas Busch - RPI93 Convert NFA to DFA NFA DFA

94 Courtesy Costas Busch - RPI94 NFA to DFA: Remarks We are given an NFA We want to convert it to an equivalent DFA With

95 Courtesy Costas Busch - RPI95 If the NFA has n states the DFA has 2 n states in the power set of Q N i.e.

96 Courtesy Costas Busch - RPI96 Procedure NFA to DFA 1. Initial state of NFA: Initial state of DFA:

97 Courtesy Costas Busch - RPI97 Example NFA DFA

98 Courtesy Costas Busch - RPI98 Procedure NFA to DFA 2. For every DFA’s state Compute in the NFA Add transition to DFA

99 Courtesy Costas Busch - RPI99 Exampe NFA DFA

100 Courtesy Costas Busch - RPI100 Procedure NFA to DFA Repeat Step 2 for all letters in alphabet, until no more transitions can be added.

101 Courtesy Costas Busch - RPI101 Example NFA DFA

102 Courtesy Costas Busch - RPI102 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

103 Courtesy Costas Busch - RPI103 Example NFA DFA

104 Courtesy Costas Busch - RPI104 Theorem Take NFA Apply procedure to obtain DFA Then and are equivalent :

105 Courtesy Costas Busch - RPI105 Proof AND

106 Courtesy Costas Busch - RPI106 First we show: Take arbitrary: We will prove:

107 Courtesy Costas Busch - RPI107

108 Courtesy Costas Busch - RPI108 We will show that if

109 Courtesy Costas Busch - RPI109 More generally, we will show that if in : (arbitrary string)

110 Courtesy Costas Busch - RPI110 Proof by induction on Induction Basis:

111 Courtesy Costas Busch - RPI111 Induction hypothesis:

112 Courtesy Costas Busch - RPI112 Induction Step:

113 Courtesy Costas Busch - RPI113 Induction Step:

114 Courtesy Costas Busch - RPI114 Therefore if

115 Courtesy Costas Busch - RPI115 We have shown: We also need to show: (proof is similar)


Download ppt "Courtesy Costas Busch - RPI1 Non Deterministic Automata."

Similar presentations


Ads by Google