On this page:
1 Running Time of Combining DFAs
2 A Turing Machine "Game"?
3 TM "Game" is in NP?
4 Maybe P=NP?

Homework 13🔗

Last updated: Thu, 11 Dec 2025 11:16:17 -0500

Out: Fri Dec 05, 12:00pm EDT (noon) Due: Fri Dec 12, 12:00pm EDT (noon)

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 explores time complexity, specifically the P and NP sets of languages, as well as NP-Completeness

Homework Problems

  1. Running Time of Combining DFAs (20 points)

  2. A Turing Machine "Game"? (20 points)

  3. TM "Game" is in NP? (20 points)

  4. Maybe P=NP? (18 points)

  5. README (2 points)

Total: 80 points

Submitting

Submit your solution to this assignment in Gradescope hw13. 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 Running Time of Combining DFAs🔗

When learning about regular languages, we defined an algorithm that combines two DFAs into another one, where the resulting DFA recognizes the union of the languages of the two input DFAs (see lecture 6, or Sipser 1.25).

  1. Give the algorithm mentioned above as two-argument function definition. Name it \mathrm{UNION}_\textsf{DFA}. (The submitted answer should be only the precise function definition and nothing more, nothing less. Any extraneous info or commentary will make a submitted answer incorrect.)

  2. Compute the worst case run time of the algorithm. Since the run time depends on the size of the input DFA(s) and the output DFA (that gets written to the tape), your answer should list each DFA component of the output (there should be five), and give its size in terms of the size of the input(s). Express your answer using big-O notation in terms of n, where n is the number of states in each of the inputs. (You may assume the inputs and outputs use the same alphabet.)

  3. Add up all the components from above and state whether the algorithm is a polynomial time algorithm or not?

2 A Turing Machine "Game"?🔗

Here is a language:

\mathrm{GAME}_\textsf{TM}=\left\{\left\langle w,(M_1,\ldots,M_k)\right\rangle\mid \textrm{where ... see below}\right\}

Tasks:
  1. Give a brute-force algorithm for \mathrm{GAME}_\textsf{TM}. Explain why it does not run in poly time.

  2. Show that if M_1,...,M_k are poly-time deciders, then \mathrm{GAME}_\textsf{TM} is in \textbf{P}.

UPDATE (2025-12-10): Re-worded the problem so it’s no longer an IF-THEN, to make the proof easier.

3 TM "Game" is in NP?🔗

  1. Prove that the \mathrm{GAME}_\textsf{TM} from the A Turing Machine "Game"? Problem above is in \mathbf{NP}. Your proof must use a verifier and you may assume that the M_1,\ldots,M_k are poly-time deciders.

  2. Prove that \mathrm{GAME}_\textsf{TM} from the A Turing Machine "Game"? Problem above is in \mathbf{NP}. Your proof must use a non-deterministic TM and you may assume that the M_1,\ldots,M_k are poly-time deciders.

Note: You of course need an Examples Table to justify a statement like "machine X decides lang L" in the proof. But you should have already wrote one for Problem 2, and if so you may re-use it here.

Caveats:
  • Creating a verifier requires a certificate. Make sure to be precise about explaining what kind of value the certificate is and what it represents. Review examples from class / textbook if you are unsure what this means.

  • Creating a non-deterministic TM requires a precise explanation about when the TM uses non-determinism, i.e., exactly how and when the computation branches, and what happens in each branch. Review examples from class / textbook if you are unsure what this means.

4 Maybe P=NP?🔗

Prove that if \mathrm{GAME}_\textsf{TM} from the A Turing Machine "Game"? Problem above is \textbf{NP}\textrm{-Complete}, then \textbf{P}=\textbf{NP}.

Answers are restricted to at most 5 Statements and 5 Justifications (it can be done in less) in the proper table format (where 3 of the Statements must be: assumption of the IF-part, proving the THEN-part, and concluding with the Statement to Prove). In addition, each row of the table is restricted to one line and cannot contain any sentences or English prose. Any submissions that are longer than the requirement above will be ignored and be marked as a zero. Any extraneous info outside the proof table (other than the Statement to Prove) will make the answer incorrect.

CLARIFICATION: You are allowed to assume that the TMs for \mathrm{GAME}_\textsf{TM} are always poly-time deciders (see update for problem 2).