almost
jump to
@@ -60,12 +60,12 @@
\end{definition} \begin{example} Suppose $n=5$. -\begin{equation} +\begin{equation*} |(1, 0, 0, 1, 1)| = 3 \quad\quad |(1, 0, 0, 0, 0)| = 1 \quad\quad |(0, 0, 1, 1, 1)| = 4 -\end{equation} +\end{equation*} \end{example} -\begin{definition}[bit-wise xor] +\begin{definition}[sum modulo 2 (bit-wise xor)] Given two words $\textbf{w}, \textbf{w}' \in \{0,1\}^n$, we can define the following operation: \begin{equation} \textbf{w} \oplus \textbf{w}' = ((w_1 + w_1')\text{mod}2, (w_2 + w_2')\text{mod}2, \ldots, (w_n + w_n')\text{mod}2) \in \{0,1\}^n@@ -79,7 +79,7 @@ \end{itemize}
\begin{example} Suppose $n=6, \textbf{w} = (1, 1, 0, 0, 1, 0), \textbf{w}' = (0, 1, 1, 0, 0, 1)$. -\begin{equation} +\begin{equation*} \begin{array}{l} (1, 1, 0, 0, 1, 0) \,+ \\ (0, 1, 1, 0, 0, 1) = \\ \hline@@ -90,7 +90,7 @@ \begin{array}{l}
(1, 2, 1, 0, 1, 1)\text{mod} 2 = \\ \hline (1, 0, 1, 0, 1, 1) = \textbf{w} \oplus \textbf{w}' \end{array}. -\end{equation} +\end{equation*} \end{example} At this point, it's clear how this identity holds true:@@ -109,7 +109,7 @@ \end{proposition}
\begin{example} Suppose we want to count the words which have distance $i=2$ from the word $001$ ($n=3$). - \begin{equation} + \begin{equation*} \begin{aligned} \mathbf{w} = 001 \\ n = 3 \\@@ -137,13 +137,13 @@ 01011\\
01101 \end{aligned} \right\} 5 - \end{equation} + \end{equation*} - \begin{equation} + \begin{equation*} {3 \choose 2} = \frac{3!}{2!(3-2)!}=\frac{3!}{2!}=3 \quad\quad {5 \choose 4} = \frac{5!}{4!(5-4)!}=\frac{5!}{4!}=5 - \end{equation} + \end{equation*} \end{example}@@ -162,7 +162,7 @@
\begin{example} For $n=7$, a valid code of distance $d=3$ could be the set: -\begin{equation} +\begin{equation*} \label{sample-code} \mathcal{C} = \left.@@ -172,7 +172,7 @@ & 0100110, 0101101, 0110011, 0111000, \\
& 1000111, 1001100, 1010010, 1011001, \\ & 1100001, 1101010, 1110100, 1111111 \end{cases}\right\}. -\end{equation} +\end{equation*} Notice how, in this code, every two distinct words have an Hamming distance of at least $3$. \end{example}@@ -182,16 +182,16 @@ A code $\mathcal{C}$ can correct at most $r$ errors if and only if it has distance $d \geq 2r+1$.
\end{proposition} \begin{example} Suppose $\mathcal{C}$ contains two distinct words $\textbf{w}', \textbf{w}''$ that differ in at most $2r$ bits. For example, with $n=7$ and $r=1$, suppose we receive $\hat{\textbf{w}}$, obtained by flipping $r=1$ bits in one of them: -\begin{equation} +\begin{equation*} \textbf{w}' = 0000011 \quad \textbf{w}'' =0000101 \quad \hat{\textbf{w}} = 0000001 -\end{equation} +\end{equation*} At this point, it's impossible to know whether the originally transmitted word was $\textbf{w}'$ or $\textbf{w}''$. This test can be repeated by choosing any code with distance $d=2r$ and flipping $r$ of them. On the other hand, if $\mathcal{C}$ had a distance of $2r+1$, we would be sure it could correct up to $r$ errors: -\begin{equation} +\begin{equation*} \textbf{w}' = 0000011 \quad \textbf{w}'' =0010101 \quad \hat{\textbf{w}} = 0000001 -\end{equation} +\end{equation*} In this case, we can be sure that $\textbf{w}''$ was transmitted. \end{example}@@ -210,8 +210,8 @@ \end{lemma}
\subsubsection*{Proof} We need to prove two things: \begin{enumerate} - \item $\exists (\mathbf{w},\mathbf{w}') : d_H(\mathbf{w},\mathbf{w}')=2\quad\forall \mathbf{w},\mathbf{w}' \in \mathcal{C}$ - \item $\nexists (\mathbf{w},\mathbf{w}') : d_H(\mathbf{w},\mathbf{w}')=1\quad\forall \mathbf{w},\mathbf{w}' \in \mathcal{C}$ + \item $\exists (\mathbf{w},\mathbf{w}') : d_H(\mathbf{w},\mathbf{w}')=2\quad\forall\; \mathbf{w},\mathbf{w}' \in \mathcal{C}$ + \item $\nexists (\mathbf{w},\mathbf{w}') : d_H(\mathbf{w},\mathbf{w}')=1\quad\forall\; \mathbf{w},\mathbf{w}' \in \mathcal{C}$ \end{enumerate} To prove point 1, we can just take any word $\mathbf{w}\in \mathcal{C}:|\mathbf{w}|\geq 2$. Then, consider the word $\mathbf{w}'$, obtained by replacing two of the 1's in the word with two 0's.@@ -224,7 +224,7 @@ This means that if $\mathbf{w}$ has even weight, $\mathbf{w}'$ has to have odd weight, and viceversa. This is a contradiction to the hypothesis of all words in $\mathcal{C}$ having even weight, so $\mathbf{w}$ and $\mathbf{w}'$ cannot have Hamming distance 1.
Finally, let's find an upper bound for this code. \begin{lemma} - Fixed $n$, if $ \mathcal{C} \subseteq \{0,1\}^n : |w| \text{ is even } \forall \mathbf{w}\in \mathcal{C}$, then $|\mathcal{C}| \geq 2^{n-1}$.%TODO: should be equal? + Fixed $n$, if $ \mathcal{C} \subseteq \{0,1\}^n : |w| \text{ is even }\forall\; \mathbf{w}\in \mathcal{C}$, then $|\mathcal{C}| \geq 2^{n-1}$.%TODO: should be equal? \end{lemma} \subsubsection*{Proof} We know that the total number of words in a $n$-bit code is $2^n$. We start with a code made up of $(n-1)$-bit words, and consider the code $\mathcal{C} \subseteq \{0,1\}^n$ obtained by applying the following transformation to each word of the code:@@ -265,9 +265,9 @@ So we have $|\mathcal{C}|$ balls of radius $r$ and distance at least $2r+1$ from one another. This means the balls are disjoint, they're not overlapped. The total number of balls (words in $\mathcal{C}$) cannot be larger than the total number of words in $\{0,1\}^n$ divided by the number of words in a single ball.
The number of words at Hamming distance exactly $i$ from any word $w$ is ${n \choose i}$, which implies: -\begin{equation} +\begin{equation*} |B(\mathbf{w}, r)| = 1 + {n \choose 1} + {n \choose 2} + \dots + {n \choose r} = \sum_{i=0}^{r} {n \choose i}, -\end{equation} +\end{equation*} where each iteration of the sum adds the amount of elements of weight $i$. Finally, as we said before, the total number of elements in $\{0,1\}^n$ is $2^n$. So, we get the following upper bound:@@ -282,16 +282,16 @@ \end{lemma}
\begin{example} For $n=7$ and $d=3$, we have $r=1$ so: - \begin{equation} + \begin{equation*} A(7,3) \leq \floor*{\frac{2^7}{\sum\limits_{i=0}^{1}{7 \choose i}}} = \floor*{\frac{128}{{7 \choose 0} + {7 \choose 1}}} = \floor*{\frac{128}{1 + 7}} = 16. - \end{equation} + \end{equation*} \end{example} \begin{example} For $n=17$ and $d=3$: - \begin{equation} + \begin{equation*} A(17,3) \leq \floor*{\frac{2^{17}}{\sum\limits_{i=0}^{1}{17 \choose i}}} = \floor*{\frac{131072}{{17 \choose 0} + {17 \choose 1}}} = \floor*{\frac{131072}{1 + 17}} = 7281. - \end{equation} + \end{equation*} \end{example} \section{The Delsarte bound}@@ -317,7 +317,7 @@ \end{equation}
\end{theorem} \begin{example} - % TODO: insert examplea + % TODO: insert examples \end{example} \subsection{Making sense of these constraints} For each code $\mathcal{C} \subseteq \{0,1\}^n$ we associate $\mathbf{\tilde{x}}=(\tilde{x}_1, \tilde{x}_2, \ldots, \tilde{x}_n)$ such that each $\tilde{x}_i$ is a nonnegative real number and $\tilde{x}_1+\tilde{x}_2+\ldots+\tilde{x}_n=|\mathcal{C}|$.@@ -346,12 +346,12 @@ \tilde{x}_0 + \tilde{x}_1 + \tilde{x}_2 + \tilde{x}_3 = 1 + \frac{3}{2} + 1 + \frac{1}{2} = 4 = |\mathcal{C}|
\end{array} \end{equation*} \end{example} -\subsection{One last constraint} +\subsection{The final constraint} Let $\mathcal{C} \subseteq \{0,1\}^n$ be an arbitrary set, and let $\tilde{x}_i$ be defined as above (\ref{xtildei}) for $i=0,1,\ldots,n$ and $t=1,2,\ldots,n$. Then, -\begin{equation} +\begin{equation*} \sum_{i=0}^{n}K_t(n,i) \tilde{x}_i \geq 0. -\end{equation} +\end{equation*} To prove this, let $I \subseteq \{1,2,\ldots n\}$ be a set of indices and let's define the Hamming distance $d_H^I(\mathbf{w}, \mathbf{w}')$ as the largest number of indices $i \in I$ with $w_i \neq w_i'$: \begin{equation} d_H^I(\mathbf{w}, \mathbf{w}') = |\{i \in I : w_i \neq w_i'\}| \quad\forall\; \mathbf{w}, \mathbf{w}' \in \mathcal{C}.@@ -377,15 +377,15 @@ \begin{proof}
First of all, let's prove that any couple of words $\mathbf{w}, \mathbf{w}' \in \mathcal{C}$ has even $d_H$ if $|\mathbf{w}|$ and $|\mathbf{w}'|$ have the same parity. We previously defined $d_H=|\textbf{w} \oplus \textbf{w}'|$. To obtain the weight of the result of the $\oplus$ operation we can also sum the number of 1's in each word and subtract twice the number of positions where both words have 1, $D$ for brevity: - \begin{equation} + \begin{equation*} d_H(\mathbf{w}, \mathbf{w}') = |\mathbf{w} \oplus \mathbf{w}'| = |\textbf{w}| + |\textbf{w}'| + 2D, - \end{equation} + \end{equation*} where $D=|\{i \in \{1,2,\ldots,n\}:w_i=w_i'=1\}|$. First of all, $2D$ is even, so it doesn't change the parity of result. That only depends on the weight of $\mathbf{w}$ and $\mathbf{w}'$. Let's call $\mathcal{E}$ the set of all words in $\mathcal{C}$ with even weight and $\mathcal{O}$ the set of all words in $\mathcal{C}$ with odd weight. Of course, $\mathcal{E} \cup \mathcal{O} = \mathcal{C}$. - \begin{equation} + \begin{equation*} \mathcal{E} = \{\mathbf{w} \in \mathcal{C} : |\mathbf{w}|\text{ is even}\}, \quad \mathcal{O} = \{\mathbf{w} \in \mathcal{C} : |\mathbf{w}|\text{ is odd}\}. - \end{equation} + \end{equation*} Then: \begin{itemize} \item for $(\mathbf{w}, \mathbf{w}'): \mathbf{w} \in \mathcal{E} \land \mathbf{w}' \in \mathcal{E}$, $d_H(\mathbf{w}, \mathbf{w}')$ is even;@@ -396,14 +396,14 @@ \end{itemize}
So we can conclude that any couple of words $\mathbf{w}, \mathbf{w}' \in \mathcal{C}$ has even $d_H$ if $|\mathbf{w}|$ and $|\mathbf{w}'|$ have the same parity. That said, the couples of words with even distance are the ones obtained by the cartesian products $\mathcal{E} \times \mathcal{E}=\mathcal{E}^2$ and $\mathcal{O} \times \mathcal{O}=\mathcal{O}^2$; furthermore, the couples of words with odd distance are the ones obtained by the cartesian products $\mathcal{E} \times \mathcal{O}$ and $\mathcal{O} \times \mathcal{E}$. If we want to write our original thesis in these terms, we get the following form, which is clearly always true: - \begin{equation} + \begin{equation*} \begin{array}{l} |\mathcal{E}|^2+|\mathcal{O}|^2\geq |\mathcal{E}|\cdot|\mathcal{O}| + |\mathcal{O}|\cdot|\mathcal{E}|;\\\\ |\mathcal{E}|^2+|\mathcal{O}|^2\geq 2\cdot|\mathcal{E}|\cdot|\mathcal{O}|;\\\\ |\mathcal{E}|^2+|\mathcal{O}|^2 - 2\cdot|\mathcal{E}|\cdot|\mathcal{O}|\geq 0; \\\\ (|\mathcal{E}| - |\mathcal{O}|)^2 \geq 0. \end{array} - \end{equation} + \end{equation*} \end{proof} \end{lemma} \begin{lemma}@@ -419,37 +419,43 @@ \label{evens-odd-geq-zero}
\sum_{(\mathbf{w}, \mathbf{w}')\in\mathcal{C}^2}(-1)^{d_H^I(\mathbf{w}, \mathbf{w}')} \geq 0. \end{equation} If we set $I=\{i:v_i=1\}$, then $d_H^I(\mathbf{w}, \mathbf{w}') = (\textbf{w} \oplus \textbf{w}')^T\mathbf{v}$: transposing and doing a scalar product with the vector $\mathbf{v}$ gives the same result as computing the Hamming distance on all indices $i\in I$. - \begin{example} - Suppose $\mathbf{w}=(10010)$ and $\mathbf{w}'=(00111)$ with $\mathbf{v}=(10011)$. - Then, $I = \{1,4,5\}$. Let's show that $(\textbf{w} \oplus \textbf{w}')^T\mathbf{v} = d_H^I(\mathbf{w}, \mathbf{w}') = 2$: - \begin{equation*} - [(10010) \oplus (00111)]^T \cdot (10011) = (10101)^T \cdot (10011) = 1+0+0+0+1 = 2. - \end{equation*} - \end{example} - We can now go back to (\ref{evens-odd-geq-zero}) and replace the distance: - \begin{equation} + + This means we can replace the distance with this product: + \begin{equation*} \sum_{(\mathbf{w}, \mathbf{w}')\in\mathcal{C}^2}(-1)^{d_H^I(\mathbf{w}, \mathbf{w}')} \geq 0 = \sum_{(\mathbf{w}, \mathbf{w}')\in\mathcal{C}^2}(-1)^{(\textbf{w} \oplus \textbf{w}')^T\mathbf{v}} \geq 0. - \end{equation} + \end{equation*} \end{proof} + \begin{example} + Suppose $\mathbf{w}=(10010)$ and $\mathbf{w}'=(00111)$ with $\mathbf{v}=(10011)$. + Then, $I = \{1,4,5\}$. Let's show that $(\textbf{w} \oplus \textbf{w}')^T\mathbf{v} = d_H^I(\mathbf{w}, \mathbf{w}') = 2$: + \begin{equation*} + [(10010) \oplus (00111)]^T \cdot (10011) = (10101)^T \cdot (10011) = 1+0+0+0+1 = 2. + \end{equation*} + \end{example} + + \begin{proof}[Proof (algebraic)] %TODO: fill this \end{proof} \end{lemma} \begin{lemma} - Now, the only thing left to prove is $\sum_{i=0}^{n}K_t(n,i)\tilde{x}_i\geq 0 \forall t\in\{1,2,\ldots,n\}$. + Now, the only thing left to prove is: + \begin{equation*} + \sum\limits_{i=0}^{n}K_t(n,i)\tilde{x}_i\geq 0 \quad\forall\; t\in\{1,2,\ldots,n\}. + \end{equation*} \begin{proof} We start by summing the inequality in (\ref{sum-almost-here}) over all $\mathbf{v}\in \{0,1\}^n$ of weight $t$: - \begin{equation} + \begin{equation*} \sum_{\mathbf{v}\in \{0,1\}^n:|\mathbf{v}|=t}\;\sum_{(\mathbf{w}, \mathbf{w}')\in\mathcal{C}^2}(-1)^{(\textbf{w} \oplus \textbf{w}')^T\mathbf{v}} \geq 0; - \end{equation} - then, we interchange the summation order: - \begin{equation} + \end{equation*} + then, we change the summation order: + \begin{equation*} \sum_{(\mathbf{w}, \mathbf{w}')\in\mathcal{C}^2}\;\sum_{\mathbf{v}\in \{0,1\}^n:|\mathbf{v}|=t}(-1)^{(\textbf{w} \oplus \textbf{w}')^T\mathbf{v}} \geq 0. - \end{equation} + \end{equation*} At this point, let us fix $\mathbf{u} = \textbf{w} \oplus \textbf{w}'$ and re-write our first inequality as: \begin{equation}@@ -457,30 +463,30 @@ \label{s-u-inequality}
\sum_{(\mathbf{w}, \mathbf{w}')\in\mathcal{C}^2}S(\mathbf{u}) \geq 0, \end{equation} where: - \begin{equation} + \begin{equation*} S(\mathbf{u})=\sum_{\mathbf{v}\in \{0,1\}^n:|\mathbf{v}|=t}(-1)^{\mathbf{u}^T\mathbf{v}}. - \end{equation} + \end{equation*} - In the sum Of $S(\mathbf{u})$, the $\mathbf{v}$ with $\mathbf{u}^T\mathbf{v}=j$ are counted with sign $(-1)^j$. We can count the number of vectors $\mathbf{v}$ of weight $t$ and with $\mathbf{u}^T\mathbf{v}=j$. + In the sum of $S(\mathbf{u})$, the $\mathbf{v}$ vectors with $\mathbf{u}^T\mathbf{v}=j$ are counted with sign $(-1)^j$. We can count the number of vectors $\mathbf{v}$ of weight $t$ and with $\mathbf{u}^T\mathbf{v}=j$. - By definition, $|\mathbf{u}|=d_H(\mathbf{w}, \mathbf{w}')$ is the number of 1's in $\mathbf{u}$. To obtain a valid vector $\mathbf{v}$, we need to put $j$ 1's in positions where $\mathbf{u}$ has 0's. + By definition, $|\mathbf{u}|=d_H(\mathbf{w}, \mathbf{w}') = i$ is the number of 1's in $\mathbf{u}$. To obtain a valid vector $\mathbf{v}$, we need to put $j$ 1's in positions where $\mathbf{u}$ has 0's. Hence, the number of these $\mathbf{v}$ is ${i \choose j}{n-i \choose t-j}$. Then, - \begin{equation} + \begin{equation*} S(\mathbf{u})=\sum_{j=0}^{\min(i,t)}(-1)^j{i \choose j}{n-i \choose t-j}, - \end{equation} + \end{equation*} which is the Krawtchouk polynomial of degree $t$: $K_t(n,i)$. We can now go back to (\ref{s-u-inequality}), which becomes: - \begin{equation} + \begin{equation*} \sum_{(\mathbf{w}, \mathbf{w}')\in\mathcal{C}^2}S(\mathbf{u}) = \sum_{(\mathbf{w}, \mathbf{w}')\in\mathcal{C}^2}K_t(n,d_H(\mathbf{w}, \mathbf{w}')) \geq 0. - \end{equation} + \end{equation*} For each $i$, $K_t(n,i)$ appears in this sum $|\mathcal{C}|\cdot \tilde{x}_i$ times, because each $\tilde{x}_i$ is the number of couples $(\mathbf{w}, \mathbf{w}')$ with distance $i$. - We obtain the thesis by changing the summation to reflect our $\tilde{x}_i$ variables: - \begin{equation} + We obtain the thesis by changing the sum to include our $\tilde{x}_i$ variables: + \begin{equation*} \sum_{i=0}^{n}K_t(n,i)\cdot\tilde{x}_i \geq 0. - \end{equation} + \end{equation*} \end{proof} \end{lemma}