diff --git a/src/Advanced/Error-Correcting Codes/parts/00 detection.tex b/src/Advanced/Error-Correcting Codes/parts/00 detection.tex index 58466e3..233db83 100755 --- a/src/Advanced/Error-Correcting Codes/parts/00 detection.tex +++ b/src/Advanced/Error-Correcting Codes/parts/00 detection.tex @@ -1,6 +1,8 @@ \section{Error Detection} -An ISBN\footnote{International Standard Book Number} is a unique numeric book identifier. It comes in two forms: ISBN-10 and ISBN-13. Naturally, ISBN-10s have ten digits, and ISBN-13s have thirteen. The final digit in both versions is a \textit{check digit}. +An ISBN\footnote{International Standard Book Number} is a unique identifier publishers assign to their books. \par +It comes in two forms: ISBN-10 and ISBN-13. Naturally, ISBN-10s have ten digits, and ISBN-13s have thirteen. +The final digit in both versions is a \textit{check digit}. \vspace{3mm} @@ -15,7 +17,8 @@ If $n_{10}$ is equal to 10, it is written as \texttt{X}. \problem{} -Only one of the following ISBNs is valid. Which one is it? +Only one of the following ISBNs is valid. Which one is it? \par +\note[Note]{Dashes are meaningless.} \begin{itemize} \item \texttt{0-134-54896-2} @@ -23,15 +26,16 @@ Only one of the following ISBNs is valid. Which one is it? \end{itemize} \begin{solution} - The first has an inconsistent check digit. + The second is valid. \end{solution} \vfill \pagebreak \problem{} -Take a valid ISBN-10 and change one digit. Is it possible that you get another valid ISBN-10? \par -Provide a proof. +Take a valid ISBN-10 and change one digit. \par +Is it possible that you get another valid ISBN-10? \par +Provide an example or a proof. \begin{solution} Let $S$ be the sum $10n_1 + 9n_2 + ... + 2n_9 + n_{10}$, before any digits are changed. @@ -50,9 +54,8 @@ Provide a proof. \vfill \problem{} -Take a valid ISBN-10 and swap two adjacent digits. When will the result be a valid ISBN-10? \par -This is called a \textit{transposition error}. - +Take a valid ISBN-10 and swap two adjacent digits. This is called a \textit{transposition error}. \par +When will the result be a valid ISBN-10? \begin{solution} Let $n_1n_2...n_{10}$ be a valid ISBN-10. \par @@ -68,7 +71,8 @@ This is called a \textit{transposition error}. \pagebreak \definition{} -ISBN-13 error checking is slightly different. Given a partial ISBN-13 $n_1 n_2 n_3 ... n_{12}$, the final digit is given by +ISBN-13 error checking is slightly different. \par +Given a partial ISBN-13 with digits $n_1 n_2 n_3 ... n_{12}$, the final digit is given by $$ n_{13} = \Biggr[ \sum_{i=1}^{12} n_i \times (2 + (-1)^i) \Biggl] \text{ mod } 10 diff --git a/src/Advanced/Error-Correcting Codes/parts/01 correction.tex b/src/Advanced/Error-Correcting Codes/parts/01 correction.tex index 72d183b..5b55535 100644 --- a/src/Advanced/Error-Correcting Codes/parts/01 correction.tex +++ b/src/Advanced/Error-Correcting Codes/parts/01 correction.tex @@ -8,7 +8,8 @@ QR codes feature a system that does. \par Odds are, you've seen a QR code with an image in the center. Such codes aren't \say{special}---they're simply missing their central pixels. The error-correcting algorithm in the QR specification allows us to read the code despite this damage. \begin{figure}[h] \centering - \href{https://youtube.com/watch?v=dQw4w9WgXcQ}{\includegraphics[width = 3cm]{qr}} + %\href{https://youtube.com/watch?v=dQw4w9WgXcQ}{\includegraphics[width = 3cm]{qr-rick}} + \href{https://betalupi.com}{\includegraphics[width = 3cm]{qr-betalupi}} \end{figure} \definition{Repeating codes} @@ -47,7 +48,8 @@ What is the efficiency of a $k$-repeat code? \vfill -As you just saw, repeat codes are not a good solution. You need many extra bits for even a small amount of redundancy. We need a better system. +Repeat codes are not efficient. We need to inflate our message by +\textit{three times} if we want to correct even a single error. We need a better system. \pagebreak diff --git a/src/Advanced/Error-Correcting Codes/parts/02 hamming.tex b/src/Advanced/Error-Correcting Codes/parts/02 hamming.tex index f1901e2..d90888e 100644 --- a/src/Advanced/Error-Correcting Codes/parts/02 hamming.tex +++ b/src/Advanced/Error-Correcting Codes/parts/02 hamming.tex @@ -1,6 +1,6 @@ \section{Hamming Codes} -Say we have a 16-bit message, for example \texttt{1011 0101 1101 1001}. \par +Say we have an $n$-bit message, for example \texttt{1011 0101 1101 1001}. \par We will number its bits in binary, from left to right: @@ -62,13 +62,14 @@ We will number its bits in binary, from left to right: \problem{} -In this 16-bit message, how many message bits have an index with a one as the last digit? \par +If we number the bits of a 16-bit message as described above, \par +how many message bits have an index with a one as the last digit? \par (i.e, an index that looks like \texttt{***1}) \vspace{2cm} \problem{} -Say we number the bits in a 32-bit message as above. \par +Now consider a 32-bit message. \par How many message bits have an index with a one as the $n^\text{th}$ digit? \par \vspace{2cm} @@ -76,7 +77,10 @@ How many message bits have an index with a one as the $n^\text{th}$ digit? \par -We now want a way to detect errors in our 16-bit message. To do this, we'll replace a few data bits with parity bits. This will reduce the amount of information we can send, but will also improve our error-detection capabilities. +Now, let's come up with a way to detect errors in our 16-bit message. +To do this, we'll replace a few data bits with parity bits. +This will reduce the amount of information we can send, +but will allow the receiver to detect errors in the received message. \vspace{1mm} @@ -174,7 +178,8 @@ Can this coding scheme correct a single-bit error? \vfill \pagebreak -We'll now add four more parity bits, in positions \texttt{0001}, \texttt{0010}, \texttt{0100}, and \texttt{1000}: +We'll now add four more parity bits, in positions \texttt{0001}, \texttt{0010}, \texttt{0100}, and \texttt{1000}: \par +This error-detection scheme is called the \textit{Hamming code}. \begin{center} \begin{tikzpicture}[scale = 1.25] @@ -246,7 +251,7 @@ Bits \texttt{0100} and \texttt{1000} work in the same way. \par When counting bits in binary numbers, go from right to left.} \problem{} -Which message bits does each parity bit cover? \par +Which message bits does each parity bit \say{cover}? \par In other words, which message bits affect the value of each parity bit? \par \vspace{1mm} @@ -358,7 +363,7 @@ Analyze this coding scheme. \vfill \problem{} -Each of the following messages has either 0, 1, or two errors. \par +Each of the following messages has either one, two, or no errors. \par Find the errors and correct them if possible. \par \hint{Bit \texttt{0000} should tell you how many errors you have.} @@ -590,7 +595,7 @@ A \textit{message stream} is an infinite string of binary digits. \problem{} Show that Hamming codes do not reliably detect bit deletions: \par \hint{ - Create a 17-bit message whose first 16 bits are a valid Hamming block, \par + Create a 17-bit message whose first 16 bits are a valid Hamming-coded message, \par and which is still valid when a bit (chosen by you; not the $17^\text{th}$) is deleted. } @@ -598,10 +603,11 @@ Show that Hamming codes do not reliably detect bit deletions: \par \problem{} Convince yourself that Hamming codes cannot correct insertions. \par -Then, create a 16-bit message that... +Then, create a 16-bit message that: \begin{itemize} - \item is a valid Hamming block, and - \item incorrectly "corrects" a single bit error when it encounters an insertion error. + \item is itself a valid Hamming code, and + \item incorrectly "corrects" a single bit error when it encounters an insertion error. \par + You may choose where the insertion occurs. \end{itemize} \vfill diff --git a/src/Advanced/Error-Correcting Codes/qr-betalupi.png b/src/Advanced/Error-Correcting Codes/qr-betalupi.png new file mode 100644 index 0000000..f57e008 Binary files /dev/null and b/src/Advanced/Error-Correcting Codes/qr-betalupi.png differ diff --git a/src/Advanced/Error-Correcting Codes/qr.png b/src/Advanced/Error-Correcting Codes/qr-rick.png similarity index 100% rename from src/Advanced/Error-Correcting Codes/qr.png rename to src/Advanced/Error-Correcting Codes/qr-rick.png