test review - boston university
TRANSCRIPT
![Page 1: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/1.jpg)
BU CS 332 – Theory of Computation
Lecture 8:Test 1 Review
Reading:“Myhill‐Nerode” noteSipser Ch 1.4 (optional)Sipser Ch 2.1
Mark BunFebruary 16, 2021
![Page 2: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/2.jpg)
Mea CulpaWhat I wrote:Let and consider the distinguishing set . For and , , which of the following is a distinguishing extension for and ?
a)b)c)d)
2/17/2021 CS332 ‐ Theory of Computation 2
![Page 3: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/3.jpg)
Mea CulpaWhat I meant to write:Let and consider the distinguishing set . For and , , which of the following is a distinguishing extension for and ?
a)b)c)d)
2/17/2021 CS332 ‐ Theory of Computation 3
![Page 4: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/4.jpg)
Reusing a Proof
2/17/2021 CS332 ‐ Theory of Computation 4
Finding a distinguishing set can take some work…Let’s try to reuse that work!
0𝑛1𝑛 𝑛 0 = 𝐵𝐴𝐿𝐴𝑁𝐶𝐸𝐷 ∩ 𝑤 all 0s in 𝑤 appear before all 1s
How might we show that= has an equal # of s and s
is not regular?
![Page 5: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/5.jpg)
Using Closure Properties
2/17/2021 CS332 ‐ Theory of Computation 5
∩ =
(not regular)
If is not regular, we can show a related language is not regular
any of , , or, for one language, , R, *
By contradiction: If is regular, then is regular.
(regular)
But is not regular so neither is !
![Page 6: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/6.jpg)
Example
2/17/2021 CS332 ‐ Theory of Computation 6
Prove is not regular using• nonregular language
and • regular language
all s in appear before all s
Which of the following expresses in terms of and ?a) c) b) d)
![Page 7: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/7.jpg)
2/17/2021 CS332 ‐ Theory of Computation 7
![Page 8: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/8.jpg)
!DANGER!
2/17/2021 CS332 ‐ Theory of Computation 8
Let and write where• nonregular language
and • nonregular language
andDoes this let us conclude is nonregular?
![Page 9: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/9.jpg)
Test 1 Topics
2/17/2021 CS332 ‐ Theory of Computation 9
![Page 10: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/10.jpg)
Sets, Strings, Languages (0)• Know the definition of a string and of a language (and the difference between them)
• Understand operations on strings: Concatenation, reverse
• Understand operations on languages: Union, intersection, concatenation, reverse, star, complement
• Know the difference between and
2/17/2021 CS332 ‐ Theory of Computation 10
![Page 11: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/11.jpg)
Deterministic FAs (1.1)• Given an English or formal description of a language , draw the state diagram of a DFA recognizing (and vice versa)
• Know the formal definition of a DFA (A DFA is a 5 tuple…) and convert between state diagram and formal description
• Know the formal definition of how a DFA computes• Construction for closure of regular languages under complement
2/17/2021 CS332 ‐ Theory of Computation 11
![Page 12: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/12.jpg)
Nondeterministic FAs (1.2)• Given an English or formal description of a language , draw the state diagram of an NFA recognizing (and vice versa)
• Know the formal definition of an NFA• Know the power set construction for converting an NFA to a DFA
• Proving closure properties: Know the constructions for union, concatenation, star
• Know how to prove your own closure properties
2/17/2021 CS332 ‐ Theory of Computation 12
![Page 13: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/13.jpg)
Regular Expressions (1.3)• Given an English or formal description of a language , construct a regex generating (and vice versa)
• Formal definition of a regex• Know how to convert a regex to an NFA• Know how to convert a DFA/NFA to a regex
2/17/2021 CS332 ‐ Theory of Computation 13
![Page 14: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/14.jpg)
Non‐regular Languages (Myhill‐Nerode Note)
• Understand the statements of the distinguishing set method for proving DFA size lower bounds / non‐regularity
• Understand the proof of why the distinguishing set method works, and be able to use it to prove similar statements
• Know how to apply the method to specific languages• Know how to show languages are non‐regular by combining distinguishing set method with closure properties
2/17/2021 CS332 ‐ Theory of Computation 14
![Page 15: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/15.jpg)
Test tips• You may cite without proof any result… Stated in lecture Stated and proved in the main body of the text (Ch. 0‐1.4) These include worked‐out examples of state diagrams, regexes
• Not included above: homework problems, discussion problems, (solved) exercises/problems in the text
• Showing your work / explaining your answers will help us give you partial credit
• Make sure you’re interpreting quantifiers (for all / there exists) correctly and in the correct order
2/17/2021 CS332 ‐ Theory of Computation 15
![Page 16: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/16.jpg)
Practice Problems
2/17/2021 CS332 ‐ Theory of Computation 16
![Page 17: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/17.jpg)
Name six operations under which the regular languages are closed
2/17/2021 CS332 ‐ Theory of Computation 17
![Page 18: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/18.jpg)
Prove or disprove: All finite languages are regular
2/17/2021 CS332 ‐ Theory of Computation 18
![Page 19: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/19.jpg)
Prove or disprove: The non‐regular languages are closed under union
2/17/2021 CS332 ‐ Theory of Computation 19
![Page 20: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/20.jpg)
Give the state diagram of an NFA recognizing the language (01 U 10)*
2/17/2021 CS332 ‐ Theory of Computation 20
![Page 21: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/21.jpg)
Give an equivalent regular expression for the following NFA
2/17/2021 CS332 ‐ Theory of Computation 21
0,1
0 10
![Page 22: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/22.jpg)
Is the following language regular?
2/17/2021 CS332 ‐ Theory of Computation 22
![Page 23: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/23.jpg)
Is the following language regular?
2/17/2021 CS332 ‐ Theory of Computation 23
![Page 24: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/24.jpg)
How many states does a DFA recognizingrequire?
2/17/2021 CS332 ‐ Theory of Computation 24
![Page 25: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/25.jpg)
2/17/2021 CS332 ‐ Theory of Computation 25
![Page 26: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/26.jpg)
2/17/2021 CS332 ‐ Theory of Computation 26
![Page 27: Test Review - Boston University](https://reader034.vdocument.in/reader034/viewer/2022050512/6271cc6feea4b44fc30f412c/html5/thumbnails/27.jpg)
2/17/2021 CS332 ‐ Theory of Computation 27