From 770bd2c2c4c9c36080f859418e794e4d8c288732 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 23 Jan 2024 10:23:59 -0800 Subject: [PATCH] Minor edits --- Advanced/DFAs/parts/0 DFA.tex | 79 ++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 30 deletions(-) diff --git a/Advanced/DFAs/parts/0 DFA.tex b/Advanced/DFAs/parts/0 DFA.tex index 2f6ad24..53744d5 100644 --- a/Advanced/DFAs/parts/0 DFA.tex +++ b/Advanced/DFAs/parts/0 DFA.tex @@ -121,9 +121,33 @@ Describe the strings accepted by $B$. \vfill \pagebreak +Before we continue, let's properly define all the words we've been using in the problems above. + +\definition{} +An \textit{alphabet} is a finite set of symbols. \par + +\definition{} +A \textit{string} over an alphabet $Q$ is a finite sequence of symbols from $Q$. \par +We'll denote the empty string $\varepsilon$. \par + + +\definition{} +$Q^*$ is the set of all possible strings over $Q$. \par +For example, $\{\texttt{0}, \texttt{1}\}^*$ is the set $\{\varepsilon, \texttt{0}, \texttt{1}, \texttt{00}, \texttt{01}, \texttt{10}, \texttt{11}, \texttt{000},... \}$ \par +Note that this set contains the empty string. + +\definition{} +A \textit{language} over an alphabet $Q$ is a subset of $Q^*$. \par +For example, the language \say{strings of length 2} over $\{\texttt{0}, \texttt{1}\}$ is $\{\texttt{00}, \texttt{01}, \texttt{10}, \texttt{11}\}$ + +\definition{} +The language \textit{recognized} by a DFA is the set of strings that the DFA accepts. + +\vspace{5mm} \problem{} -How many strings of length $n$ are accepted by the automaton $C$? +How many strings of length $n$ are accepted by the automaton below? \par +\hint{Induction.} \begin{center} \begin{tikzpicture} @@ -150,33 +174,9 @@ How many strings of length $n$ are accepted by the automaton $C$? Computing initial conditions, we see that $A_n$ is an $n+2$-th Fibonacci number. \end{solution} -%\begin{remark} -%Note that all the states in our DFAs $A$, $B$ and $C$ from figures 1, 2, 3 have outgoing symbols for each letter of the alphabet. %Do the same for your DFAs. -%\end{remark} - \vfill -\definition{} -An \textit{alphabet} is a finite set of symbols. \par - -\definition{} -A \textit{string} over an alphabet $Q$ is a finite sequence of symbols from $Q$. \par -We denote the empty string $\varepsilon$. \par - - -\vspace{2mm} - -$Q^*$ is the set of all possible strings over $Q$. \par -For example, $\{\texttt{0}, \texttt{1}\}^*$ is the set $\{\varepsilon, \texttt{0}, \texttt{1}, \texttt{00}, \texttt{01}, \texttt{10}, \texttt{11}, \texttt{000},... \}$ \par -Note that this set contains the empty string. - -\definition{} -A \textit{language} over an alphabet $Q$ is a subset of $Q^*$. \par -For example, the language \say{strings of length 2} over $\{\texttt{0}, \texttt{1}\}$ is $\{\texttt{00}, \texttt{01}, \texttt{10}, \texttt{11}\}$ - -\definition{} -We say a language $L$ is \textit{recognized} by a DFA if that DFA accepts a string $w$ if and only if $w \in L$. - +\vfill \pagebreak \problem{} @@ -193,7 +193,6 @@ Draw DFAs that recognize the following languages. In all parts, the alphabet is \begin{solution} $\{w~ | ~w~ \text{begins with a \texttt{1} and ends with a \texttt{0}}\}$ - \begin{center} \begin{tikzpicture} \begin{scope}[layer = nodes] @@ -428,6 +427,13 @@ Draw a DFA over an alphabet $\{\texttt{a}, \texttt{b}, \texttt{@}, \texttt{.}\}$ \end{solution} +\vfill + +%\problem{} +%Construct a DFA that accepts a binary integer iff it is divisible by two. +%\vfill + + \vfill \pagebreak @@ -441,7 +447,7 @@ Draw a state diagram for a DFA over an alphabet of your choice that accepts exac \item $f(n)$ is a Tribonacci number. \par Tribonacci numbers are defined by the sequence $f(0) = 0$, $f(1) = 1$, $f(2) = 1$, and $f(n) = f(n-1)+f(n-2)+f(n-3)$ for $n \ge 3$ \par - \hint{Fibonacci numbers are given by the automaton prohibiting two \texttt{`a'}s in a row.} + \hint{Fibonacci numbers are given by the automaton prohibiting two letters \say{\texttt{a}} in a row.} \end{itemize} @@ -485,7 +491,7 @@ Draw a state diagram for a DFA over an alphabet of your choice that accepts exac \textbf{Part 5:} Tribonacci numbers \par Using the hint, we get the following automaton. \par - It rejects all strings with three \texttt{'a'}s in a row. + It rejects all strings with three \texttt{a}s in a row. \begin{center} \begin{tikzpicture} @@ -510,7 +516,7 @@ Draw a state diagram for a DFA over an alphabet of your choice that accepts exac \end{tikzpicture} \end{center} - This automaton rejects all strings with three \texttt{'a'}s in a row. If we count accepted strings, we get the Tribonacci numbers with an offset: $f(0) = 1$, $f(1) = 2$, $f(2)=4$, ... \par + This automaton rejects all strings with three \texttt{a}s in a row. If we count accepted strings, we get the Tribonacci numbers with an offset: $f(0) = 1$, $f(1) = 2$, $f(2)=4$, ... \par \pagebreak @@ -626,5 +632,18 @@ Draw a state diagram for a DFA over an alphabet of your choice that accepts exac \end{solution} +\vfill +\pagebreak + +\problem{} +Construct a DFA that accepts an binary integer if and only if it is divisible by six. \par +Strings are read from most to least significant digit. +(that is, 18 will be read as 1,0,0,1,0) + +\vfill + +\problem{} +Construct a DFA that satisfies \ref{divsix}, but reads digits in the opposite order. + \vfill \pagebreak \ No newline at end of file