Nondeterministic Finite Automata - CS

Nondeterministic Finite Automata
The purpose of this activity is to introduce students to nondeterministic
automata.
By the end of the activity, students should be able to:
• Explain the difference between nondeterministic and deterministic automata (both informally and formally).
• Explain how nondeterministic automata define languages.
Students should already be familiar with deterministic finite automata.
Nondeterministic Finite Automata
Model 1:
Consider the following automata M0 :
This nondeterministic finite automata (NFA) accepts the language L0 =
{xb|x ∈ {a, b}∗ and |x| is even}.
Question 1. How many transitions leave the state q1 ?
Question 2. How many transitions leave the state q2 ?
Question 3. How many transitions leave q0 ?
Question 4.
M0 a DFA?
Based on your answers to the previous questions, is
Question 5.
Let the string s = aababbb. List a sequence of
states that starts in q0 , ends in q2 , and follows transitions in M0
corresponding to the symbols in s.
Question 6.
Does such a sequence exist for s = abba? For
s = abb? Explain why or why not.
Question 7. Complete the following definition:
A nondeterministic finite automata accepts a language L over an
alphabet Σ if for all s ∈ L
and for all s 6∈ L
.
Model 2:
Consider the following NFA, M1 :
This NFA accepts the language L1 = {x ∈ {0, 1}∗ |x contains an odd number of 1 or 0}.
Question 8. Is λ in the alphabet of this language?
Question 9. How many transitions are labeled λ?
Question 10. Consider the states q1 and q2 . If these two states
were a seperate automata wih q1 as an ititial state, what language
would that automata accept?
Question 11. Consider the states q4 and q3 . If these two states
were a seperate automata wih q4 as an ititial state, what language
would that automata accept?
Question 12. How do your answers to the previous two questions
relate to the definition of L1 ?
Question 13. M1 accepts s = 01110. In order to accept this string
based on your definition in question 7, what are the semantics of λ
transitions?
Model 3:
Consider the following NFA, M3 :
Question 14.
011111?
Does M3 accept s = 011101? What about s =
Question 15. In order to end in state q3 , what must the penultimate symbol in a string be?
Question 16. Suppose a 1 is encountered in state q0 . Which states
are possible next states?
Question 17.
The five tuple for a DFA M = hQ, Σ, δ, q0 , F i.
Which of these elements must change for an NFA? Why?
Question 18. The definition of δ for a DFA is δ : Q × Σ → Q.
What is the range of δ for an NFA? Why?
Question 19. Give the five-tuple definition of M3 .