Difference between revisions of "Aufgaben:Exercise 1.6: (7, 4) Hamming Code"

From LNTwww
Line 1: Line 1:
{{quiz-Header|Buchseite=Kanalcodierung/Beispiele binärer Blockcodes
+
{{quiz-Header|Buchseite=Channel_Coding/Examples_of_Binary_Block_Codes
  
 
}}
 
}}
  
[[File:P_ID2388__KC_A_1_6_neu.png|right|frame|Codetabelle des  $\text{HC (7, 4)}$]]
+
[[File:P_ID2388__KC_A_1_6_neu.png|right|frame|Code table of the  $\text{HC (7, 4)}$]]
  
1962 hat  [https://de.wikipedia.org/wiki/Richard_Hamming Richard Wesley Hamming]  eine Klasse binärer Blockcodes angegeben, die sich durch die Anzahl  $m$  der zugeführten Prüfbits unterscheiden. Die Codewortlänge ist stets  $n = 2^m - 1$. Das Informationswort besteht aus  $k = n - m$  Bit:
+
In 1962,  [https://en.wikipedia.org/wiki/Richard_Hamming Richard Wesley Hamming]  specified a class of binary block codes that differ in the number  $m$  of check bits supplied. The codeword length is always  $n = 2^m - 1$. The information word consists of  $k = n - m$  bits:
  
*$m = 2$:   $\text{(3, 1)}$–Hamming–Code   ⇒   identisch mit  [[Channel_Coding/Beispiele_binärer_Blockcodes#Wiederholungscodes|$\text{RC (3, 1)}$]],
+
*$m = 2$:   $\text{(3, 1)}$ Hamming code   ⇒   identical to  [[Channel_Coding/Examples_of_Binary_Block_Codes#Repetition_Codes|$\text{RC (3, 1)}$]],
*$m = 3$:   $\text{(7, 4)}$–Hamming–Code,
+
*$m = 3$:   $\text{(7, 4)}$ Hamming code,
*$m = 4$:   $\text{(15, 11)}$–Hamming–Code,
+
*$m = 4$:   $\text{(15, 11)}$ Hamming code,
*$m = 5$:   $\text{(31, 26)}$–Hamming–Code, usw.
+
*$m = 5$:   $\text{(31, 26)}$ Hamming code, etc.
  
  
Im Verlaufe dieser Aufgabe gibt es Fragen
+
In the course of this task there are questions
*zum Codeumfang  $ |\hspace{0.05cm}\mathcal{C}\hspace{0.05cm}|$,
+
*to the code size  $ |\hspace{0.05cm}\mathcal{C}\hspace{0.05cm}|$,
*zur Coderate  $R$, und
+
*to the code rate  $R$, and
*zur minimalen Distanz  $d_{\rm min}$.
+
*to the minimum distance  $d_{\rm min}$.
  
  
Weiterhin soll geklärt werden, ob der für diese Aufgabe durch seine Codetabelle  $\underline{u}_{i} \underline{x}_{i}$  gegebene  $\text{(7, 4)}$–Hamming–Code systematisch ist, und ob es sich um einen so genannten "perfekten Code" handelt. Der Laufindex kann die Werte  $i = 1, \text{...}\hspace{0.05cm} , 2^k =16$  annehmen.
+
Furthermore, we want to clarify whether the  $\underline{u}_{i} ⇒ \underline{x}_{i}$  given for this task by its code table  $\text{(7, 4)}$-Hamming code is systematic, and whether it is a so-called "perfect code". The running index can take the values  $i = 1, \text{...}\hspace{0.05cm} , 2^k =16$ .
  
Man spricht von einem  ''perfekten Code'', wenn folgende Bedingung erfüllt ist:
+
One speaks of a  ''perfect code'' if the following condition is satisfied:
 
:$$2^k = \frac{2^n} {\sum_{f=0}^t {n \choose f}}\hspace{0.3cm} \Rightarrow \hspace{0.3cm} 2^m = {\sum_{f=0}^t {n \choose f}} \hspace{0.05cm}.$$
 
:$$2^k = \frac{2^n} {\sum_{f=0}^t {n \choose f}}\hspace{0.3cm} \Rightarrow \hspace{0.3cm} 2^m = {\sum_{f=0}^t {n \choose f}} \hspace{0.05cm}.$$
  
Hierbei bezeichnet  $t$  die Anzahl der korrigierbaren Fehler. Bei ungerader Minimaldistanz  $d_{\rm min}$  gilt:
+
Here  $t$  denotes the number of correctable errors. For odd minimum distance  $d_{\rm min}$  holds:
 
:$$ t = \frac{d_{\rm min}-1 } {2} \hspace{0.05cm}.$$
 
:$$ t = \frac{d_{\rm min}-1 } {2} \hspace{0.05cm}.$$
  
Die Interpretation zu dieser Bedingung finden Sie in der Musterlösung.
+
The interpretation to this condition can be found in the sample solution.
  
  
Line 35: Line 35:
  
  
''Hinweise:''
+
Hints:  
*Die Aufgabe gehört zum Kapitel  [[Channel_Coding/Beispiele_binärer_Blockcodes|Beispiele binärer Blockcodes]].
+
*This exercise belongs to the chapter  [[Channel_Coding/Examples_of_Binary_Block_Codes|Examples of Binary Block Codes]].
*Bezug genommen wird insbesondere auf die Seite  [[Channel_Coding/Beispiele_binärer_Blockcodes#Hamming.E2.80.93Codes|Hamming–Codes]].
+
*Reference is made to the chapter  [[Channel_Coding/Examples_of_Binary_Block_Codes#Hamming_Codes|Hamming Codes]].
 
   
 
   
*Für diesen Hamming–Code wurden andere Prüfgleichungen herangezogen als im  [[Channel_Coding/Beispiele_binärer_Blockcodes#Hamming.E2.80.93Codes|Theorieteil]]. Deshalb unterscheiden sich auch die Codetabellen.  
+
*For this Hamming code, different test equations were used than in the  [[Channel_Coding/Examples_of_Binary_Block_Codes#Hamming_Codes|Theory part]]. Therefore, the code tables also differ.  
*In der  [[Aufgaben:Aufgabe_1.07:_Prüf-_und_Generatormatrix_des_HC_(7,_4,_3)|Aufgabe 1.7]], bei der der gleiche Code verwendet wird, ist das Schaubild der Prüfgleichungen angegeben.
+
*In the  [[Aufgaben:Exercise_1.07:_Check_and_Generator_Matrix_of_the_HC_(7,_4,_3)|Exercise 1.7]], where the same code is used, the chart of the check equations is given.
  
  
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
  
{Geben Sie die Kenngrößen des gegebenen Codes&nbsp; $\mathcal{C}$&nbsp; an:
+
{Specify the characteristics of the given code&nbsp; $\mathcal{C}$&nbsp;:
 
|type="{}"}
 
|type="{}"}
$ |\hspace{0.05cm}\mathcal{C}\hspace{0.05cm}| \ = \ $ { 16 }
+
$ \hspace{0.05cm}\mathcal{C}\hspace{0.05cm}| \ = \ $ { 16 }
$ k \hspace{0.46cm} = \ $ { 4 }
+
$ k \hspace{0.46cm} = \ $ { 4 }
$ n \hspace{0.44cm} = \ $ { 7 }
+
$ n \hspace{0.44cm} = \ $ { 7 }
$ R \hspace{0.40cm} = \ $ { 0.571 3% }
+
$ R \hspace{0.40cm} = \ $ { 0.571 3% }
  
  
{Handelt es sich um einen systematischen Code?
+
{is this a systematic code?
 
|type="()"}
 
|type="()"}
+ Ja,
+
+ Yes,
- Nein.
+
- No.
  
{Wie groß ist die minimale Distanz zwischen zwei beliebigen Codeworten?
+
{What is the minimum distance between any two code words?
 
|type="{}"}
 
|type="{}"}
 
$ \ d_{\rm min} \ = \ $ { 3 }
 
$ \ d_{\rm min} \ = \ $ { 3 }
  
{Wieviele Übertragungsfehler können erkannt&nbsp; $(e)$&nbsp; bzw. korrigiert&nbsp; $(t)$&nbsp; werden?
+
{How many transmission errors can be detected&nbsp; $(e)$&nbsp; or corrected&nbsp; $(t)$&nbsp; respectively?
 
|type="{}"}
 
|type="{}"}
 
$e\hspace{0.22cm} = \ $ { 2 }
 
$e\hspace{0.22cm} = \ $ { 2 }
 
$t\hspace{0.28cm} = \ $ { 1 }
 
$t\hspace{0.28cm} = \ $ { 1 }
  
{Ist der hier betrachtete Hamming–Code perfekt?
+
{Is the hamming code considered here perfect?
 
|type="()"}
 
|type="()"}
+ Ja,
+
+ Yes,
- Nein.
+
- No.
  
{Welche Aussagen gelten hinsichtlich eines perfekten Codes?
+
{Which statements are true regarding a perfect code?
 
|type="[]"}
 
|type="[]"}
- Ein perfekter Code führt stets zur Blockfehlerwahrscheinlichkeit Null.
+
- A perfect code always results in zero block error probability.
+ Alle Empfangsworte&nbsp; $\underline{y}$&nbsp; sind einem gültigen Codewort zuordbar.
+
+ All receive words&nbsp; $\underline{y}$&nbsp; are assignable to a valid codeword.
+ Bei perfekten Codes ist die minimale Hamming&ndash;Distanz ungerade.
+
+ For perfect codes, the minimum Hamming&ndash;distance is odd.
  
{Welche der nachfolgend aufgeführten Codes sind perfekt?
+
{Which of the codes listed below are perfect?
 
|type="[]"}
 
|type="[]"}
+ Der &nbsp;$\text{(15, 11)}$–Hamming–Code,
+
+ The &nbsp;$\text{(15, 11)}$ Hamming code,
+ der &nbsp;$\text{(63, 57)}$–Hamming–Code,
+
+ the &nbsp;$\text{(63, 57)}$ Hamming code,
+ der &nbsp;$\text{(3, 1)}$–Repetition Code,
+
+ the &nbsp;$\text{(3, 1)}$ repetition code,
- der &nbsp;$\text{(4, 1)}$–Repetition Code,
+
- the &nbsp;$\text{(4, 1)}$ repetition Code,
+ der &nbsp;$\text{(5, 1)}$–Repetition Code.
+
+ the &nbsp;$\text{(5, 1)}$ repetition code.
  
  
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solution===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
'''(1)'''&nbsp; Die Codetabelle hat 16 Einträge: $\underline{|C| = 16}$.  
+
'''(1)'''&nbsp; The code table has 16 entries: $\underline{|C| = 16}$.  
*Aus der Gleichung $|C| = 2^k$ folgt damit $\underline{k = 4}$.  
+
*From the equation $|C| = 2^k$ it follows that $\underline{k = 4}$.  
*Die Länge eines jeden Codewortes ist $\underline{n = 7}$.  
+
*The length of each codeword is $\underline{n = 7}$.  
*Damit ist die Coderate $\underline{R = 4/7} = 0.571$.
+
*Thus, the code rate is $\underline{R = 4/7} = 0.571$.
  
  
  
'''(2)'''&nbsp; Richtig ist <u>JA</u>:
+
'''(2)'''&nbsp; Correct <u>YES</u>:
*Jedes Codewort $\underline{x}$ beinhaltet zunächst die $k = 4$ Bit des Informationswortes $\underline{u}$. Danach folgen $m = 3$ Prüfbits:
+
*Each codeword $\underline{x}$ first contains the $k = 4$ bits of the information word $\underline{u}$. This is followed by $m = 3$ check bits:
 
:$$\underline{x} = ( x_1, x_2, x_3, x_4, x_5, x_5,x_7) = ( u_1, u_2, u_3, u_4, p_1, p_2, p_3) \hspace{0.05cm}.$$
 
:$$\underline{x} = ( x_1, x_2, x_3, x_4, x_5, x_5,x_7) = ( u_1, u_2, u_3, u_4, p_1, p_2, p_3) \hspace{0.05cm}.$$
*Dies entspricht genau der Definition eines [[Channel_Coding/Allgemeine_Beschreibung_linearer_Blockcodes|systematischen Codes]] .
+
*This corresponds exactly to the definition of a [[Channel_Coding/General_Description_linear_Block_codes|systematic code]] .
  
  
  
'''(3)'''&nbsp; Bei jedem Hamming–Code beträgt die minimale Distanz $d_{\rm min} \underline{= 3}$.  
+
'''(3)'''&nbsp; For any Hamming code, the minimum distance $d_{\rm min} \underline{= 3}$.  
*Aus der Tabelle erkennt man dies daran, dass das minimale [[Channel_Coding/Zielsetzung_der_Kanalcodierung#Einige_wichtige_Definitionen_zur_Blockcodierung|Hamming–Gewicht]] (die Anzahl der Einsen in einem Codewort) gleich 3 ist.  
+
*From the table, you can see that the minimum [[Channel_Coding/Objective_of_Channel_Coding#Some_Important_Definitions_of_Block_Coding|Hamming_Weight]] (the number of ones in a codeword) is equal to 3.  
*Ein linearer Code beinhaltet nämlich auch das Nullwort, so dass gilt:
+
*A linear code, in fact, also includes the zero word, so that holds:
:$$d_{\rm min}(\mathcal{C}) = \min_{\substack{\underline{x},\hspace{0.05cm}\underline{x}' \hspace{0.05cm}\in \hspace{0.05cm} \mathcal{C} \\ {\underline{x}} \hspace{0.05cm}\ne \hspace{0.05cm} \underline{x}'}}\hspace{0.1cm}d_{\rm H}(\underline{x}, \hspace{0.05cm}\underline{x}') = \min_{\underline{x} \hspace{0.05cm}\in \hspace{0.05cm} \mathcal{C} }\hspace{0.1cm}w_{\rm H}(\underline{x}) = 3 \hspace{0.05cm}.$$
+
:$$d_{\rm min}(\mathcal{C}) = \min_{\substack{\underline{x},\hspace{0.05cm}\underline{x}' \hspace{0.05cm}\in \hspace{0.05cm} \mathcal{C} \ {\underline{x}} \hspace{0.05cm}\ne \hspace{0.05cm} \underline{x}'}}\hspace{0.1cm}d_{\rm H}(\underline{x}, \hspace{0.05cm}\underline{x}') = \min_{\underline{x} \hspace{0.05cm}\in \hspace{0.05cm} \mathcal{C} }\hspace{0.1cm}w_{\rm H}(\underline{x}) = 3 \hspace{0.05cm}.$$
  
  
'''(4)'''&nbsp; Die Angabe $d_{\rm min} = 3$ bedeutet, dass $\underline{e = 2}$ Fehler erkannt und $\underline{t = 1}$ Fehler korrigiert werden können.
+
'''(4)'''&nbsp; The specification $d_{\rm min} = 3$ means that $\underline{e = 2}$ errors can be detected and $\underline{t = 1}$ errors can be corrected.
  
  
  
'''(5)'''&nbsp; Richtig ist <u>JA</u>:
+
'''(5)'''&nbsp; Correct is <u>YES</u>:
*Die Bedingung für einen perfekten Code lautet entsprechend der Angabe:
+
*The condition for a perfect code is according to the specification:
  
 
:$$ 2^m = {\sum_{f=0}^t {n \choose f}} \hspace{0.05cm}.$$
 
:$$ 2^m = {\sum_{f=0}^t {n \choose f}} \hspace{0.05cm}.$$
  
*Beim hier betrachteten (7, 4)–Hamming–Code gilt $n = 7$, $m = 3$ und $t = 1$, so dass sich auf beiden Seiten der Gleichung der Wert 8 ergibt:
+
*In the (7, 4)-Hamming code considered here, $n = 7$, $m = 3$, and $t = 1$, giving a value of 8 on both sides of the equation:
  
 
:$$ 2^3 = 8\hspace{0.05cm}, \hspace{0.35cm} {\sum_{f=0}^1 {7 \choose f}} = {7 \choose 0} + {7 \choose 1} = 1 + 7 = 8 \hspace{0.05cm}.$$
 
:$$ 2^3 = 8\hspace{0.05cm}, \hspace{0.35cm} {\sum_{f=0}^1 {7 \choose f}} = {7 \choose 0} + {7 \choose 1} = 1 + 7 = 8 \hspace{0.05cm}.$$
Line 129: Line 129:
  
  
'''(6)'''&nbsp; Richtig sind die <u>Aussagen 2 und 3 </u>:
+
'''(6)'''&nbsp; Correct <u>statements 2 and 3</u>:
*Gäbe es einen Kanalcode mit endlicher Codewortlänge $n$, der für alle Kanäle die Blockfehlerwahrscheinlichkeit zu Null macht, so wäre dieser nicht nur perfekt, sondern ein Wunder.  
+
*If there were a channel code with finite codeword length $n$ that made the block error probability zero for all channels, it would not only be perfect, but a miracle.  
*Aufgrund des Kanalcodierungstheorems ist aber ${\rm Pr(Blockfehler)} = 0$ bei endlichem $n$ gar nicht möglich.
+
*But due to the channel coding theorem, ${\rm Pr(block error)} = 0$ is not even possible with finite $n$.
  
  
[[File:P_ID2389__KC_A_1_6_ML.png|right|frame|Verdeutlichung eines perfekten Codes]]
+
[[File:P_ID2389__KC_A_1_6_ML.png|right|frame|illustration of a perfect code]]
  
Veranschaulichen wir uns die Aussage 2 durch eine Grafik. Der hochdimensionale Raum ist hierbei stark vereinfacht (in 2D) dargestellt. Wir gehen dabei von den Zahlenwerten $k = 4$, $n = 7$, $m = 3$ und $t = 1$ des (7, 4, 3)–Hamming–Codes aus:
+
Let's illustrate statement 2 with a graph. Here, the high-dimensional space is shown in a highly simplified way (in 2D). We assume the numerical values $k = 4$, $n = 7$, $m = 3$ and $t = 1$ of the (7, 4, 3)-Hamming code:
  
*Für das Empfangswort sind $2^7 = 128$ Punkte im 7–dimensionalen Raum möglich. Die roten Punkte markieren die $2^4 = 16$ gültigen Codeworte.
+
*For the receive word, $2^7 = 128$ points are possible in 7-dimensional space. The red dots mark the $2^4 = 16$ valid codewords.
  
*Die Kreise umfassen jeweils 8 Punkte, nämlich ein gültiges Codewort und $n = 7$ Empfangsworte nach nur einem Fehler, die man bei der Decodierung genau diesem Codewort zuordnet.
+
*The circles include 8 points each, namely a valid codeword and $n = 7$ receive words after only one error, which are assigned to exactly this codeword during decoding.
  
*Insgesamt gibt es $2^4 = 16$ solcher Kreise. Wegen $128 = 16 · 8$ liegt deshalb kein einziges Empfangswort $\underline{y}$ außerhalb eines solchen Zuordnungskreises.
+
*Total there are $2^4 = 16$ such circles. Therefore, because of $128 = 16 - 8$, not a single receive word $\underline{y}$ lies outside such an assignment circle.
  
  
Auch die <u>letzte Aussage</u> ist zutreffend, was beispielhaft für $d_{\rm min} = 4$ gezeigt werden soll:  
+
Also the <u>last statement</u> is true, which shall be shown exemplarily for $d_{\rm min} = 4$:  
*Hiermit kann ebenfalls nur $t = 1$ Fehler korrigiert werden.  
+
*Hereby also only $t = 1$ error can be corrected.  
*Unterscheidet sich ein Empfangswort $\underline{y}$ von zulässigen Codeworten in zwei Bit, so ist dieser Punkt keinem Kreis zuzuordnen. Es liegen dann auch Punkte außerhalb der Kreise und die Bedingung eines perfekten Codes ist nicht mehr erfüllt.
+
*If a receive word $\underline{y}$ differs from permissible code words in two bits, this point is not to be assigned to any circle. Then there are also points outside the circles and the condition of a perfect code is no longer fulfilled.
  
  
  
'''(7)'''&nbsp; Richtig sind die <u>Aussagen 1, 2, 3 und 5</u>:  
+
'''(7)'''&nbsp; Correct are <u>statements 1, 2, 3 and 5</u>:  
*Alle Hamming–Codes haben die minimale Hamming–Distanz $d_{\rm min} = 3$ &nbsp; &rArr; &nbsp; $t = 1$.  
+
*All Hamming codes have the minimum Hamming distance $d_{\rm min} = 3$ &nbsp; &rArr; &nbsp; $t = 1$.  
*Gleichzeitig lässt sich jeder $(n, k)$–Hamming–Code auch als $(2^m 1, 2^m 1 m)$ Code schreiben, wobei $m = n k$ die Anzahl der Prüfbits angibt.  
+
*At the same time, any $(n, k)$ Hamming code can also be written as a $(2^m - 1, 2^m - 1 - m)$ code, where $m = n - k$ indicates the number of check bits.  
*Damit wird die Gleichung eines perfekten Codes stets erfüllt:
+
*Thus, the equation of a perfect code is always satisfied:
  
 
:$${\sum_{f=0}^1 {n \choose f}} = 1 + n = 2^m \hspace{0.05cm}.$$
 
:$${\sum_{f=0}^1 {n \choose f}} = 1 + n = 2^m \hspace{0.05cm}.$$
  
Hierbei bedeuten:
+
Where:
*$m = 2$:  (3, 1) Hamming–Code, identisch mit  [[Channel_Coding/Beispiele_binärer_Blockcodes#Wiederholungscodes|'''RC (3, 1)''',]]
+
*$m = 2$:  (3, 1) Hamming code, ⇒ identical to [[Channel_Coding/Examples_binary_BlockCodes#RepeatCodes|'''RC (3, 1)''',]]
*$m = 3$:  (7, 4) Hamming–Code,
+
*$m = 3$:  (7, 4) Hamming code,
*$m = 4$:  (15, 11) Hamming–Code,
+
*$m = 4$:  (15, 11) Hamming code,
*$m = 5$:  (31, 26) Hamming–Code,
+
*$m = 5$:  (31, 26) Hamming code,
*$m = 6$:  (63, 57) Hamming–Code,   
+
*$m = 6$:  (63, 57) Hamming code,   
 
          
 
          
  
Auch der Wiederholungscode mit $n = 5$ erfüllt die Bedingung. Mit $d_{\rm min} = 5$, $t = 2$ und $m = 4$ erhält man:
+
The repetition code with $n = 5$ also satisfies the condition. With $d_{\rm min} = 5$, $t = 2$ and $m = 4$ we obtain:
 
:$${\sum_{f=0}^2 {5 \choose f}} = 1 + 5 + 10 = 16 = 2^m \hspace{0.05cm}.$$
 
:$${\sum_{f=0}^2 {5 \choose f}} = 1 + 5 + 10 = 16 = 2^m \hspace{0.05cm}.$$
  
Die anderen Wiederholungscodes (RC) mit ungeradem $n$ sind ebenfalls perfekt, nicht jedoch mit geradem $n$: RC (4, 1), RC (6, 1), usw. Dies wurde bereits in der Musterlösung zur Teilaufgabe '''(6)''' begründet.
+
The other repetition codes (RC) with odd $n$ are also perfect, but not with even $n$: RC (4, 1), RC (6, 1), etc. This has already been justified in the sample solution to the subtask '''(6)'''.
 
{{ML-Fuß}}
 
{{ML-Fuß}}
  

Revision as of 05:24, 11 June 2022

Code table of the  $\text{HC (7, 4)}$

In 1962,  Richard Wesley Hamming  specified a class of binary block codes that differ in the number  $m$  of check bits supplied. The codeword length is always  $n = 2^m - 1$. The information word consists of  $k = n - m$  bits:

  • $m = 2$:   $\text{(3, 1)}$ Hamming code   ⇒   identical to  $\text{RC (3, 1)}$,
  • $m = 3$:   $\text{(7, 4)}$ Hamming code,
  • $m = 4$:   $\text{(15, 11)}$ Hamming code,
  • $m = 5$:   $\text{(31, 26)}$ Hamming code, etc.


In the course of this task there are questions

  • to the code size  $ |\hspace{0.05cm}\mathcal{C}\hspace{0.05cm}|$,
  • to the code rate  $R$, and
  • to the minimum distance  $d_{\rm min}$.


Furthermore, we want to clarify whether the  $\underline{u}_{i} ⇒ \underline{x}_{i}$  given for this task by its code table  $\text{(7, 4)}$-Hamming code is systematic, and whether it is a so-called "perfect code". The running index can take the values  $i = 1, \text{...}\hspace{0.05cm} , 2^k =16$ .

One speaks of a  perfect code if the following condition is satisfied:

$$2^k = \frac{2^n} {\sum_{f=0}^t {n \choose f}}\hspace{0.3cm} \Rightarrow \hspace{0.3cm} 2^m = {\sum_{f=0}^t {n \choose f}} \hspace{0.05cm}.$$

Here  $t$  denotes the number of correctable errors. For odd minimum distance  $d_{\rm min}$  holds:

$$ t = \frac{d_{\rm min}-1 } {2} \hspace{0.05cm}.$$

The interpretation to this condition can be found in the sample solution.




Hints:

  • For this Hamming code, different test equations were used than in the  Theory part. Therefore, the code tables also differ.
  • In the  Exercise 1.7, where the same code is used, the chart of the check equations is given.


Questions

1

Specify the characteristics of the given code  $\mathcal{C}$ :

$ \hspace{0.05cm}\mathcal{C}\hspace{0.05cm}| \ = \ $

$ k \hspace{0.46cm} = \ $

$ n \hspace{0.44cm} = \ $

$ R \hspace{0.40cm} = \ $

2

is this a systematic code?

Yes,
No.

3

What is the minimum distance between any two code words?

$ \ d_{\rm min} \ = \ $

4

How many transmission errors can be detected  $(e)$  or corrected  $(t)$  respectively?

$e\hspace{0.22cm} = \ $

$t\hspace{0.28cm} = \ $

5

Is the hamming code considered here perfect?

Yes,
No.

6

Which statements are true regarding a perfect code?

A perfect code always results in zero block error probability.
All receive words  $\underline{y}$  are assignable to a valid codeword.
For perfect codes, the minimum Hamming–distance is odd.

7

Which of the codes listed below are perfect?

The  $\text{(15, 11)}$ Hamming code,
the  $\text{(63, 57)}$ Hamming code,
the  $\text{(3, 1)}$ repetition code,
the  $\text{(4, 1)}$ repetition Code,
the  $\text{(5, 1)}$ repetition code.


Solution

(1)  The code table has 16 entries: $\underline{|C| = 16}$.

  • From the equation $|C| = 2^k$ it follows that $\underline{k = 4}$.
  • The length of each codeword is $\underline{n = 7}$.
  • Thus, the code rate is $\underline{R = 4/7} = 0.571$.


(2)  Correct YES:

  • Each codeword $\underline{x}$ first contains the $k = 4$ bits of the information word $\underline{u}$. This is followed by $m = 3$ check bits:
$$\underline{x} = ( x_1, x_2, x_3, x_4, x_5, x_5,x_7) = ( u_1, u_2, u_3, u_4, p_1, p_2, p_3) \hspace{0.05cm}.$$


(3)  For any Hamming code, the minimum distance $d_{\rm min} \underline{= 3}$.

  • From the table, you can see that the minimum Hamming_Weight (the number of ones in a codeword) is equal to 3.
  • A linear code, in fact, also includes the zero word, so that holds:
$$d_{\rm min}(\mathcal{C}) = \min_{\substack{\underline{x},\hspace{0.05cm}\underline{x}' \hspace{0.05cm}\in \hspace{0.05cm} \mathcal{C} \ {\underline{x}} \hspace{0.05cm}\ne \hspace{0.05cm} \underline{x}'}}\hspace{0.1cm}d_{\rm H}(\underline{x}, \hspace{0.05cm}\underline{x}') = \min_{\underline{x} \hspace{0.05cm}\in \hspace{0.05cm} \mathcal{C} }\hspace{0.1cm}w_{\rm H}(\underline{x}) = 3 \hspace{0.05cm}.$$


(4)  The specification $d_{\rm min} = 3$ means that $\underline{e = 2}$ errors can be detected and $\underline{t = 1}$ errors can be corrected.


(5)  Correct is YES:

  • The condition for a perfect code is according to the specification:
$$ 2^m = {\sum_{f=0}^t {n \choose f}} \hspace{0.05cm}.$$
  • In the (7, 4)-Hamming code considered here, $n = 7$, $m = 3$, and $t = 1$, giving a value of 8 on both sides of the equation:
$$ 2^3 = 8\hspace{0.05cm}, \hspace{0.35cm} {\sum_{f=0}^1 {7 \choose f}} = {7 \choose 0} + {7 \choose 1} = 1 + 7 = 8 \hspace{0.05cm}.$$


(6)  Correct statements 2 and 3:

  • If there were a channel code with finite codeword length $n$ that made the block error probability zero for all channels, it would not only be perfect, but a miracle.
  • But due to the channel coding theorem, ${\rm Pr(block error)} = 0$ is not even possible with finite $n$.


illustration of a perfect code

Let's illustrate statement 2 with a graph. Here, the high-dimensional space is shown in a highly simplified way (in 2D). We assume the numerical values $k = 4$, $n = 7$, $m = 3$ and $t = 1$ of the (7, 4, 3)-Hamming code:

  • For the receive word, $2^7 = 128$ points are possible in 7-dimensional space. The red dots mark the $2^4 = 16$ valid codewords.
  • The circles include 8 points each, namely a valid codeword and $n = 7$ receive words after only one error, which are assigned to exactly this codeword during decoding.
  • Total there are $2^4 = 16$ such circles. Therefore, because of $128 = 16 - 8$, not a single receive word $\underline{y}$ lies outside such an assignment circle.


Also the last statement is true, which shall be shown exemplarily for $d_{\rm min} = 4$:

  • Hereby also only $t = 1$ error can be corrected.
  • If a receive word $\underline{y}$ differs from permissible code words in two bits, this point is not to be assigned to any circle. Then there are also points outside the circles and the condition of a perfect code is no longer fulfilled.


(7)  Correct are statements 1, 2, 3 and 5:

  • All Hamming codes have the minimum Hamming distance $d_{\rm min} = 3$   ⇒   $t = 1$.
  • At the same time, any $(n, k)$ Hamming code can also be written as a $(2^m - 1, 2^m - 1 - m)$ code, where $m = n - k$ indicates the number of check bits.
  • Thus, the equation of a perfect code is always satisfied:
$${\sum_{f=0}^1 {n \choose f}} = 1 + n = 2^m \hspace{0.05cm}.$$

Where:

  • $m = 2$: (3, 1) Hamming code, ⇒ identical to RC (3, 1),
  • $m = 3$: (7, 4) Hamming code,
  • $m = 4$: (15, 11) Hamming code,
  • $m = 5$: (31, 26) Hamming code,
  • $m = 6$: (63, 57) Hamming code,


The repetition code with $n = 5$ also satisfies the condition. With $d_{\rm min} = 5$, $t = 2$ and $m = 4$ we obtain:

$${\sum_{f=0}^2 {5 \choose f}} = 1 + 5 + 10 = 16 = 2^m \hspace{0.05cm}.$$

The other repetition codes (RC) with odd $n$ are also perfect, but not with even $n$: RC (4, 1), RC (6, 1), etc. This has already been justified in the sample solution to the subtask (6).