This commit is contained in:
Mark 2024-03-22 16:55:08 -07:00
parent 8d520eabc2
commit 6a94084190
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
2 changed files with 22 additions and 13 deletions

View File

@ -17,9 +17,9 @@ For example, \texttt{11} is a subword of \texttt{011}, but \texttt{00} is not.
\definition{} \definition{}
Recall \ref{lockproblem}. From now on, we'll call this the \textit{$n$-subword problem}: \par Recall \ref{lockproblem}. From now on, we'll call this the \textit{$n$-subword problem}: \par
Given an alphabet $A$ and a positive integer $n$, we want a \par Given an alphabet $A$ and a positive integer $n$,
word over $A$ that contains all possible length-$n$ subwords. \par we want a word over $A$ that contains all possible length-$n$ subwords. \par
The shortest word that solves a given $n$-subword problem is called the \textit{optimal solution}. That shortest word that solves a given $n$-subword problem is called the \textit{optimal solution}.
@ -55,7 +55,7 @@ Find the following:
\vfill \vfill
\pagebreak \pagebreak
\problem{} \problem{}<sbounds>
Let $w$ be a word over an alphabet of size $k$. \par Let $w$ be a word over an alphabet of size $k$. \par
Prove the following: Prove the following:
\begin{itemize} \begin{itemize}
@ -148,7 +148,7 @@ We'll call this the \textit{Fibonacci word} of order $k$.
% C_k is called the "Champernowne word" of order k. % C_k is called the "Champernowne word" of order k.
\problem{}<cword> \problem{}<cword>
Let $C_k$ denote the word over the alphabet $\{\texttt{0}, \texttt{1}\}$ obtained by \par Let $C_k$ denote the word over the alphabet $\{\texttt{0}, \texttt{1}\}$ obtained by \par
concatenating the binary representations of the integers $0,~...,~2^k -1$.\par concatenating the binary representations of the integers $0,~...,~2^k -1$. \par
For example, $C_1 = \texttt{0}$, $C_2 = \texttt{011011}$, and $C_3 = \texttt{011011100101110111}$. For example, $C_1 = \texttt{0}$, $C_2 = \texttt{011011}$, and $C_3 = \texttt{011011100101110111}$.
\begin{itemize} \begin{itemize}
\item How many symbols does the word $C_k$ contain? \item How many symbols does the word $C_k$ contain?

View File

@ -96,11 +96,11 @@ We'll call the optimal solution to this problem a \textit{De Bruijn\footnotemark
\problem{}<dbbounds> \problem{}<dbbounds>
Let $\mathcal{B}_n$ be the length of an order-$n$ De Bruijn word. \par Let $w$ be the an order-$n$ De Bruijn word, and denote its length with $|w|$. \par
Show that the following bounds always hold: Show that the following bounds always hold:
\begin{itemize} \begin{itemize}
\item $\mathcal{B}_n \leq n2^n$ \item $|w| \leq n2^n$
\item $\mathcal{B}_n \geq 2^n + n - 1$ \item $|w| \geq 2^n + n - 1$
\end{itemize} \end{itemize}
\begin{solution} \begin{solution}
@ -113,7 +113,7 @@ Show that the following bounds always hold:
\remark{} \remark{}
Now, we'd like to show that $\mathcal{B}_n = 2^n + n - 1$... \par Now, we'd like to show that the length of a De Bruijn word is always $2^n + n - 1$... \par
That is, that the optimal solution to the subword problem always has $2^n + n - 1$ letters. \par That is, that the optimal solution to the subword problem always has $2^n + n - 1$ letters. \par
We'll do this by construction: for a given $n$, we want to build a word with length $2^n + n - 1$ We'll do this by construction: for a given $n$, we want to build a word with length $2^n + n - 1$
that solves the binary $n$-subword problem. that solves the binary $n$-subword problem.
@ -244,7 +244,7 @@ Draw $G_4$.
\end{solution} \end{solution}
\vfill \vfill
\pagebreak
\problem{} \problem{}
\begin{itemize} \begin{itemize}
@ -268,8 +268,6 @@ Show that $G_4$ always contains an Eulerian path. \par
\hint{\ref{eulerexists}} \hint{\ref{eulerexists}}
\vfill \vfill
\pagebreak
\theorem{}<dbeuler> \theorem{}<dbeuler>
We can now easily construct De Bruijn words for a given $n$: \par We can now easily construct De Bruijn words for a given $n$: \par
@ -310,6 +308,7 @@ Find De Bruijn words of orders $2$, $3$, and $4$.
\end{solution} \end{solution}
\vfill \vfill
\pagebreak
Let's quickly show that the process described in \ref{dbeuler} Let's quickly show that the process described in \ref{dbeuler}
indeed produces a valid De Bruijn word. indeed produces a valid De Bruijn word.
@ -334,7 +333,17 @@ contains every possible length-$n$ subword. \par
In other words, show that $\mathcal{S}_n(w) = 2^n$ for a generated word $w$. In other words, show that $\mathcal{S}_n(w) = 2^n$ for a generated word $w$.
\begin{solution} \begin{solution}
TODO Any length-$n$ subword of $w$ is the concatenation of a vertex label and an edge label.
By construction, the next length-$n$ subword is the concatenation of the next vertex and edge
in the Eulerian cycle.
\vspace{2mm}
This cycle traverses each edge exactly once, so each length-$n$ subword is distinct. \par
Since $w$ has length $2^n + n - 1$, there are $2^n$ total subwords. \par
These are all different, so $\mathcal{S}_n \geq 2^n$. \par
However, $\mathcal{S}_n \leq 2^n$ by \ref{sbounds}, so $\mathcal{S}_n = 2^n$.
\end{solution} \end{solution}
\vfill \vfill