On this page:
1 Big-O True/  False
2 Computing Languages With "Brute Force"
3 Computing Running Time
4 DFAs That Accept Everything, Is Poly Time?
5 Closure Operations for Poly Time Languages

Homework 10

Last updated: Fri, 7 May 2021 09:31:24 -0400

Out: Wed April 21, 00:00 EST Due: Tue April 27, 23:59 EST

This homework covers material from Chapter 7 of the textbook.

Homework Problems

  1. Big-O True/False (6 points)

  2. Computing Languages With "Brute Force" (2 + 2 = 4 points)

  3. Computing Running Time (6 points)

  4. DFAs That Accept Everything, Is Poly Time? (6 points)

  5. Closure Operations for Poly Time Languages (4 + 4 + 4 = 12 points)

  6. README (2 points)

Total: 36 points

Submitting

Submit this assignment at Gradescope hw10.

You may write up your solution however you like but the submission:
  • should only include pdf or plain text files,

  • and each file must be assigned to the correct problem in Gradescope.

1 Big-O True/False

For each equality below, say whether it is true or false.

You may give an extra explanation if you think it would help clarify your answer.

  1. 4n+2 = O(n)

  2. n^2+4n+2 = O(n)

  3. n^2+4n+2 = O(n^2)

  4. n^2+4n+2 = O(n\log n)

  5. n^2+4n+2 = 2^{O(n)}

  6. 100^{11n}+5 = 2^{O(n)}

2 Computing Languages With "Brute Force"

In the DFAs and the Language They Recognize problem from Homework 2, or the NFAs and the Language They Recognize problem from Homework 3, you had to compute the language of a finite automaton by trying all strings with your "run" function.

  1. For some given alphabet, if you wanted to call a "run" function once for each possible string, give an upper bound for the number of times "run" must be called. Express your answer as a function on n, where n is the length of the longest possible string. You may assume an alphabet of ASCII characters.

  2. Express the answer to the first part in big-O notation.

3 Computing Running Time

Give an upper bound, i.e., use big-O notation, on the running time for the TM from Example 3.7 of the textbook, i.e., the decider for the language:

A = \{\texttt{0}^{2^n}\mid n\geq 0\}

Let m be the length of the input to the decider. Your answer should be in terms of m.

4 DFAs That Accept Everything, Is Poly Time?

Show that the \textrm{ACCEPTEVERYTHING}_{DFA} language (from the DFAs That Accept Everything problem in Homework 8) is in \textbf{\textrm{P}}.

If it would help, here’s a decider M for \textrm{ACCEPTEVERYTHING}_{DFA}:

M = on input \left\langle D\right\rangle, where D is a DFA:
  1. Apply S to \left\langle D\right\rangle to get \left\langle D_{not} \right\rangle.

  2. Apply T to \left\langle D_{not}\right\rangle and accept if T accepts, else reject.

where:
  • S is a machine implementing a solution for the The Complement Operation for Regular Languages (Bonus) problem from Homework 7.

    Specifically, S, on input \left\langle D \right\rangle, where D is a DFA \left\langle Q,\Sigma,\delta,q_0,F\right\rangle, changes its tape contents to \left\langle Q,\Sigma,\delta,q_0,Q - F\right\rangle.

    In other words, accept states in D become non-accept states in the output, and vice versa. All other parts of the DFA are kept the same.

  • T is the decider for E_{DFA} from Theorem 4.4.

5 Closure Operations for Poly Time Languages

Here are some solution sketches to the Closure Operations and Turing Machines problem from Homework 6.

Your Tasks

For each of the three operations and their accompanying solutions above:
  1. Explain whether the same solution could also be used to prove closure if the languages L_1 and L_2 were instead in \textbf{\textrm{P}} and the deciders M_1 and M_2 ran in poly time.

  2. If the answer is that the old solution cannot be used, give another proof that \textbf{\textrm{P}} is closed for the operation in question.

Remember that \textbf{\textrm{P}} is the set of languages that can be decided by a deterministic single-tape TM that runs in TIME(n^k), for some constant k.