Final
Final
This exam will be available from 12:01 AM EST on Tuesday, 8/10/2021 until Wednesday,
8/11/2021, at 11:59PM EST. You have 12 hours to complete this exam from the time you down-
load it; you can use any 12 hours in the 48-hour window to work on the exam. The exam is due
Wednesday, 8/11/2021, at 11:59PM EST with NO EXTENSIONS. Submit to GradeScope
(course code: X3JEX4).
Grading policy reminder: LATEX is preferred, but neatly typed or handwritten solutions are
acceptable. Your TAs may dock points for indecipherable writing. Proofs should be complete; that
is, include enough information that a reader can clearly tell that the argument is rigorous.
If a question is ambiguous, please state your assumptions. This way, we can give you credit for
correct work. (Even better, post on Ed so that we can resolve the ambiguity.)
You can consult the following resources during the exam:
2. Lecture recordings on YouTube and in-class recordings in the Zoom recordings folder on
CourseWorks.
3. Past homework problems, your homework answers, and solutions posted on the course web-
page.
4. The textbook.
5. Past questions posted on Ed. (You may post on Ed during the exam, but please do not
answer other student’s questions or provide any details that might help others solve a problem.
Answers from instructors will be limited to basic typo correction and clarifications only.)
6. Resources for LATEX formatting that are unrelated to the course material.
Any resources not listed here, including all reference sources beyond the textbook, are not permitted.
1
1 Problem 1 (10 points)
For this problem, consider the NFA state diagram pictured below.
0
q2 q3 q4
0 1
q0 q1
b
q5 q6
1. (3 points.) Does this NFA accept the empty string ε? What about the string 00101? What
about the string ba0011?
2. (2 points.) In class, we showed that the class of regular languages was closed under Kleene star
(∗ ) by demonstrating that, given an NFA N that recognizes any language A, we can convert
N into a new NFA N 0 that recognizes A∗ . The NFA pictured above was created by this
conversion process. Which transition(s) or state(s) may have been added during conversion?
3. (5 points.) Write a regular expression that evaluates to the same language that the NFA
recognizes. Explain in a few sentences why the expression and the NFA represent the same
language. (Hint: begin by reverse-engineering the conversion process for ∗ .)
2
2 Problem 2 (14 points)
For this problem, consider the language
1. (7 points.) Use the pumping lemma for regular languages to prove that L is nonregular.
3
3 Problem 3 (8 points)
Recall that the XOR operator ⊕ evaluates to 1 if exactly one of its inputs is 1: thus 0 ⊕ 0 = 0,
0 ⊕ 1 = 1, 1 ⊕ 0 = 1, 1 ⊕ 1 = 0. Given two binary strings w, v ∈ {0, 1}∗ that have the same length,
the binary XOR of w and v, written w ⊕ v, is the string x such that wi ⊕ vi = xi for all i. For
example,
01001 ⊕ 11000 = 10001.
Consider the language
4
4 Problem 4 (8 points)
1. (4 points.) Prove that the language
5
5 Problem 5 (10 points)
1. Prove that the language
is undecidable by reducing another undecidable language to L5 . You may not use Rice’s
theorem. (Hint: it suffices to show that if you could build a decider for L5 , you could build a
decider for a language that is proved undecidable in lecture, in homework or in the textbook.)
6
6 Problem 6 (3 extra credit points)
1. (3 points). Consider the following language:
SELFEN U M = {hEi | E is an enumerator that never prints out its own description hEi}.
Recall that a language is Turing-recognizable if and only if some enumerator enumerates it.
Show that SELFEN U M is not Turing-recognizable by finding a paradox.