Difference between revisions of "Aufgaben:Exercise 2.13: Inverse Burrows-Wheeler Transformation"

From LNTwww
Line 3: Line 3:
 
}}
 
}}
  
[[File:EN_Inf_A_2_14.png|right|frame|Zu analysierendes <br>BWT-Ergebnis]]
+
[[File:EN_Inf_A_2_14.png|right|frame|To be analysed <br>BWT result]]
Die&nbsp;  ''Burrows&ndash;Wheeler&ndash;Transformation'' &ndash; abgekürzt&nbsp; $\rm BWT$&nbsp; &ndash; bewirkt eine blockweise Sortierung der Zeichen eines Textes mit dem Ziel, den Text für die effiziente Datenkomprimierung mit Hilfe einer Lauflängencodierung oder einer Entropiecodierung aufzubereiten.
+
Die&nbsp;  ''Burrows&ndash;Wheeler&ndash;Transformation'' &ndash; abbreviated&nbsp; $\rm BWT$&nbsp; &ndash; causes a blockwise sorting of the characters of a text with the aim of preparing the text for efficient data compression with the help of run-length coding or entropy coding.
  
* Zunächst wird aus einem Block der Länge&nbsp; $N$&nbsp; eine&nbsp; $N&times;N$&ndash;Matrix erzeugt, wobei sich jede Zeile dieser ersten BWT&ndash;Matrix aus der Vorgängerzeile durch zyklische Linksverschiebung ergibt.
+
* First, an&nbsp; $N&times;N$&ndash; matrix is generated from a block of length&nbsp; $N$&nbsp;, with each row of this first&ndash;matrix resulting from the preceding row by cyclic left shift.  
  
* Danach wird die Matrix lexikografisch&nbsp; (ohne Sonderzeichen: &nbsp; alphabetisch)&nbsp; sortiert.&nbsp; Das Ergebnis der BWT ist die letzte Zeile der neuen&nbsp; BWT&ndash;Matrix, die so genannte&nbsp; $\text{L&ndash;Spalte}$&nbsp;  (von "Last", &nbsp; letzte Zeile der BWT&ndash;Matrix).
+
* Then the matrix is sorted lexicographically&nbsp; (without special characters: &nbsp; alphabetically)&nbsp;.&nbsp; The result of the BWT is the last row of the new BWT matrix, the so-called&nbsp; $\text{L&ndash;column}$&nbsp;  (from "Last", &nbsp; last row of the BWT&ndash;matrix).
  
* Weiter wird in dieser Aufgabe auf die&nbsp; $\text{F&ndash;Spalte}$&nbsp; (von "First", erste Zeile der BWT&ndash;Matrix) Bezug genommen, die man für die inverse Burrows&ndash;Wheeler&ndash;Transformation benötigt &nbsp; &#8658; &nbsp; Rekonstruktion des Originaltextes aus der L&ndash;Spalte.
+
* Further, this task refers to the&nbsp; $\text{F&ndash;column}$&nbsp; (from "First", first row of the BWT matrix), which is needed for the inverse Burrows&ndash;Wheeler&ndash;Transformation &nbsp; &#8658; &nbsp; reconstruction of the original text from the L&ndash;column.
  
* Für die inverse BWT benötigt man ferner den so genannten <i>Primärindex</i>&nbsp; $I$.&nbsp; Dieser gibt diejenige Zeile der BWT&ndash;Matrix an, in welcher der Algorithmus gestartet werden muss.
+
* For the inverse BWT, the so-called <i>primary index</i>&nbsp; $I$ is also required.&nbsp; This indicates the row of the BWT matrix in which the algorithm must be started.
  
  
Die Grafik zeigt das Ergebnis einer BWT, genauer gesagt deren L&ndash;Spalte.&nbsp; Aus dieser soll der Originaltext entsprechend der Beschreibung auf der Theorieseite&nbsp; [[Information_Theory/Weitere_Quellencodierverfahren#Burrows.E2.80.93Wheeler.E2.80.93Transformation|Burrows&ndash;Wheeler&ndash;Transformation]]&nbsp; rekonstruiert werden,  
+
The graphic shows the result of a BWT, more precisely its L&ndash;column.&nbsp; The original text is to be reconstructed from this according to the description on the theory page&nbsp; [[Information_Theory/Weitere_Quellencodierverfahren#Burrows.E2.80.93Wheeler.E2.80.93Transformation|Burrows&ndash;Wheeler Transformation]]&nbsp;,  
*wobei in Teilaufgabe&nbsp; '''(2)'''&nbsp; vom Primärindex&nbsp; $I = 7$  
+
*where in subtask&nbsp; '''(2)'''&nbsp; from the primary index&nbsp; $I = 7$  
*und in Teilaufgabe&nbsp; '''(3)'''&nbsp; von&nbsp; $I = 0$&nbsp; auszugehen ist.
+
*and in subtask&nbsp; '''(3)'''&nbsp; &nbsp; $I = 0$&nbsp; is to be assumed.
  
  
Line 25: Line 25:
  
  
''Hinweise:''
+
Hints:
*Die Aufgabe gehört zum  Kapitel&nbsp; [[Information_Theory/Weitere_Quellencodierverfahren|Weitere Quellencodierverfahren]].
+
*The task belongs to the chapter&nbsp; [[Information_Theory/Weitere_Quellencodierverfahren|Other source coding methods]].
*Insbesondere wird  Bezug genommen auf die Seite&nbsp; [[Information_Theory/Weitere_Quellencodierverfahren#Burrows.E2.80.93Wheeler.E2.80.93Transformation|Burrows&ndash;Wheeler&ndash;Transformation]].
+
*In particular, reference is made to the page&nbsp; [[Information_Theory/Weitere_Quellencodierverfahren#Burrows.E2.80.93Wheeler.E2.80.93Transformation|Burrows&ndash;Wheeler Transformation]].
*Weitere Informationen finden Sie in den beiden nachfolgend genannten Veröffentlichungen:
+
*Further information can be found in the two publications mentioned below:
 
: '''(1)''' &nbsp; Abel, J.: ''Verlustlose Datenkompression auf Grundlage der Burrows-Wheeler-Transformation''. <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; In: PIK - Praxis der Informationsverarbeitung und Kommunikation, no. 3, vol. 26, S. 140&ndash;144, Sept.  2003.  
 
: '''(1)''' &nbsp; Abel, J.: ''Verlustlose Datenkompression auf Grundlage der Burrows-Wheeler-Transformation''. <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; In: PIK - Praxis der Informationsverarbeitung und Kommunikation, no. 3, vol. 26, S. 140&ndash;144, Sept.  2003.  
 
: '''(2)''' &nbsp; Abel, J.: ''Grundlagen des Burrows-Wheeler-Kompressionsalgorithmus''. <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; In: Informatik Forschung & Entwicklung, no. 2, vol. 18, S. 80&ndash;87, Jan.  2004.
 
: '''(2)''' &nbsp; Abel, J.: ''Grundlagen des Burrows-Wheeler-Kompressionsalgorithmus''. <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; In: Informatik Forschung & Entwicklung, no. 2, vol. 18, S. 80&ndash;87, Jan.  2004.
  
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
{Wie lautet die zur vorgegebenen&nbsp; $\text{L&ndash;Spalte}$&nbsp; zugehörige&nbsp; $\text{F&ndash;Spalte}$?
+
{What is the&nbsp; $\text{F&ndash;Spalte}$ associated with the given&nbsp; $\text{L&ndash;Spalte}$&nbsp;?
 
|type="()"}
 
|type="()"}
 
- $\rm SEINMEINDEIN$,
 
- $\rm SEINMEINDEIN$,
Line 43: Line 43:
  
  
{Wie lautet das Ergebnis der Rekonstruktion mit dem Primärindex&nbsp; $\underline{I = 7}$?
+
{What is the result of the reconstruction with primary index&nbsp; $\underline{I = 7}$?
 
|type="()"}
 
|type="()"}
 
+ $\rm MEINDEINSEIN$,
 
+ $\rm MEINDEINSEIN$,
Line 50: Line 50:
  
  
{Was passiert, wenn bei der Rekonstruktion&nbsp; $\text{(BWT&ndash;Rücktransformation})$&nbsp; vom falschen Primärindex&nbsp; $I = 0$&nbsp; ausgegangen wird?
+
{What happens if the reconstruction&nbsp; $\text{(BWT back transformation})$&nbsp; starts from the wrong primary index&nbsp; $I = 0$&nbsp;?
 
|type="[]"}
 
|type="[]"}
- Es ergibt sich der Originaltext, von hinten nach vorne gelesen.
+
- The result is the original text, read from back to front.
+ Das Ergebnis ist eine zyklische Vertauschung des Originals.
+
+ The result is a cyclic permutation of the original.
  
  
{Warum ist die Burrows&ndash;Wheeler&ndash;Transformierte hinsichtlich einer späteren Datenkomprimierung besser geeignet als das Original?
+
Why is the Burrows&ndash;Wheeler transform better suited than the original with regard to a later data compression?
 
|type="[]"}
 
|type="[]"}
- Es ergeben sich günstigere Zeichenhäufigkeiten.
+
- It results in more favourable character frequencies.
- Alle Zeichen sind lexikografisch sortiert.
+
- All characters are sorted lexicographically.
+ Gleiche Zeichen folgen in der BWT öfter aufeinander.
+
+ Identical characters follow each other more often in the BWT.
  
  
Line 66: Line 66:
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solutions===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
'''(1)'''&nbsp; Richtig ist der <u>Lösungsvorschlag 3</u>:
+
'''(1)'''&nbsp; <u>Solution suggestion 3</u> is correct:
*Man bezeichnet die erste Spalte der BWT&ndash;Matrix auch als&nbsp; F&ndash;Spalte&nbsp; und die letzte Spalte als&nbsp; L&ndash;Spalte&nbsp; (von "<i>First</i>" bzw. "<i>Last</i>").  
+
*The first column of the BWT matrix is also called the&nbsp; F&ndash;column&nbsp; and the last column the&nbsp; L&ndash;column&nbsp; (from "<i>First</i>" or "<i>Last</i>").  
*Weitergegeben zur nächsten Codierstufe wird nur die&nbsp; L&ndash;Spalte.  
+
*Only the&nbsp; L&ndash;column is passed on to the next coding level.  
*Die&nbsp; F&ndash;Spalte, die zur Rücktransformation ebenfalls benötigt wird, ergibt sich aus der&nbsp; L&ndash;Spalte&nbsp; durch lexikografisches Sortieren.  
+
*The&nbsp; F&ndash;column, which is also needed for the reverse transformation, results from the&nbsp; L&ndash;column&nbsp; by lexicographic sorting.
  
  
  
'''(2)'''&nbsp; Richtig ist der <u>Lösungsvorschlag 1</u>: &nbsp; <b>MEINDEINSEIN</b>, wie aus der linken Darstellung der folgenden Grafik hervorgeht. <br>Beachten Sie, dass die obersten Zeile jeweils für die Zeilennummer&nbsp; $I = 0$&nbsp; steht. Zur Erklärung:
+
'''(2)'''&nbsp;<u>Solution suggestion 1</u> is correct: &nbsp; <b>MEINDEINSEIN</b> is correct, as can be seen from the left-hand representation of the following diagram. <br>Note that the top line represents the line number&nbsp; $I = 0$&nbsp; in each case. For explanation:
:[[File:P_ID2479__Inf_A_2_14b.png|right|frame|BW–Rücktransformation mit&nbsp; $I = 7$&nbsp; (links) bzw.&nbsp; $I = 0$&nbsp; (rechts)]]
+
:[[File:P_ID2479__Inf_A_2_14b.png|right|frame|BW back transformation with&nbsp; $I = 7$&nbsp; (left) or&nbsp; $I = 0$&nbsp; (right)]]
* Man beginnt die Decodierung mit der Zeile&nbsp;  $I = 7$&nbsp; der F&ndash;Spalte.&nbsp; Der Inhalt ist  "M".
+
* Start the decoding with the line&nbsp;  $I = 7$&nbsp; of the F&ndash;column.&nbsp; The content is "M".
* Man sucht das entsprechende "M" in der L&ndash;Spalte und findet es in der Zeilennummer "1".
+
* Search for the corresponding "M" in the L&ndash;column and find it in line number "1".
* Von Zeile 1 der L&ndash;Spalte geht man horizontal zur&nbsp; F&ndash;Spalte&nbsp; und findet das Symbol&nbsp; "E".
+
* From line 1 of the L&ndash;column one goes horizontally to the&nbsp; F&ndash;column&nbsp; and finds the symbol&nbsp; "E".
* In gleicher Weise findet man das dritte Ausgabesymbol&nbsp; "I"&nbsp; in der Zeile 4 der F&ndash;Spalte.
+
* Similarly, one finds the third output symbol&nbsp; "I"&nbsp; in line 4 of theF&ndash;column.
* Der Decodieralgorithmus endet mit dem Ausgabesymbol&nbsp; "N"&nbsp; in der drittletzten Zeile.
+
* The decoding algorithm ends with the output symbol&nbsp; "N"&nbsp; in the third last row.
  
  
  
'''(3)'''&nbsp; Richtig ist der <u>Lösungsvorschlag 2</u>: &nbsp; <br><br>$\rm DEINSEINMEIN$, wie aus der rechten Grafik hervorgeht.
+
'''(3)'''&nbsp; Correct is the <u>proposed solution 2</u>: &nbsp; <br><br>$\rm DEINSEINMEIN$, as shown in the graph on the right.
 
<br clear=all>
 
<br clear=all>
'''(4)'''&nbsp; Richtig ist der <u>Lösungsvorschlag 3</u>:  
+
'''(4)'''&nbsp; Correct is the <u>suggested solution 3</u>:  
*Bei der BWT sind hier vier Zeichen gleich ihren Vorgängern, im Original kein einziges.  
+
*In BWT, four characters here are equal to their predecessors, in the original none.  
*In der F&ndash;Spalte wären zwar aufgrund der lexikografischen Sortierung noch mehr Zeichen gleich wie die jeweiligen Vorgänger (insgesamt 6), aber diese Sortierung lässt sich nicht verlustlos rückgängig machen.  
+
*In the F&ndash;column , even more characters would be the same as their respective predecessors (6 in total) due to the lexicographical sorting, but this sorting cannot be reversed without loss.
*Auch der Lösungsvorschlag 1 ist falsch: &nbsp; Original und BWT beinhalten genau gleiche Zeichen&nbsp; $($dreimal&nbsp; $\rm E$,&nbsp; dreimal&nbsp; $\rm I$,&nbsp; dreimal&nbsp; $\rm N$ sowie je einmal&nbsp; $\rm D$,&nbsp; $\rm M$&nbsp; und&nbsp; $\rm S)$.
+
*Solution suggestion 1 is also wrong: &nbsp; the original and BWT contain exactly the same characters&nbsp; $($three times&nbsp; $\rm E$,&nbsp; three times&nbsp; $\rm I$,&nbsp; three times&nbsp; $\rm N$ and one each of&nbsp; $\rm D$,&nbsp; $\rm M$&nbsp; and&nbsp; $\rm S)$.
 
{{ML-Fuß}}
 
{{ML-Fuß}}
  

Revision as of 14:11, 9 August 2021

To be analysed
BWT result

Die  Burrows–Wheeler–Transformation – abbreviated  $\rm BWT$  – causes a blockwise sorting of the characters of a text with the aim of preparing the text for efficient data compression with the help of run-length coding or entropy coding.

  • First, an  $N×N$– matrix is generated from a block of length  $N$ , with each row of this first–matrix resulting from the preceding row by cyclic left shift.
  • Then the matrix is sorted lexicographically  (without special characters:   alphabetically) .  The result of the BWT is the last row of the new BWT matrix, the so-called  $\text{L–column}$  (from "Last",   last row of the BWT–matrix).
  • Further, this task refers to the  $\text{F–column}$  (from "First", first row of the BWT matrix), which is needed for the inverse Burrows–Wheeler–Transformation   ⇒   reconstruction of the original text from the L–column.
  • For the inverse BWT, the so-called primary index  $I$ is also required.  This indicates the row of the BWT matrix in which the algorithm must be started.


The graphic shows the result of a BWT, more precisely its L–column.  The original text is to be reconstructed from this according to the description on the theory page  Burrows–Wheeler Transformation ,

  • where in subtask  (2)  from the primary index  $I = 7$
  • and in subtask  (3)    $I = 0$  is to be assumed.




Hints:

(1)   Abel, J.: Verlustlose Datenkompression auf Grundlage der Burrows-Wheeler-Transformation.
            In: PIK - Praxis der Informationsverarbeitung und Kommunikation, no. 3, vol. 26, S. 140–144, Sept. 2003.
(2)   Abel, J.: Grundlagen des Burrows-Wheeler-Kompressionsalgorithmus.
            In: Informatik Forschung & Entwicklung, no. 2, vol. 18, S. 80–87, Jan. 2004.


Questions

1

What is the  $\text{F–Spalte}$ associated with the given  $\text{L–Spalte}$ ?

$\rm SEINMEINDEIN$,
$\rm NIIINEEEDSMN$,
$\rm DEEEIIIMNNNS$.

2

What is the result of the reconstruction with primary index  $\underline{I = 7}$?

$\rm MEINDEINSEIN$,
$\rm DEINSEINMEIN$,
$\rm NIESNIEDNIEM$.

3

What happens if the reconstruction  $\text{(BWT back transformation})$  starts from the wrong primary index  $I = 0$ ?

The result is the original text, read from back to front.
The result is a cyclic permutation of the original.
It results in more favourable character frequencies.
All characters are sorted lexicographically.
Identical characters follow each other more often in the BWT.


Solutions

(1)  Solution suggestion 3 is correct:

  • The first column of the BWT matrix is also called the  F–column  and the last column the  L–column  (from "First" or "Last").
  • Only the  L–column is passed on to the next coding level.
  • The  F–column, which is also needed for the reverse transformation, results from the  L–column  by lexicographic sorting.


(2) Solution suggestion 1 is correct:   MEINDEINSEIN is correct, as can be seen from the left-hand representation of the following diagram.
Note that the top line represents the line number  $I = 0$  in each case. For explanation:

BW back transformation with  $I = 7$  (left) or  $I = 0$  (right)
  • Start the decoding with the line  $I = 7$  of the F–column.  The content is "M".
  • Search for the corresponding "M" in the L–column and find it in line number "1".
  • From line 1 of the L–column one goes horizontally to the  F–column  and finds the symbol  "E".
  • Similarly, one finds the third output symbol  "I"  in line 4 of theF–column.
  • The decoding algorithm ends with the output symbol  "N"  in the third last row.


(3)  Correct is the proposed solution 2:  

$\rm DEINSEINMEIN$, as shown in the graph on the right.
(4)  Correct is the suggested solution 3:

  • In BWT, four characters here are equal to their predecessors, in the original none.
  • In the F–column , even more characters would be the same as their respective predecessors (6 in total) due to the lexicographical sorting, but this sorting cannot be reversed without loss.
  • Solution suggestion 1 is also wrong:   the original and BWT contain exactly the same characters  $($three times  $\rm E$,  three times  $\rm I$,  three times  $\rm N$ and one each of  $\rm D$,  $\rm M$  and  $\rm S)$.