Homework 1
Last updated: Mon, 12 Sep 2022 16:33:51 -0400
Out: Thu Sep 15, 00:00 EST Due: Sun Sep 25, 23:59 EST
This assignment explores deterministic finite automata (DFAs).
Homework Problems
HW 0 Second Chance! (up to 4 points extra)
DFA Formal Description (5 + 5 = 10 points)
Regular or Not (5 points)
"Real" Computation with DFAs (5 points)
README (1 point)
Total: 25 (out of 21) points
Submitting
Submit your solution to this assignment in Gradescope hw1. 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.
HW 0 Second Chance!
what your misunderstanding was, and
what the right answer should be.
You will receive 1 bonus pt on this assignment for each HW 0 question where you provide the above information.
1 DFA Formal Description
Imagine you have been given the task of finding news articles that mention UMass Boston.
The following FSM (DFA) represents a program that could help you with this.
It accepts all strings containing the substring \texttt{UMB}.
Come up with a formal description for this DFA.
Recall that a DFA’s formal description has five components, e.g. M = (Q,\Sigma,\delta,q_{start},F).
You may assume that the alphabet contains only the symbols from the diagram.
- Then for each of the following, say whether the computation represents an accepting computation or not (make sure to review the definition of an accepting computation). If the answer is no, explain why not.:
\hat{\delta}(q1,\texttt{UUMB})
\hat{\delta}(q1,\texttt{UMMB})
\hat{\delta}(q2,\texttt{UMBB})
\hat{\delta}(q3,\varepsilon)
\hat{\delta}(q3,\texttt{UMASSBOSTON})
2 Regular or Not
Prove that the following language is regular:
L_1 = \{w\mid w\textrm{ contains a single }\texttt{B}\textrm{ character}\}
In other words, design a DFA that recognizes the language L_1. Your answer must be a formal description of the machine.
You may assume that strings in the language are drawn from alphabet \{\texttt{A,B,C}\}.
3 "Real" Computation with DFAs
Here is an example showing that DFAs can also perform "real" computation.
Assume that the following is an alphabet of "domino" symbols (one could easily imagine using unicode characters to represent such an alphabet):
Now let L_2 be a language consisting of sequences of these dominos where: L_2 = \{w\mid \textrm{the top row is the same number as the bottom row (each row represents a binary number)}\}
Prove that L_2 is a regular language.