# Theory of Computation Nondeterministic Finite Automaton NFA An

- Slides: 89

Theory of Computation

Nondeterministic Finite Automaton (NFA) An NFA is a collection of three things 1) Finite states with one initial and some final states 2) Finite set of input letters (Σ) from which input strings are formed 3) Finite set of transitions, showing where to move if a letter is input at certain state, there may be more than one transition for certain letters and there may not be any transition for certain letters. 2

Observations The string is supposed to be accepted, if there exists at least one successful path, otherwise rejected. NFA can be considered to be an intermediate structure between FA and TG. 3

Example a 1 - a 2+ 3 a 4 b 5+ The above NFA accepts the language consisting of a and ab. 4

Example a, b 1 - a, b a 2 a 3+ The above NFA accepts the language of strings, defined over Σ = {a, b}, containing aa. 5

Non-determinism This refers to situations in which the next state of a computation is not uniquely determined by the current state. n In these situations we know only a range of possibilities n 6

Converting an FA to an equivalent NFA n If a language is accepted by an FA, then there exists a TG accepting that language(Kleene’s theorem). n Since, an NFA is also a TG, there exists an NFA accepting the language accepted by the given FA. In this case these FA and NFA are said to be equivalent to each others. 7

Example n Consider the following FA corresponding to (a+b)*b a b b n + a The above FA may be equivalent to the following NFA a, b - b + 8

Example n Consider the following FA b a n a, b b a 1 + The above FA may be equivalent to the following NFA a, b - a 1 a a, b + 9

Note n n Every FA can be considered to be an NFA, but the converse may not true. Every NFA can be considered to be a TG, but the converse may not true. 10

NFA to FA An NFA can be considered to be a TG, so a RE corresponding to the given NFA can be determined Again using Kleene’s theorem, an FA can be built corresponding to that RE. 11

2 Example b a 1 - 4+ b a 3 a 1 - 2 b b a 3 4+ b a a, b 12

Nondeterministic Finite Automaton (NFA) Cont… Alphabet = 13

Alphabet = Two choices 14

Alphabet = Two choices No transition 15

First Choice 16

First Choice 17

First Choice 18

First Choice All input is consumed “accept” 19

Second Choice 20

Second Choice 21

Second Choice No transition: the automaton hangs 22

Second Choice Input cannot be consumed “reject” 23

An NFA accepts a string: if there is a computation of the NFA that accepts the string i. e. , all the input is consumed and the automaton is in an accepting state 24

Example is accepted by the NFA: “accept” because this computation accepts “reject” 25

Rejection example 26

First Choice 27

First Choice “reject” 28

Second Choice 29

Second Choice 30

Second Choice “reject” 31

Example is rejected by the NFA: “reject” All possible computations lead to rejection 32

Rejection example 33

First Choice 34

First Choice No transition: the automaton hangs 35

First Choice Input cannot be consumed “reject” 36

Second Choice 37

Second Choice 38

Second Choice No transition: the automaton hangs 39

Second Choice Input cannot be consumed “reject” 40

is rejected by the NFA: “reject” All possible computations lead to rejection 41

Language accepted: 42

Lambda Transitions 43

44

45

(read head does not move) 46

47

all input is consumed “accept” String is accepted 48

Rejection Example 49

50

(read head doesn’t move) 51

No transition: the automaton hangs 52

Input cannot be consumed “reject” String is rejected 53

Language accepted: 54

Another NFA Example 55

56

57

58

“accept” 59

Another String 60

61

62

63

64

65

66

“accept” 67

Language accepted 68

Another NFA Example 69

Language accepted (redundant state) 70

Remarks: • The symbol never appears on the input state • Simple automata: 71

• NFAs are interesting because we can express languages easier than DFAs NFA DFA 72

Formal Definition of NFAs n Set of states, i. e. Input aplhabet, i. e. Transition function Initial state Accepting states 73

Transition Function 74

75

76

77

Extended Transition Function 78

79

80

We will prove: Languages accepted by NFAs Regular Languages accepted by DFAs 81

NFA Convert NFA to DFA 82

Convert NFA to DFA NFA DFA 83

Convert NFA to DFA NFA n DFA 84

Convert NFA to DFA NFA n DFA 85

Convert NFA to DFA NFA n DFA 86

Convert NFA to DFA NFA n DFA 87

Convert NFA to DFA NFA n DFA 88

Thank You! 89

- Moore machine
- Deterministic finite automata adalah
- Nfa theory of computation
- Finite automata
- Dtm turing machine
- An introduction to formal languages and automata
- Convert nfa to dfa
- Nondeterministic
- Nondeterministic pushdown automata
- Non finite subordinate clause
- Finite verb
- Learning objectives of non finite verbs
- Finite and non-finite verb
- Finite and non finite
- Suffix automaton
- Linear bounded automata example
- Eksekusi
- Hybrid automaton
- Union set operation
- 2160704
- Transition graph in theory of computation
- Theory of machines
- Theory of computation
- Theory of computation
- Automata calculator
- Is etm recognizable
- Diagonalization method in theory of computation
- Anbn pda
- Theory of computation quiz
- Computation
- The theory of computation
- Theory of computation
- Who is not subject to withholding tax on compensation
- Expanded withholding tax computation
- Expanded withholding tax computation
- Expanded withholding tax computation
- Fertilizer computation philrice
- Eecs 1019
- Nolco and mcit illustration
- Income tax computation format
- Pediatric dehydration fluid replacement formula
- Efilingofincometax
- Data cube computation
- Drug calculation formula
- Data cube computation
- Data cube computation
- How to calculate iv flow rate
- Cuts of a distributed computation
- Expanded withholding tax revenue regulation
- Net maintainable rent
- Board feet calculator
- The pagerank citation ranking bringing order to the web
- The pagerank citation ranking: bringing order to the web
- The pagerank citation ranking: bringing order to the web
- Binary search in secure computation
- Computation symbols
- Supplementary rate in overheads
- Media computation
- Types of error in numerical methods
- Pagerank computation
- Computation examples
- Pda vs npda
- The purpose of computation is insight not numbers
- Privacy-enhancing computation
- Ram model of computation
- Direct computation
- Common lisp: a gentle introduction to symbolic computation
- Personal tutor ucl
- Multiparty computation
- Two round multiparty computation via multi-key fhe
- Computation structures
- Umut acar
- Secure multiparty computation
- Pmpl cis
- Fertilizer production
- Fertilizer computation
- Computation history
- Malignant htn
- Verifiable computation
- Computation history
- Computation examples
- Fertilizer computation
- Drip calculation
- Different computing paradigms
- What is differential levelling
- Dumas method formula
- Hexa to octal
- Mcit computation
- Luis von ahn human computation
- Parabon computation