This commit is contained in:
Mark 2024-04-02 21:15:34 -07:00
parent 17e019fd02
commit c10ef06d85
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
5 changed files with 84 additions and 35 deletions

View File

@ -3,7 +3,7 @@
\example{}<lockproblem>
A certain electronic lock has two buttons: \texttt{0} and \texttt{1}.
It opens as soon as the correct two-digit code is entered, completely ignoring
previous inputs.\hspace{-0.5ex}\footnotemark{} For example, if the correct code is \text{10}, the lock will open
previous inputs. For example, if the correct code is \text{10}, the lock will open
once the sequence \texttt{010} is entered.
\vspace{2mm}
@ -19,36 +19,38 @@ Unlock this lock with only 5 keypresses.
\begin{solution}
The sequence \texttt{00110} is guaranteed to unlock this lock.
\end{solution}
\vfill
Now, consider the same lock, now set with a three-digit binary code.
\problem{}
How many codes are possible?
\vfill
\problem{}
Consider the same lock, now set with a three-digit binary code.
\begin{itemize}
\item How many codes are possible?
\item What is the shortest sequence that is guaranteed to unlock the lock? \par
Show that there is no solution with fewer than three keypresses
\vfill
\problem{}
What is the shortest sequence that is guaranteed to unlock the lock? \par
\hint{You'll need 10 digits.}
\end{itemize}
\begin{solution}
\begin{itemize}
\item $2^3 = 8$
\item \texttt{0001110100} will do.
\end{itemize}
\texttt{0001110100} will do.
\end{solution}
\problem{}
How about a four-digit code? How many digits do we need? \par
\begin{instructornote}
Don't spend too much time here.
Provide a solution at the board once everyone has had a few
minutes to think about this problem.
\end{instructornote}
\begin{solution}
One example is \texttt{0000 1111 0110 0101 000}
\end{solution}
%\problem{}
%How about a four-digit code? How many digits do we need? \par
%
%\begin{instructornote}
% Don't spend too much time here.
% Provide a solution at the board once everyone has had a few
% minutes to think about this problem.
%\end{instructornote}
%
%\begin{solution}
% One example is \texttt{0000 1111 0110 0101 000}
%\end{solution}
\vfill
\pagebreak

View File

@ -2,24 +2,28 @@
\definition{}
An \textit{alphabet} is a set of symbols. \par
For example, $\{\texttt{0}, \texttt{1}\}$ is an alphabet of two symbols, \par
For example, $\{\texttt{0}, \texttt{1}\}$ is an alphabet of two symbols,
and $\{\texttt{a}, \texttt{b}, \texttt{c}\}$ is an alphabet of three.
\definition{}
A \textit{word} over an alphabet $A$ is a sequence of symbols in that alphabet. \par
For example, $\texttt{00110}$ is a word over the alphabet $\{\texttt{0}, \texttt{1}\}$. \par
We'll let $\varnothing$ denote the empty word, which exists over every alphabet.
We'll let $\varnothing$ denote the empty word, which is a valid word over any alphabet.
\definition{}
Let $v$ and $w$ be words over the same alphabet. \par
We say $v$ is a \textit{subword} of $w$ if $v$ is contained in $w$. \par
\note{
In other words, $v$ is a subword of $w$ if we can construct $v$ \par
by removing a few characters from the start and end of $w$.
}
For example, \texttt{11} is a subword of \texttt{011}, but \texttt{00} is not.
\definition{}
Recall \ref{lockproblem}. From now on, we'll call this the \textit{$n$-subword problem}: \par
Recall \ref{lockproblem}. Let's generalize this to the \textit{$n$-subword problem}: \par
Given an alphabet $A$ and a positive integer $n$,
we want a word over $A$ that contains all possible length-$n$ subwords. \par
That shortest word that solves a given $n$-subword problem is called the \textit{optimal solution}.
we want a word over $A$ that contains all possible length-$n$ subwords.
The shortest word that solves a given $n$-subword problem is called the \textit{optimal solution}.
@ -55,6 +59,12 @@ Find the following:
\vfill
\pagebreak
\problem{}<sbounds>
Let $w$ be a word over an alphabet of size $k$. \par
Prove the following:
@ -87,6 +97,10 @@ Prove the following:
\definition{}
Let $v$ and $w$ be words over the same alphabet. \par
The word $vw$ is the word formed by writing $v$ after $w$. \par
@ -145,6 +159,10 @@ We'll call this the \textit{Fibonacci word} of order $k$.
% C_k is called the "Champernowne word" of order k.
\problem{}<cword>
Let $C_k$ denote the word over the alphabet $\{\texttt{0}, \texttt{1}\}$ obtained by \par

View File

@ -27,8 +27,8 @@ and five edges (labeled $0, ... , 4$).
\end{center}
\definition{}
A \textit{path} in a graph is a sequence of adjacent edges. \par
In a directed graph, adjacent edges are those that start and end at the same node. \par
A \textit{path} in a graph is a sequence of adjacent edges, \par
In a directed graph, edges $a$ and $b$ are adjacent if $a$ ends at the node which $b$ starts at. \par
\vspace{2mm}
For example, consider the graph above. \par
The edges $0$ and $1$ are not adjacent, because $0$ and $1$ both \textit{end} at $b$. \par
@ -88,6 +88,9 @@ if any of these conditions are violated, why do we know that an Eulerian cycle (
\definition{}
Now, consider the $n$-subword problem over $\{\texttt{0}, \texttt{1}\}$. \par
We'll call the optimal solution to this problem a \textit{De Bruijn\footnotemark{} word} of order $n$. \par
@ -113,7 +116,7 @@ Show that the following bounds always hold:
\remark{}
Now, we'd like to show that the length of a De Bruijn word is always $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
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.
@ -189,6 +192,16 @@ $G_2$ and $G_3$ are shown below.
\vfill
\pagebreak
\problem{}
Draw $G_4$.
@ -310,6 +323,16 @@ Find De Bruijn words of orders $2$, $3$, and $4$.
\vfill
\pagebreak
Let's quickly show that the process described in \ref{dbeuler}
indeed produces a valid De Bruijn word.

View File

@ -1,7 +1,8 @@
\section{Line Graphs}
\problem{}
Given a graph $G$, we can construct its \textit{line graph} (denoted $\mathcal{L}(G)$) by doing the following: \par
Given a graph $G$, we can construct a graph called the \par
\textit{line graph} of $G$ (\hspace{0.3ex}denoted $\mathcal{L}(G)$\hspace{0.3ex}) by doing the following: \par
\begin{itemize}
\item Creating a node in $\mathcal{L}(G)$ for each edge in $G$
\item Drawing a directed edge between every pair of nodes $a, b$ in $\mathcal{L}(G)$ \par
@ -93,7 +94,11 @@ Now, relabel the edge from $a$ to $b$ as $\texttt{x}\overline{\texttt{p}}\texttt
Use these new labels to name nodes in $\mathcal{L}(G_n)$.
\problem{}
Construct $\mathcal{L}(G_2)$ and $\mathcal{L}(G_3)$. What do you notice?
Construct $\mathcal{L}(G_2)$ and $\mathcal{L}(G_3)$. What do you notice? \par
\hint{
What are $\mathcal{L}(G_2)$ and $\mathcal{L}(G_3)$? We've seen them before! \par
You may need to re-label a few edges.
}
\begin{solution}
After fixing edge labels, we find that

View File

@ -275,7 +275,7 @@ Attempt the above construction a few times. Is $w$ a minimal Sturmian word?
\theorem{}
\theorem{}<sturmanthm>
We can construct a miminal Sturmian word of order $n \geq 3$ as follows:
\begin{itemize}
\item Start with $G_2$, create $R_2$ by removing one edge.
@ -287,6 +287,7 @@ We can construct a miminal Sturmian word of order $n \geq 3$ as follows:
\item Construct a word $w$ using the Eulerian path, as before. \par
This is a minimal Sturmian word.
\end{itemize}
For now, assume this theorem holds. We'll prove it in the next few problems.
\problem{}<sturmianfour>
Construct a minimal Sturmain word of order 4.
@ -374,7 +375,7 @@ Construct a minimal Sturmain word of order 5.
\problem{}
Argue that the words we get are mimimal Sturmain words: \par
Argue that the words we get by \ref{sturmanthm} are mimimal Sturmain words. \par
That is, the word $w$ has length $2n$ and $\mathcal{S}_m(w) = m + 1$ for all $m \leq n$.
\begin{solution}