ECC edits
This commit is contained in:
parent
20c0a84a0c
commit
da57a6a8ea
@ -5,16 +5,14 @@
|
|||||||
singlenumbering
|
singlenumbering
|
||||||
]{../../resources/ormc_handout}
|
]{../../resources/ormc_handout}
|
||||||
|
|
||||||
|
\usepackage{hyperref}
|
||||||
\usepackage{tikz}
|
\usepackage{tikz}
|
||||||
\usetikzlibrary{patterns}
|
\usetikzlibrary{patterns}
|
||||||
|
|
||||||
\uptitlel{Advanced 2}
|
\uptitlel{Advanced 2}
|
||||||
\uptitler{Fall 2022}
|
\uptitler{Fall 2022}
|
||||||
\title{Error-Correcting Codes}
|
\title{Error-Correcting Codes}
|
||||||
\subtitle{
|
\subtitle{Revised by Mark on \today}
|
||||||
Based on a handout by Yingkun Li \\
|
|
||||||
Revised by Mark on \today
|
|
||||||
}
|
|
||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
|
|
||||||
|
@ -30,29 +30,6 @@ Which of the following could be valid ISBNs?
|
|||||||
\vfill
|
\vfill
|
||||||
\pagebreak
|
\pagebreak
|
||||||
|
|
||||||
\problem{}
|
|
||||||
Show that the following sum is divisible by 11 iff $n_1n_2...n_{10}$ is a valid ISBN-10.
|
|
||||||
$$
|
|
||||||
\sum_{i = 1}^{10} (11 - i)n_i
|
|
||||||
$$
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
Proof that valid $\implies$ divisible, working in mod 11:
|
|
||||||
|
|
||||||
\vspace{2mm}
|
|
||||||
|
|
||||||
$10n_1 + 9n_2 + ... + 2n_9 + n_{10} \equiv$ \par
|
|
||||||
$(-n_1) + (-2n_2) + ... + (-9n_9) + n_{10} =$ \par
|
|
||||||
$-n_{10} + n_{10} \equiv 0$
|
|
||||||
|
|
||||||
\vspace{2mm}
|
|
||||||
|
|
||||||
Having done this, the rest is easy. Work in reverse, or note that each step above is an iff.
|
|
||||||
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
|
|
||||||
\problem{}
|
\problem{}
|
||||||
Take a valid ISBN-10 and change one digit. Is it possible that you get another valid ISBN-10? \par
|
Take a valid ISBN-10 and change one digit. Is it possible that you get another valid ISBN-10? \par
|
||||||
Provide an example or a proof.
|
Provide an example or a proof.
|
||||||
@ -89,6 +66,31 @@ This is called a \textit{transposition error}.
|
|||||||
\end{solution}
|
\end{solution}
|
||||||
|
|
||||||
\vfill
|
\vfill
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\problem{}
|
||||||
|
Show that the following sum is divisible by 11 iff $n_1n_2...n_{10}$ is a valid ISBN-10.
|
||||||
|
$$
|
||||||
|
\sum_{i = 1}^{10} (11 - i)n_i
|
||||||
|
$$
|
||||||
|
|
||||||
|
\begin{solution}
|
||||||
|
Proof that valid $\implies$ divisible, working in mod 11:
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
$10n_1 + 9n_2 + ... + 2n_9 + n_{10} \equiv$ \par
|
||||||
|
$(-n_1) + (-2n_2) + ... + (-9n_9) + n_{10} =$ \par
|
||||||
|
$-n_{10} + n_{10} \equiv 0$
|
||||||
|
|
||||||
|
\vspace{2mm}
|
||||||
|
|
||||||
|
Having done this, the rest is easy. Work in reverse, or note that each step above is an iff.
|
||||||
|
|
||||||
|
\end{solution}
|
||||||
|
|
||||||
|
\vfill
|
||||||
\pagebreak
|
\pagebreak
|
||||||
|
|
||||||
\problem{}
|
\problem{}
|
||||||
|
@ -8,7 +8,7 @@ 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.
|
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]
|
\begin{figure}[h]
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[width = 3cm]{qr}
|
\href{https://youtube.com/watch?v=dQw4w9WgXcQ}{\includegraphics[width = 3cm]{qr}}
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
\definition{Repeating codes}
|
\definition{Repeating codes}
|
||||||
@ -24,7 +24,7 @@ $$
|
|||||||
|
|
||||||
If we flip any one bit, we can easily find and fix the error.
|
If we flip any one bit, we can easily find and fix the error.
|
||||||
|
|
||||||
\problem{}
|
\problem{}<number-repeat>
|
||||||
How many repeated digits do you need to...
|
How many repeated digits do you need to...
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item[-] detect a transposition error?
|
\item[-] detect a transposition error?
|
||||||
@ -42,90 +42,93 @@ $$
|
|||||||
|
|
||||||
For example, the efficiency of the three-repeat code above is $\frac{3}{9} = \frac{1}{3} \approx 0.33$
|
For example, the efficiency of the three-repeat code above is $\frac{3}{9} = \frac{1}{3} \approx 0.33$
|
||||||
|
|
||||||
\problem{}
|
\problem{}<k-efficiency>
|
||||||
What is the efficiency of a $k$-repeat code?
|
What is the efficiency of a $k$-repeat code?
|
||||||
|
|
||||||
\vfill
|
\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.
|
||||||
|
|
||||||
\pagebreak
|
\pagebreak
|
||||||
|
|
||||||
\definition{Hamming's Square Code}
|
%\definition{Hamming's Square Code}
|
||||||
We will now analyze a more efficient coding scheme: \par
|
%We will now analyze a more efficient coding scheme: \par
|
||||||
|
%
|
||||||
\vspace{1mm}
|
%\vspace{1mm}
|
||||||
|
%
|
||||||
Take a four-bit message and arrange it in a $2 \times 2$ square. \par
|
%Take a four-bit message and arrange it in a $2 \times 2$ square. \par
|
||||||
Compute the pairity of each row and write it at the right. \par
|
%Compute the pairity of each row and write it at the right. \par
|
||||||
Compute the pairity of each column and write it at the bottom. \par
|
%Compute the pairity of each column and write it at the bottom. \par
|
||||||
Finally, compute the pairity of the entire message write it in the lower right corner.
|
%Finally, compute the pairity of the entire message write it in the lower right corner.
|
||||||
This ensures that the total number of ones in the message is even.
|
%This ensures that the total number of ones in the message is even.
|
||||||
|
%
|
||||||
\vspace{2mm}
|
%\vspace{2mm}
|
||||||
|
%
|
||||||
Reading the result row by row to get the encoded message. \par
|
%Reading the result row by row to get the encoded message. \par
|
||||||
For example, the message 1011 generates the sequence 101110011:
|
%For example, the message 1011 generates the sequence 101110011:
|
||||||
|
%
|
||||||
$$
|
%$$
|
||||||
1011
|
%1011
|
||||||
\longrightarrow
|
%\longrightarrow
|
||||||
\begin{array}{cc|}
|
%\begin{array}{cc|}
|
||||||
1 & 0 \\
|
% 1 & 0 \\
|
||||||
1 & 1 \\
|
% 1 & 1 \\
|
||||||
\hline
|
% \hline
|
||||||
\end{array}
|
%\end{array}
|
||||||
\longrightarrow
|
%\longrightarrow
|
||||||
\begin{array}{cc|c}
|
%\begin{array}{cc|c}
|
||||||
1 & 0 & 1 \\
|
% 1 & 0 & 1 \\
|
||||||
1 & 1 & 0 \\ \hline
|
% 1 & 1 & 0 \\ \hline
|
||||||
0 & 1 &
|
% 0 & 1 &
|
||||||
\end{array}
|
%\end{array}
|
||||||
\longrightarrow
|
%\longrightarrow
|
||||||
\begin{array}{cc|c}
|
%\begin{array}{cc|c}
|
||||||
1 & 0 & 1 \\
|
% 1 & 0 & 1 \\
|
||||||
1 & 1 & 0 \\ \hline
|
% 1 & 1 & 0 \\ \hline
|
||||||
0 & 1 & 1
|
% 0 & 1 & 1
|
||||||
\end{array}
|
%\end{array}
|
||||||
\longrightarrow
|
%\longrightarrow
|
||||||
101110011
|
%101110011
|
||||||
$$
|
%$$
|
||||||
|
%
|
||||||
\problem{}
|
%\problem{}
|
||||||
The following messages are encoded using the method above.
|
%The following messages are encoded using the method above.
|
||||||
Find and correct any single-digit or transposition errors.
|
%Find and correct any single-digit or transposition errors.
|
||||||
\begin{enumerate}
|
%\begin{enumerate}
|
||||||
\item \texttt{110 110 011} %101110011
|
% \item \texttt{110 110 011} %101110011
|
||||||
\item \texttt{100 101 011} %110101011
|
% \item \texttt{100 101 011} %110101011
|
||||||
\item \texttt{001 010 110} %000110110
|
% \item \texttt{001 010 110} %000110110
|
||||||
\end{enumerate}
|
%\end{enumerate}
|
||||||
|
%
|
||||||
\begin{solution}
|
%\begin{solution}
|
||||||
\begin{enumerate}
|
% \begin{enumerate}
|
||||||
\item \texttt{101 110 011} or \texttt{110 101 011}
|
% \item \texttt{101 110 011} or \texttt{110 101 011}
|
||||||
\item \texttt{110 101 011}
|
% \item \texttt{110 101 011}
|
||||||
\item \texttt{000 110 110}
|
% \item \texttt{000 110 110}
|
||||||
\end{enumerate}
|
% \end{enumerate}
|
||||||
\end{solution}
|
%\end{solution}
|
||||||
|
%
|
||||||
\vfill
|
%\vfill
|
||||||
|
%
|
||||||
\problem{}
|
%\problem{}
|
||||||
What is the efficiency of this coding scheme?
|
%What is the efficiency of this coding scheme?
|
||||||
|
%
|
||||||
\vfill
|
%\vfill
|
||||||
|
%
|
||||||
\problem{}
|
%\problem{}
|
||||||
Can we correct a single-digit error in the encoded message? \par
|
%Can we correct a single-digit error in the encoded message? \par
|
||||||
Can we correct a transposition error in the encoded message?
|
%Can we correct a transposition error in the encoded message?
|
||||||
|
%
|
||||||
\vfill
|
%\vfill
|
||||||
|
%
|
||||||
\problem{}
|
%\problem{}
|
||||||
Let's generalize this coding scheme to a non-square table: \par
|
%Let's generalize this coding scheme to a non-square table: \par
|
||||||
Given a message of length $ab$, construct a rectangle with dimensions $a \times b$ as described above.
|
%Given a message of length $ab$, construct a rectangle with dimensions $a \times b$ as described above.
|
||||||
\begin{itemize}
|
%\begin{itemize}
|
||||||
\item What is the efficiency of a $a \times b$ rectangle code?
|
% \item What is the efficiency of a $a \times b$ rectangle code?
|
||||||
\item Can the $a \times b$ rectangle code detect and fix single-bit errors?
|
% \item Can the $a \times b$ rectangle code detect and fix single-bit errors?
|
||||||
\item Can the $a \times b$ rectangle code detect and fix two-bit errors?
|
% \item Can the $a \times b$ rectangle code detect and fix two-bit errors?
|
||||||
\end{itemize}
|
%\end{itemize}
|
||||||
|
%
|
||||||
\vfill
|
%\vfill
|
||||||
\pagebreak
|
%\pagebreak
|
||||||
|
@ -519,6 +519,23 @@ Does this correlate with that message bit's index?
|
|||||||
Say we have a message with exactly one single-bit error. \par
|
Say we have a message with exactly one single-bit error. \par
|
||||||
If we know which parity bits are inconsistent, how can we find where the error is?
|
If we know which parity bits are inconsistent, how can we find where the error is?
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
\pagebreak
|
||||||
|
|
||||||
|
\problem{}
|
||||||
|
How efficient is the 16-bit hamming code?
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
|
||||||
|
\problem{}<generalize-hamming>
|
||||||
|
Can you generalize this system for messages of 4, 64, or 256 bits?
|
||||||
|
|
||||||
|
\vfill
|
||||||
|
|
||||||
|
\problem{}
|
||||||
|
How efficient is each code in \ref{generalize-hamming}? \par
|
||||||
|
What do we sacrifice for this efficiency gain?
|
||||||
|
|
||||||
\vfill
|
\vfill
|
||||||
|
|
||||||
\pagebreak
|
\pagebreak
|
Loading…
x
Reference in New Issue
Block a user