Lecture 6 Nondeterministic Finite Automata NFA NFA tape
![Lecture 6 Nondeterministic Finite Automata (NFA) Lecture 6 Nondeterministic Finite Automata (NFA)](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-1.jpg)
![NFA tape head Finite Control NFA tape head Finite Control](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-2.jpg)
![a l p h a b e t The tape is divided into finitely a l p h a b e t The tape is divided into finitely](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-3.jpg)
![a • The head scans at a cell on the tape and can read a • The head scans at a cell on the tape and can read](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-4.jpg)
![• The finite control has finitely many states which form a set Q. • The finite control has finitely many states which form a set Q.](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-5.jpg)
![a q a p p=p 1 or p 2 • δ(q, a) = {p a q a p p=p 1 or p 2 • δ(q, a) = {p](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-6.jpg)
![a a q p p=p 1 or p 2 • δ(q, ε) = {p a a q p p=p 1 or p 2 • δ(q, ε) = {p](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-7.jpg)
![a ? q • δ(q, a) = Φ means that the NFA is stuck. a ? q • δ(q, a) = Φ means that the NFA is stuck.](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-8.jpg)
![s • There are some special states: an initial state s and a final s • There are some special states: an initial state s and a final](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-9.jpg)
![x h • When the head gets off the tape, the NFA stops. An x h • When the head gets off the tape, the NFA stops. An](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-10.jpg)
![• The NTM can be represented by M = (Q, Σ, δ, s, • The NTM can be represented by M = (Q, Σ, δ, s,](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-11.jpg)
![• The transition diagram of a NFA is an alternative way to represent • The transition diagram of a NFA is an alternative way to represent](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-12.jpg)
![δ s p q 0 p, s q q 1 s s 0, 1 δ s p q 0 p, s q q 1 s s 0, 1](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-13.jpg)
![Theorem 1 • Every regular language can be accepted by an NFA. Theorem 1 • Every regular language can be accepted by an NFA.](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-14.jpg)
![G(r) • For each regular expression r, we can construct a digraph G(r) with G(r) • For each regular expression r, we can construct a digraph G(r) with](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-15.jpg)
![](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-16.jpg)
![](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-17.jpg)
![](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-18.jpg)
![• • • (01+111)* (01)*(111)* 10(0+1)*00 10(0+1)*+(0+1)*00 ((01)*(10)*0*)* • • • (01+111)* (01)*(111)* 10(0+1)*00 10(0+1)*+(0+1)*00 ((01)*(10)*0*)*](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-19.jpg)
![10(0+1)*+(0+1)*00 10(0+1)*00 1 0 (0+1)* 0, 1 (0+1)* 0 0, 1 1 ε 0 10(0+1)*+(0+1)*00 10(0+1)*00 1 0 (0+1)* 0, 1 (0+1)* 0 0, 1 1 ε 0](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-20.jpg)
![(0+1)*0(0+1) 5 0, 1 0 0 0 1 0 1 1 (0+1)*0(0+1) 5 0, 1 0 0 0 1 0 1 1](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-21.jpg)
![R Given an NFA M, construct an NFA accepting L(M). 0 ε 0 1 R Given an NFA M, construct an NFA accepting L(M). 0 ε 0 1](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-22.jpg)
![Given an NFA M, construct an NFA accepting L(M). Is it correct? 0 0 Given an NFA M, construct an NFA accepting L(M). Is it correct? 0 0](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-23.jpg)
- Slides: 23
![Lecture 6 Nondeterministic Finite Automata NFA Lecture 6 Nondeterministic Finite Automata (NFA)](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-1.jpg)
Lecture 6 Nondeterministic Finite Automata (NFA)
![NFA tape head Finite Control NFA tape head Finite Control](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-2.jpg)
NFA tape head Finite Control
![a l p h a b e t The tape is divided into finitely a l p h a b e t The tape is divided into finitely](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-3.jpg)
a l p h a b e t The tape is divided into finitely many cells. Each cell contains a symbol in an alphabet Σ.
![a The head scans at a cell on the tape and can read a • The head scans at a cell on the tape and can read](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-4.jpg)
a • The head scans at a cell on the tape and can read a symbol on the cell. In each move, the head move to the right cell or stop there (in a ε-move).
![The finite control has finitely many states which form a set Q • The finite control has finitely many states which form a set Q.](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-5.jpg)
• The finite control has finitely many states which form a set Q. For each move, the state is changed according to the evaluation of a transition function Q δ : Q x (Σ U {ε}) → 2 (the family of all subsets of Q)
![a q a p pp 1 or p 2 δq a p a q a p p=p 1 or p 2 • δ(q, a) = {p](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-6.jpg)
a q a p p=p 1 or p 2 • δ(q, a) = {p 1, p 2} for a in Σ means that if the head reads symbol a and the finite control is in the state q, then the next state should be p 1 or p 2, and the head moves one cell to the right.
![a a q p pp 1 or p 2 δq ε p a a q p p=p 1 or p 2 • δ(q, ε) = {p](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-7.jpg)
a a q p p=p 1 or p 2 • δ(q, ε) = {p 1, p 2} means that if the finite control is in the state q, then the next state can be be p 1 or p 2, and the head does not move. This move is called a ε-move.
![a q δq a Φ means that the NFA is stuck a ? q • δ(q, a) = Φ means that the NFA is stuck.](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-8.jpg)
a ? q • δ(q, a) = Φ means that the NFA is stuck.
![s There are some special states an initial state s and a final s • There are some special states: an initial state s and a final](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-9.jpg)
s • There are some special states: an initial state s and a final set F of final states. • Initially, the NTM is in the initial state s and the head scans the leftmost cell. The tape holds an input string.
![x h When the head gets off the tape the NFA stops An x h • When the head gets off the tape, the NFA stops. An](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-10.jpg)
x h • When the head gets off the tape, the NFA stops. An input string x is accepted by the NFA if there is a computation path to make the NFA stop at a final state. • Otherwise, the input string is rejected.
![The NTM can be represented by M Q Σ δ s • The NTM can be represented by M = (Q, Σ, δ, s,](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-11.jpg)
• The NTM can be represented by M = (Q, Σ, δ, s, F) where Σ is the alphabet of input symbols. • The set of all strings accepted by a NFA M is denoted by L(M). We also say that the language L(M) is accepted by M.
![The transition diagram of a NFA is an alternative way to represent • The transition diagram of a NFA is an alternative way to represent](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-12.jpg)
• The transition diagram of a NFA is an alternative way to represent the DFA. • For M = (Q, Σ, δ, s, F), the transition diagram of M is a symbol-labeled digraph G=(V, E) satisfying the following: V = Q (s = E={q a , f= for f in F) p | p in δ(q, a)}.
![δ s p q 0 p s q q 1 s s 0 1 δ s p q 0 p, s q q 1 s s 0, 1](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-13.jpg)
δ s p q 0 p, s q q 1 s s 0, 1 s ε q 0 0 1 0 p q ε
![Theorem 1 Every regular language can be accepted by an NFA Theorem 1 • Every regular language can be accepted by an NFA.](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-14.jpg)
Theorem 1 • Every regular language can be accepted by an NFA.
![Gr For each regular expression r we can construct a digraph Gr with G(r) • For each regular expression r, we can construct a digraph G(r) with](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-15.jpg)
G(r) • For each regular expression r, we can construct a digraph G(r) with edges labeled by symbols and ε as follows. • If r=Φ, then • If r≠Φ, then
![](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-16.jpg)
![](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-17.jpg)
![](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-18.jpg)
![01111 01111 100100 10010100 01100 • • • (01+111)* (01)*(111)* 10(0+1)*00 10(0+1)*+(0+1)*00 ((01)*(10)*0*)*](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-19.jpg)
• • • (01+111)* (01)*(111)* 10(0+1)*00 10(0+1)*+(0+1)*00 ((01)*(10)*0*)*
![10010100 100100 1 0 01 0 1 01 0 0 1 1 ε 0 10(0+1)*+(0+1)*00 10(0+1)*00 1 0 (0+1)* 0, 1 (0+1)* 0 0, 1 1 ε 0](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-20.jpg)
10(0+1)*+(0+1)*00 10(0+1)*00 1 0 (0+1)* 0, 1 (0+1)* 0 0, 1 1 ε 0 0 ε ε 0
![01001 5 0 1 0 0 0 1 0 1 1 (0+1)*0(0+1) 5 0, 1 0 0 0 1 0 1 1](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-21.jpg)
(0+1)*0(0+1) 5 0, 1 0 0 0 1 0 1 1
![R Given an NFA M construct an NFA accepting LM 0 ε 0 1 R Given an NFA M, construct an NFA accepting L(M). 0 ε 0 1](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-22.jpg)
R Given an NFA M, construct an NFA accepting L(M). 0 ε 0 1 1 ε 0 0 ε ε 1 0 0 1
![Given an NFA M construct an NFA accepting LM Is it correct 0 0 Given an NFA M, construct an NFA accepting L(M). Is it correct? 0 0](https://slidetodoc.com/presentation_image_h2/09a7656c4610738030323fd03c93c658/image-23.jpg)
Given an NFA M, construct an NFA accepting L(M). Is it correct? 0 0 1 Answer: No! What is the correct way? First, turn NFA to DFA and then do.
Dpda vs npda
Gtg stands for in automata
Non deterministic finite automata
Non deterministic automata
Nondeterministic
Non deterministic turing machine
Learning objectives for finite and non finite verbs
Finite and non-finite verb
Finite and non finite subordinate clauses
Finite and non finite
What is finite verb
Contoh aturan produksi
Fsa diagram
Contoh kasus finite state automata
Deterministic finite automata adalah
Automata calculator
Automata
Limitations of finite state machine
Csc3130
Finite automata
Finite automata with epsilon transitions
Finite automata
Contoh fsa
Finite automata