Академический Документы
Профессиональный Документы
Культура Документы
Formalities
This Friday is the first midterm of the course, worth 10%, on Automata and Regular Languages [pp. 156] Do not forget to bring your Reader, books, notes, pen, paper and so on. No electronics are allowed. Level of difficulty is comparable with the homeworks.
The example L={ 0n1n | nN } can not be recognized by a FA because the machine needs an unbounded amount of memory to keep track of the value n: the finite number of states |Q| puts a limit on the computational power.
qj q1
z yi
qk
CS138, Wim van Dam, UCSB
Line of Reasoning
If we want to prove that a language L is nonregular, we can use the following proof by contradiction technique: Assume that L is regular. Hence, there is a DFA M that recognizes L. For strings of length |Q| the DFA M has to repeat itself. Show that M will accept strings outside L. Conclude that the assumption was wrong.
Note that we use the simple DFA, not the more elaborate (but equivalent) NFA or GNFA.
CS138, Wim van Dam, UCSB
Some Exercises
Let A = {x,y,z} and B = {x,y}, answer: 1. Is A a subset of B? 2. Is B a subset of A? 3. What is AB? 4. What is AB? 5. What is AB? 6. What is P(Q)?
More Exercises
Give NFAs with the specified number of states that recognize the following languages over the alphabet ={0,1}: 1. { w | w ends with 00}, three states 2. {0}; two states 3. { w | w contains even number of 0s, or exactly two 1s}, six states 4.{0n | nN }, one state
0,1
1
q1 q2
0, q3
1
q4
0, q2 q3
Give DFA state diagrams for the following languages over ={0,1}: 1. { w | w begins with 1 and ends with 0} 2. { w | w does not contain substring 110} 3. {} 4. all strings except the empty string
CS138, Wim van Dam, UCSB
Next Wednesday
Q&A:
Bring Questions
CS138, Wim van Dam, UCSB