Finished compression handout

This commit is contained in:
Mark 2024-04-25 14:59:29 -07:00
parent 0bfe54d69b
commit 237497c0c3
6 changed files with 52 additions and 4 deletions

View File

@ -8,12 +8,15 @@
\input{tikzset.tex} \input{tikzset.tex}
\usepackage{units} \usepackage{units}
\usepackage{pdfpages}
\uptitlel{Advanced 2} \uptitlel{Advanced 2}
\uptitler{\smallurl{}} \uptitler{\smallurl{}}
\title{Compression} \title{Compression}
\subtitle{Prepared by Mark on \today{}} \subtitle{Prepared by Mark on \today{}}
% TODO: add a section on info theory,
% shannon entropy. etc.
\begin{document} \begin{document}
@ -23,5 +26,6 @@
\input{parts/1 runlength.tex} \input{parts/1 runlength.tex}
\input{parts/2 lzss.tex} \input{parts/2 lzss.tex}
\input{parts/3 huffman.tex} \input{parts/3 huffman.tex}
\input{parts/4 bonus.tex}
\end{document} \end{document}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -35,7 +35,7 @@
\problem{}<runlenone> \problem{}<runlenone>
Using a na\"ive coding scheme, encode \texttt{AAAA$\cdot$AAAA$\cdot$BCD$\cdot$AAAA$\cdot$AAAA} in binary. \par Using the na\"ive coding scheme, encode \texttt{AAAA$\cdot$AAAA$\cdot$BCD$\cdot$AAAA$\cdot$AAAA} in binary. \par
\note[Note]{ \note[Note]{
We're still using the four-symbol alphabet $\{\texttt{A}, \texttt{B}, \texttt{C}, \texttt{D}\}$. \par We're still using the four-symbol alphabet $\{\texttt{A}, \texttt{B}, \texttt{C}, \texttt{D}\}$. \par
Dots ($\cdot$) in the string are drawn for readability. Ignore them. Dots ($\cdot$) in the string are drawn for readability. Ignore them.
@ -44,6 +44,11 @@ Using a na\"ive coding scheme, encode \texttt{AAAA$\cdot$AAAA$\cdot$BCD$\cdot$AA
\begin{solution} \begin{solution}
There are eight \texttt{A}s on each end of that string. Mapping symbols as before, \par There are eight \texttt{A}s on each end of that string. Mapping symbols as before, \par
we get \texttt{[00 00 00 00 00 00 00 00 01 10 11 00 00 00 00 00 00 00 00]} we get \texttt{[00 00 00 00 00 00 00 00 01 10 11 00 00 00 00 00 00 00 00]}
\begin{instructornote}
In this handout, all encoded binary is written in square brackets. \par
Spaces, dashes, dots, and etc are added for readability, and should be ignored.
\end{instructornote}
\end{solution} \end{solution}

View File

@ -3,7 +3,7 @@
\example{} \example{}
Now consider the alphabet $\{\texttt{A}, \texttt{B}, \texttt{C}, \texttt{D}, \texttt{E}\}$. \par Now consider the alphabet $\{\texttt{A}, \texttt{B}, \texttt{C}, \texttt{D}, \texttt{E}\}$. \par
With a na\"ive coding scheme, we can encode a length $n$ string with $3n$ bits, by mapping... With the na\"ive coding scheme, we can encode a length $n$ string with $3n$ bits, by mapping...
\begin{itemize} \begin{itemize}
\item $\texttt{A}$ to $\texttt{000}$ \item $\texttt{A}$ to $\texttt{000}$
\item $\texttt{B}$ to $\texttt{001}$ \item $\texttt{B}$ to $\texttt{001}$
@ -12,8 +12,7 @@ With a na\"ive coding scheme, we can encode a length $n$ string with $3n$ bits,
\item $\texttt{E}$ to $\texttt{100}$ \item $\texttt{E}$ to $\texttt{100}$
\end{itemize} \end{itemize}
For example, this encodes \texttt{ADEBCE} as \texttt{[000 011 100 001 010 100]}. \par For example, this encodes \texttt{ADEBCE} as \texttt{[000 011 100 001 010 100]}. \par
To encode strings over $\{\texttt{A}, \texttt{B}, \texttt{C}, \texttt{D}, \texttt{E}\}$ with this scheme, we It is easy to see that this scheme uses an average of three bits per symbol.
need an average of three bits per symbol.
\vspace{2mm} \vspace{2mm}

View File

@ -0,0 +1,40 @@
\section{Bonus problems}
\problem{}
Make sense of the document on the next page. \par
What does it describe, and how does it work?
\problem{}
Given a table with a marked point, $O$, and with $2013$ properly working watches put down on the table, prove that there exists a moment in time when the sum of the distances from $O$ to the watches' centers is less than the sum of the distances from $O$ to the tips of the watches' minute hands.
\vfill
\problem{A Minor Inconvenience}
A group of eight friends goes out to dinner. Each drives his own car, checking it in with valet upon arrival.
Unfortunately, the valet attendant forgot to tag the friends' keys. Thus, when the group leaves the restaurant,
each friend is handed a random key.
\begin{itemize}
\item What is the probability that everyone gets the correct set of keys?
\item What is the probability that each friend gets the wrong set?
\end{itemize}
\vfill
\problem{Bimmer Parking}
A parking lot has a row of 16 spaces, of which a random 12 are taken. \par
Ivan drives a BMW, and thus needs two adjacent spaces to park. \par
What is the probability he'll find a spot?
\vfill
\pagebreak
\includepdf[
pages=1,
fitpaper=true
]{parts/qoi-specification.pdf}
\pagebreak