diff --git a/Advanced/Compression/main.tex b/Advanced/Compression/main.tex index 4630322..1c9367b 100755 --- a/Advanced/Compression/main.tex +++ b/Advanced/Compression/main.tex @@ -8,12 +8,15 @@ \input{tikzset.tex} \usepackage{units} +\usepackage{pdfpages} \uptitlel{Advanced 2} \uptitler{\smallurl{}} \title{Compression} \subtitle{Prepared by Mark on \today{}} +% TODO: add a section on info theory, +% shannon entropy. etc. \begin{document} @@ -23,5 +26,6 @@ \input{parts/1 runlength.tex} \input{parts/2 lzss.tex} \input{parts/3 huffman.tex} + \input{parts/4 bonus.tex} \end{document} \ No newline at end of file diff --git a/Advanced/Compression/media/box.png b/Advanced/Compression/media/box.png deleted file mode 100644 index 42cb086..0000000 Binary files a/Advanced/Compression/media/box.png and /dev/null differ diff --git a/Advanced/Compression/media/noise.png b/Advanced/Compression/media/noise.png deleted file mode 100644 index 8b6dee6..0000000 Binary files a/Advanced/Compression/media/noise.png and /dev/null differ diff --git a/Advanced/Compression/parts/1 runlength.tex b/Advanced/Compression/parts/1 runlength.tex index fa4fc68..e8c6e8f 100644 --- a/Advanced/Compression/parts/1 runlength.tex +++ b/Advanced/Compression/parts/1 runlength.tex @@ -35,7 +35,7 @@ \problem{} -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]{ 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. @@ -44,6 +44,11 @@ Using a na\"ive coding scheme, encode \texttt{AAAA$\cdot$AAAA$\cdot$BCD$\cdot$AA \begin{solution} 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]} + + \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} diff --git a/Advanced/Compression/parts/3 huffman.tex b/Advanced/Compression/parts/3 huffman.tex index c264152..0a15c7e 100644 --- a/Advanced/Compression/parts/3 huffman.tex +++ b/Advanced/Compression/parts/3 huffman.tex @@ -3,7 +3,7 @@ \example{} 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} \item $\texttt{A}$ to $\texttt{000}$ \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}$ \end{itemize} 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 -need an average of three bits per symbol. +It is easy to see that this scheme uses an average of three bits per symbol. \vspace{2mm} diff --git a/Advanced/Compression/parts/4 bonus.tex b/Advanced/Compression/parts/4 bonus.tex new file mode 100644 index 0000000..415fd7c --- /dev/null +++ b/Advanced/Compression/parts/4 bonus.tex @@ -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 \ No newline at end of file