Edits
This commit is contained in:
parent
8d520eabc2
commit
6a94084190
@ -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}
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user