Advanced handouts
Add missing file Co-authored-by: Mark <mark@betalupi.com> Co-committed-by: Mark <mark@betalupi.com>
This commit is contained in:
56
src/Advanced/De Bruijn/parts/0 intro.tex
Normal file
56
src/Advanced/De Bruijn/parts/0 intro.tex
Normal file
@ -0,0 +1,56 @@
|
||||
\section{Introduction}
|
||||
|
||||
\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. For example, if the correct code is \text{10}, the lock will open
|
||||
once the sequence \texttt{010} is entered.
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
Naturally, there are $2^2 = 4$ possible combinations that open this lock. \par
|
||||
If we don't know the lock's combination, we could try to guess it by trying all four combinations. \par
|
||||
This would require eight key presses: \texttt{0001101100}.
|
||||
|
||||
\problem{}
|
||||
There is, of course, a better way. \par
|
||||
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{}
|
||||
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.}
|
||||
|
||||
\begin{solution}
|
||||
\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}
|
||||
|
||||
\vfill
|
||||
\pagebreak
|
Reference in New Issue
Block a user