On this page:
1 Equivalent DFA and NFA
2 Closed Operation Practice
3 "REACHABLE" For a Set of States
4 Recursively Reversing a String

Homework 3

Last updated: Wed, 15 Feb 2023 01:00:06 -0500

Out: Wed Feb 15, 00:00 EST Due: Sun Feb 26, 23:59 EST (note the extended deadline)

This assignment further explores NFAs and closed operations for regular languages.

Homework Problems

  1. Equivalent DFA and NFA (6 points)

  2. Closed Operation Practice (9 points)

  3. "REACHABLE" For a Set of States (6 points)

  4. Recursively Reversing a String (6 points)

  5. README (1 point)

Total: 28 points

Submitting

Submit your solution to this assignment in Gradescope hw3. 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 Equivalent DFA and NFA

Two machines are equivalent if they accept the same strings (i.e., if they recognize the same language).

Come up with an NFA that is equivalent to the DFA from the DFA Formal Description problem in Homework 1.

Your answer must be a formal description of an NFA.

(You may want to check that your string examples are appropriately accepted or rejected by this NFA.)

2 Closed Operation Practice

Define the following operation, \mathrm{OPPO}:

\mathrm{OPPO}(B) = \left\{b \mid b\notin B\right\}

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

3 "REACHABLE" For a Set of States

Assume there is an NFA N = (Q,\Sigma,\delta,q_{start},F).

Define a function \textrm{qs} : \mathcal{P}(Q)\rightarrow \mathcal{P}(Q) that, when given some input set of states Q_1\subseteq Q, returns the set of states that are reachable by starting from a state in Q_1 and then taking zero or more \varepsilon transitions, as defined by \delta.

Your definition of \textrm{qs} may use the \varepsilon\textrm{-{\footnotesize REACHABLE}} definition from class, where \varepsilon\textrm{-{\footnotesize REACHABLE}}(q) represents the states reachable via \varepsilon transitions from a state q.

Hint: The definition of \textrm{qs} does not need recursion.

4 Recursively Reversing a String

Assume some alphabet \Sigma.

Write a recursive function \textrm{rev} : \Sigma^* \rightarrow \Sigma^* that reverses a string (remember a string is a sequence of zero or more characters from \Sigma).

Your definition of \textrm{rev} should resemble the structure of the \hat{\delta} definitions from class. More specifically, your answer should have two parts:

Note: The "function" in this problem is a mathematical function. This problem does not involve any code.