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
Equivalent DFA and NFA (6 points)
Closed Operation Practice (9 points)
"REACHABLE" For a Set of States (6 points)
Recursively Reversing a String (6 points)
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:
Giving the equivalent IF-THEN statement that must be proved.
Giving a proof of this IF-THEN statement.
The proof must be in the form of a Statements and Justifications Table.
Also, the proof must include two example strings, one in B and one not in B.
Finally, the proof must use the NFA representation of a regular language.
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:
A base case that defines \textrm{rev} when the input is the empty string,
and a recursive case that defines \textrm{rev} when the input is a non-empty string. A non-empty string may be written as aw where a\in\Sigma and w\in\Sigma^*. The recursive case must also include a recursive call to \textrm{rev} where the argument is smaller than the input argument.
Note: The "function" in this problem is a mathematical function. This problem does not involve any code.