




















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Regular languages and Nondeterministic Finite Automata (NFAs). It covers topics such as the difference between NFAs and DFAs, the power of regular expressions, and Kleene's Theorem. The document also includes practice problems and information about the final exam.
Typology: Lecture notes
1 / 60
This page cannot be seen from the preview
Don't miss anything!





















































CSE 311 Autumn 20 Lecture 26
TAs will run a final review next week – poll on Ed to choose the day/time. HW8 is a mix of relations, DFAs/NFAs, and some review-y questions. Due next Friday Final review materials going up tonight. What’s fair game for the final? Everything through the end of this slide deck can show up in any way. (cumulative) Monday you’ll learn how to show a language is “not regular.” Wednesday you’ll learn how to show a set is “uncountable.” There will be a problem on the final “choose one of these two: show a language is irregular; show a set is uncountable” Last day of class will wrap those topics/talk about the Halting Problem (won’t be tested directly)
We’re going to get rid of some of the restrictions on DFAs, to see if we can get more powerful machines (i.e. can recognize more languages). From a given state, we’ll allow any number of outgoing edges labeled with a given character. The machine can follow any of them. We’ll have edges labeled with “𝜀” – the machine (optionally) can follow one of those without reading another character from the input. If we “get stuck” i.e. the next character is 𝑎 and there’s no transition leaving our state labeled 𝑎, the computation dies.
An NFA: Still has exactly one start state and any number of final states. The NFA accepts 𝑥 if there is some path from a start state to a final state labeled with 𝑥. s 0 s 1 s 2 s 3 1 1 1 0, 0,
“Outside Observer”: is there a path labeled by 𝑥 from the start state, to the final state (if we know the input in advance can we tell the NFA which decisions to make) “Perfect Guesser”: The NFA has input 𝑥, and whenever there is a choice of what to do, it magically guesses a transition that will eventually lead to acceptance (if one exists) “Parallel exploration”: The NFA computation runs all possible computations on 𝑥 in parallel (updating each possible one at every step)
I know. The parallel computation view is realistic. Lets us give simpler descriptions of complicated objects. This notion of “nondeterminism” is also really useful in more advanced CS theory (you’ll see it again in 421 or 431 if not sooner). Source of the P vs. NP problem.
What is the language of this NFA? 111 0 ∪ 1 ∗ 10 10 ∗ s 0 s 1 s 5 s 4 1 1 1 0 s 2 s 3 1 0, 1 Overall 111 0 ∪ 1 ∗ ∪ [ 10 10 ∗ ]
s 0 s 1 t 0 t 2 t 1 2 0,1 0, 2 0 0 0 (^1 ) 1 2 2 2 q ε ε
“Perfect Guesser”: The NFA has input 𝑥, and whenever there is a choice of what to do, it magically guesses a transition that will eventually lead to acceptance (if one exists) Perfect guesser view makes this easier. Design an NFA for the language in the title. Fill out the poll everywhere for Activity Credit! Go to pollev.com/cse311 and login with your UW identity Or text cse311 to 22333
That’s WAY easier than the DFA… 0, s 3 s 2 s 1 s 0 1 0,1^ 0,
Write an NFA for: Strings over { 0 , 1 , 2 } that contain at least three 0’s. Strings over 0 , 1 , 2 where the number of 2’s is even and the sum of the digits %3=0.
So NFAs/DFAs what can and can’t they do? Can NFAs do more than DFAs? How do they relate to context-free-grammars? Regular expressions? Fill out the poll everywhere for Activity Credit! Go to pollev.com/cse311 and login with your UW identity Or text cse311 to 22333
So NFAs/DFAs what can and can’t they do? Can NFAs do more than DFAs? How do they relate to context-free-grammars? Regular expressions? For every language 𝑳: 𝑳 is the language of a regular expression if and only if 𝑳 is the language of a DFA if and only if 𝑳 is the language of an NFA