On this page:
1 DFA-NFA Equivalence
2 "Closed" Operation Practice
3 Another "Closed" Operation

Homework 4🔗

Last updated: Tue, 6 Oct 2026 11:31:53 -0400

Out: Tue Oct 06, 12:30 EDT Due: Tue Oct 13, 12:30 EDT

Note: Assignments are not officially "released" until—and are subject to change without notice up to—the indicated "Out" date and time. If an assignment is posted early, students may look ahead but are responsible for ensuring that they are always working with the most recent version of the homework.

This assignment looks at regular languages and NFAs.

Homework Problems

  1. DFA-NFA Equivalence (15 points)

  2. "Closed" Operation Practice (15 points)

  3. Another "Closed" Operation (15 points)

  4. README (1 point)

Total: 46 points

Submitting

Submit your solution to this assignment in Gradescope hw4. Please assign each page to the correct problem and make sure your solutions are legible.

A submission must also include a README containing the required information.

1 DFA-NFA Equivalence🔗

As part of the proof that NFAs also recognize Regular Languages (as presented in the lecture version of Sipser 1.40), we needed a function \mathrm{CONVERT}_\textsf{DFA-NFA} : \textsf{DFA} \rightarrow \textsf{NFA} where given some input DFA M (where we have a proof that M \operatorname{IS-A} \texttt{DFA} Machine), \mathrm{CONVERT}_\textsf{DFA-NFA} M= an NFA that recognizes the same language as M.

For this problem,
  • Write the complete formal definition of this conversion function.

    You should use your answers from Homework 1 DFA Formal Description and Homework 3 DFAs vs NFAs to help guide your thinking, and as test cases to double-check that your answer is correct.

    But note that the submitted answer should be a precise formal function definition only, which should be self-explanatory. Do not add extra comments, drawings, or notation explaining the answer. This will make the answer incorrect.

  • Write an Examples Table comparing some language L and a machine \mathrm{CONVERT}_\textsf{DFA-NFA} M, where M is some DFA that recognizes L

    Since the problem does not give a concrete language L or machine M, the Examples Table needs an extra Justification column.

    This will complete the forward direction of the NFA theorem we started in lecture.

For your Examples Table you may use the template below, or from lecture, but correct answers must demonstrate knowledge—of how an NFA computes, how it compares and differs to an analogous DFA’s computation, and an understanding of the specific transformation function above—by being exact and precise. Merely submitting a table from a different example will not receive any credit.

let string w=

w\in L?

run DFA M on w=

run N=\textrm{CONVERT}_\textsf{DFA-NFA} M on w Accepts?

Justification for why N accepts/rejects?

As usual, proofs and definitions in submitted answers must be valid mathematics, e.g., does not have unbound variables, follows correct syntax and formal definitions, and has correct types. Correct answers should not need any extraneous information, which will make the answer incorrect.

2 "Closed" Operation Practice🔗

Every programming language comes with built-in string functions and one of the most commonly used ones is string "join".

Say we have the following function on languages \mathrm{JOI} : \textsf{Language}\times\textsf{Language}\rightarrow\textsf{Language}, which lifts the string join operation to work on languages:

\mathrm{JOI}(C,D) = \left\{c\texttt{+}d \mid c\in C, d\in D\right\}

To simplify the problem, assume that both C and D always have the same alphabet \Sigma, and that the alphabet for \mathrm{JOI}(C,D) is \Sigma \cup \{\texttt{+}\}, where \texttt{+}\notin\Sigma.

Prove that set of regular languages is closed under the \mathrm{JOI} operation by:

  • Using the proof terminology of this semester’s course, give the equivalent IF-THEN statement that must be proved (see lectures for examples of this kind of problem. usually it will say "in other words ...").

    Note: submissions that prove the wrong statement will not receive credit.

    You may ask on Piazza if your statement is correct. (But note that if you start the assignment too late and the course staff is no longer available, then you’ll have to proceed without getting this approval.)

  • Give a proof of this IF-THEN statement.

    The proof must be properly formatted using the appropriate proof constructors and/or "Statements and Justifications" tables when appropriate

    Since we dont know the input languages, then any Examples Tables will need an additional "Justification" column, as explained in lecture.

    Your answer must define and use in the proof a function \mathrm{JOIN}_\textsf{NFA} : \textsf{NFA}\times\textsf{NFA}\rightarrow\textsf{NFA} that combines two NFA machines into another one with the appropriate behavior.

    Example Tables should have at least 4 examples, two in the joined language and two not in the joined language.

3 Another "Closed" Operation🔗

Another common string function available in nearly every programming language is string "upcase".

  • Define a function \mathrm{UP} : \textsf{Language}\rightarrow\textsf{Language}, which lifts the string upcase operation to work on languages

    To simplify the problem, assume the input language always uses the alphabet containing the 26 lowercase letters, and that the output language uses the alphaget containing the 26 uppercase letters.

  • Prove that set of Regular languages is closed under the \mathrm{UP}. The proof must use NFAs.