Difference between revisions of "Aufgaben:Exercise 2.7: Huffman Application for Binary Two-Tuples"

From LNTwww
Line 3: Line 3:
 
}}
 
}}
  
[[File:P_ID2455__Inf_A_2_7.png|right|frame|Drei Binärcodes für  $M = 4$]]
+
[[File:P_ID2455__Inf_A_2_7.png|right|frame|Three binary codes for  $M = 4$]]
Die Anwendung des Huffman–Algorithmus in seiner ursprünglichen Form setzt einen Symbolumfang  $M > 2$  voraus und ist deshalb zur Datenkomprimierung von Binärquellen unbrauchbar.
+
The application of the Huffman algorithm in its original form assumes a symbol set  $M > 2$  and is therefore useless for data compression of binary sources.
  
Fasst man aber mehrere aufeinanderfolgende Binärzeichen der Nachrichtenquelle zu einem neuen Symbol zusammen, so kann man auf die neue Symbolmenge die Huffman–Datenkomprimierung sinnvoll anwenden.
+
However, if one combines several consecutive binary characters of the message source into a new symbol, one can usefully apply Huffman data compression to the new symbol set.
  
Wir gehen in dieser Aufgabe von der Symbolmenge  $\{$ $\rm X$,  $\rm Y$ $\}$   ⇒  aus   $(M = 2)$  und bilden gemäß obiger Tabelle Zweiertupel mit dem Symbolvorrat  $\{$ $\rm A$,  $\rm B$,  $\rm C$,  $\rm D$ $\}$  ⇒  $(M\hspace{0.03cm}' = M^2 = 4)$.   
+
In this task we start from the symbol set  $\{$ $\rm X$,  $\rm Y$ $\}$   ⇒  aus   $(M = 2)$  and form two-tuples according to the table above with the symbol set  $\{$ $\rm A$,  $\rm B$,  $\rm C$,  $\rm D$ $\}$  ⇒  $(M\hspace{0.03cm}' = M^2 = 4)$.   
  
Beispielsweise wird somit aus der binären Quellensymbolfolge  $\rm XYXXYXXXYY$  die quaternäre Folge   $\rm BACAD$.
+
For example, the binary source symbol sequence  $\rm XYXXYXXXYY$  thus becomes the quaternary sequence   $\rm BACAD$.
  
Desweiteren sind in obiger Tabelle drei Codes angegeben, von denen manche durch den Huffman–Algorithmus entstanden sind. Die binären Ausgangsfolgen ergeben sich dann für unser Beispiel wie folgt:
+
Furthermore, three codes are given in the above table, some of which have been created by the Huffman algorithm. The binary output sequences then result for our example as follows:
  
 
* $\text{Code 1}$: &nbsp;&nbsp;<b>1011011100</b>,
 
* $\text{Code 1}$: &nbsp;&nbsp;<b>1011011100</b>,
Line 19: Line 19:
  
  
Nochmals zum Verständnis:  
+
Again for understanding:
*Aus der ursprünglichen Symbolmenge&nbsp; $\{$ $\rm X$,&nbsp; $\rm Y$ $\}$&nbsp; erhält man durch Bildung von Zweiertupeln eine Quaternärmenge mit  Symbolvorrat&nbsp; $\{$ $\rm A$,&nbsp; $\rm B$,&nbsp; $\rm C$,&nbsp; $\rm D$ $\}$.&nbsp;  
+
*From the original symbol set&nbsp; $\{$ $\rm X$,&nbsp; $\rm Y$ $\}$&nbsp; a quaternary set with symbol set&nbsp; $\{$ $\rm A$,&nbsp; $\rm B$,&nbsp; $\rm C$,&nbsp; $\rm D$ $\}$ is obtained by forming two-tuples.&nbsp;  
*Die Folgenlänge $N$ wird dadurch auf&nbsp; $N\hspace{0.03cm}' = N/2 $&nbsp; halbiert.  
+
*The sequence length $N$ is thereby halved to&nbsp; $N\hspace{0.03cm}' = N/2 $&nbsp;.
*Durch Huffman&ndash;Codierung ergibt sich wieder eine Binärfolge, deren Symbolmenge zur besseren Unterscheidung mit&nbsp; $\{$<b>0</b>,&nbsp; <b>1</b>$\}$&nbsp; bezeichnet wird.  
+
*Huffman coding again results in a binary sequence whose symbol set is designated&nbsp; $\{$<b>0</b>,&nbsp; <b>1</b>$\}$&nbsp; for better differentiation.  
*Die Anwendung der Huffman&ndash;Codierung macht genau dann Sinn, wenn die Länge&nbsp; $L$&nbsp; der Ausgangsfolge (im statistischen Mittel) kleiner ist als&nbsp; $N$.
+
*The application of Huffman coding makes sense exactly when the length&nbsp; $L$&nbsp; of the initial sequence is smaller than&nbsp; $N$ (on statistical average).
  
  
Mit dieser Aufgabe soll geklärt werden, welche der vorgegebenen Binärcodes bei welchen Randbedingungen sinnvoll sind.  
+
This task is intended to clarify which of the given binary codes make sense under which boundary conditions.  
*Die binäre Nachrichtenquelle&nbsp; $\{$ $\rm X$,&nbsp; $\rm Y$ $\}$&nbsp; sei gedächtnislos und wird allein durch die Symbolwahrscheinlichkeit&nbsp; $p_{\rm X}$&nbsp; beschrieben.  
+
*Let the binary message source&nbsp; $\{$ $\rm X$,&nbsp; $\rm Y$ $\}$&nbsp; be memoryless and be described solely by the symbol probability&nbsp; $p_{\rm X}$&nbsp;.  
*Die zweite Wahrscheinlichkeit ist dann stets&nbsp; $p_{\rm Y} = 1 - p_{\rm X}$.
+
*The second probability is then always&nbsp; $p_{\rm Y} = 1 - p_{\rm X}$.
  
  
Line 37: Line 37:
  
  
''Hinweise:''  
+
''Hints:''  
*Die Aufgabe gehört zum  Kapitel&nbsp; [[Information_Theory/Entropiecodierung_nach_Huffman|Entropiecodierung nach Huffman]].
+
*The task belongs to the chapter&nbsp; [[Information_Theory/Entropiecodierung_nach_Huffman|Entropy Coding according to Huffman]].
*Insbesondere wird auf die Seite&nbsp; [[Information_Theory/Entropiecodierung_nach_Huffman#Anwendung_der_Huffman.E2.80.93Codierung_auf_.7F.27.22.60UNIQ-MathJax164-QINU.60.22.27.7F.E2.80.93Tupel|Anwendung der Huffman-Codierung auf&nbsp; $k$-Tupel]]&nbsp;  Bezug genommen.
+
*In particular, reference is made to the page&nbsp; [[Information_Theory/Entropiecodierung_nach_Huffman#Application_of_Huffman_coding_to_.7F.27.22.60UNIQ-MathJax168-QINU.60.22.27.7F.E2.80.93tuples|Application of Huffman coding to&nbsp; $k$-tuples]]&nbsp;  Bezug genommen.
*Die mittlere Codewortlänge pro Zweiertupel ist&nbsp;  $L_{\rm M}\hspace{0.03cm}' = p_{\rm A} \cdot L_{\rm A} +$&nbsp; ... &nbsp;$ + p_{\rm D} \cdot L_{\rm D} \hspace{0.05cm}$.&nbsp; Bezogen auf ein Quellensymbol gilt&nbsp; $L_{\rm M} = L_{\rm M}\hspace{0.03cm}'/2$.
+
*The mean codeword length per two-tuple is&nbsp;  $L_{\rm M}\hspace{0.03cm}' = p_{\rm A} \cdot L_{\rm A} +$&nbsp; ... &nbsp;$ + p_{\rm D} \cdot L_{\rm D} \hspace{0.05cm}$.&nbsp; With respect to a source symbol,&nbsp; $L_{\rm M} = L_{\rm M}\hspace{0.03cm}'/2$.
*Eine vergleichbare Aufgabenstellung mit ternären Eingangssymbolen wird in der&nbsp;  [[Aufgaben:2.7Z_Huffman-Codierung_für_Zweiertupel_einer_Ternärquelle|Aufgabe 2.7Z]]&nbsp; behandelt.
+
*A comparable task with ternary input symbols is treated in&nbsp;  [[Aufgaben:2.7Z_Huffman-Codierung_für_Zweiertupel_einer_Ternärquelle|exercise 2.7Z]]&nbsp;.
 
   
 
   
*Die Idee zu dieser Aufgabe entstand bei einem Vortrag von&nbsp; [http://www.uni-ulm.de/nt/staff/professors/fischer/ Prof. Robert Fischer]&nbsp; von der Universität Ulm an der TU München zum Thema "Der goldene Schnitt in der Nachrichtentechnik".
+
*The idea for this task arose during a lecture by&nbsp; [http://www.uni-ulm.de/nt/staff/professors/fischer/ Prof. Robert Fischer]&nbsp; from the University of Ulm at the Technical University of Munich on the topic of "Der goldene Schnitt in der Nachrichtentechnik".
  
  
  
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
{Geben Sie die Codewortlängen bei redundanzfreier Binärquelle an.
+
{Give the code word lengths with redundancy-free binary source.
 
|type="{}"}
 
|type="{}"}
$\text{Code 1}$:  &nbsp; $L_{\rm M} \ = \ $ { 1 1% } $\ \rm bit/Quellensymbol$
+
$\text{Code 1}$:  &nbsp; $L_{\rm M} \ = \ $ { 1 1% } $\ \rm bit/source symbol$
$\text{Code 2}$:  &nbsp; $L_{\rm M} \ = \ $ { 1.125 1% } $\ \rm bit/Quellensymbol$
+
$\text{Code 2}$:  &nbsp; $L_{\rm M} \ = \ $ { 1.125 1% } $\ \rm bit/source symbol$
$\text{Code 3}$:  &nbsp; $L_{\rm M} \ = \ $ { 1.25 1% } $\ \rm bit/Quellensymbol$
+
$\text{Code 3}$:  &nbsp; $L_{\rm M} \ = \ $ { 1.25 1% } $\ \rm bit/source symbol$
  
  
  
{Ermitteln Sie den Huffman&ndash;Code hinsichtlich Zweiertupel für &nbsp;$p_{\rm X}= 0.6$.
+
{Determine the Huffman code with respect to two-tuple for &nbsp;$p_{\rm X}= 0.6$.
 
|type="[]"}
 
|type="[]"}
+ Es ergibt sich&nbsp; $\text{Code 1}$.
+
+ The result is&nbsp; $\text{Code 1}$.
- Es ergibt sich&nbsp; $\text{Code 2}$.
+
- The result is&nbsp; $\text{Code 2}$.
- Es ergibt sich&nbsp; $\text{Code 3}$.
+
- The result is&nbsp; $\text{Code 3}$.
  
  
{Wie groß ist die mittlere Codewortlänge des für &nbsp;$p_{\rm X}= 0.6$&nbsp; besten Huffman&ndash;Codes?
+
{What is the mean codeword length of the best Huffman code for &nbsp;$p_{\rm X}= 0.6$&nbsp;?
 
|type="{}"}
 
|type="{}"}
$L_{\rm M} \ = \ $ { 1 1% } $\ \rm bit/Quellensymbol$
+
$L_{\rm M} \ = \ $ { 1 1% } $\ \rm bit/source symbol$
  
  
{Ermitteln Sie den Huffman&ndash;Code hinsichtlich Zweiertupel für &nbsp;$p_{\rm X}= 0.8$.
+
{Determine the Huffman code with respect to two-tuple for &nbsp;$p_{\rm X}= 0.8$.
 
|type="[]"}
 
|type="[]"}
- Es ergibt sich&nbsp; $\text{Code 1}$.
+
- The result is&nbsp; $\text{Code 1}$.
+ Es ergibt sich&nbsp; $\text{Code 2}$.
+
+ The result is&nbsp; $\text{Code 2}$.
- Es ergibt sich&nbsp; $\text{Code 3}$.
+
- The result is&nbsp; $\text{Code 3}$.
  
  
{Wie groß ist die mittlere Codewortlänge des für &nbsp;$p_{\rm X}= 0.8$&nbsp; besten Huffman&ndash;Codes?
+
{What is the mean codeword length of the best Huffman code for &nbsp;$p_{\rm X}= 0.8$&nbsp;?
 
|type="{}"}
 
|type="{}"}
$L_{\rm M} \ = \ $ { 0.78 1% } $\ \rm bit/Quellensymbol$
+
$L_{\rm M} \ = \ $ { 0.78 1% } $\ \rm bit/source symbol$
  
  
{In welchem Bereich darf die Wahrscheinlichkeit &nbsp;$p_{\rm X}$&nbsp; für das Symbol&nbsp; $\rm X$&nbsp; liegen, damit sich nach Huffman der&nbsp; $\text{Code 1}$&nbsp; ergibt?
+
{In what range may the probability &nbsp;$p_{\rm X}$&nbsp; for the symbol&nbsp; $\rm X$&nbsp; lie so that the&nbsp; $\text{code 1}$&nbsp; results according to Huffman?
 
|type="{}"}
 
|type="{}"}
 
$p_\text{X, min}\ = \ $ { 0.382 1% }
 
$p_\text{X, min}\ = \ $ { 0.382 1% }
Line 92: Line 92:
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solution===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
 
'''(1)'''&nbsp; Bei redundanzfreier Binärquelle &nbsp;$(p_{\rm X} = p_{\rm Y} = 0.5)$&nbsp; erhält man &nbsp;$p_{\rm A} = p_{\rm B} = p_{\rm C} = p_{\rm D} =  0.25$&nbsp; und mit der angegebenen Gleichung:
 
'''(1)'''&nbsp; Bei redundanzfreier Binärquelle &nbsp;$(p_{\rm X} = p_{\rm Y} = 0.5)$&nbsp; erhält man &nbsp;$p_{\rm A} = p_{\rm B} = p_{\rm C} = p_{\rm D} =  0.25$&nbsp; und mit der angegebenen Gleichung:

Revision as of 13:20, 3 August 2021

Three binary codes for  $M = 4$

The application of the Huffman algorithm in its original form assumes a symbol set  $M > 2$  and is therefore useless for data compression of binary sources.

However, if one combines several consecutive binary characters of the message source into a new symbol, one can usefully apply Huffman data compression to the new symbol set.

In this task we start from the symbol set  $\{$ $\rm X$,  $\rm Y$ $\}$  ⇒  aus  $(M = 2)$  and form two-tuples according to the table above with the symbol set  $\{$ $\rm A$,  $\rm B$,  $\rm C$,  $\rm D$ $\}$  ⇒  $(M\hspace{0.03cm}' = M^2 = 4)$. 

For example, the binary source symbol sequence  $\rm XYXXYXXXYY$  thus becomes the quaternary sequence  $\rm BACAD$.

Furthermore, three codes are given in the above table, some of which have been created by the Huffman algorithm. The binary output sequences then result for our example as follows:

  • $\text{Code 1}$:   1011011100,
  • $\text{Code 2}$:   0110011000,
  • $\text{Code 3}$:   10011001110.


Again for understanding:

  • From the original symbol set  $\{$ $\rm X$,  $\rm Y$ $\}$  a quaternary set with symbol set  $\{$ $\rm A$,  $\rm B$,  $\rm C$,  $\rm D$ $\}$ is obtained by forming two-tuples. 
  • The sequence length $N$ is thereby halved to  $N\hspace{0.03cm}' = N/2 $ .
  • Huffman coding again results in a binary sequence whose symbol set is designated  $\{$01$\}$  for better differentiation.
  • The application of Huffman coding makes sense exactly when the length  $L$  of the initial sequence is smaller than  $N$ (on statistical average).


This task is intended to clarify which of the given binary codes make sense under which boundary conditions.

  • Let the binary message source  $\{$ $\rm X$,  $\rm Y$ $\}$  be memoryless and be described solely by the symbol probability  $p_{\rm X}$ .
  • The second probability is then always  $p_{\rm Y} = 1 - p_{\rm X}$.





Hints:

  • The task belongs to the chapter  Entropy Coding according to Huffman.
  • In particular, reference is made to the page  Application of Huffman coding to  $k$-tuples  Bezug genommen.
  • The mean codeword length per two-tuple is  $L_{\rm M}\hspace{0.03cm}' = p_{\rm A} \cdot L_{\rm A} +$  ...  $ + p_{\rm D} \cdot L_{\rm D} \hspace{0.05cm}$.  With respect to a source symbol,  $L_{\rm M} = L_{\rm M}\hspace{0.03cm}'/2$.
  • A comparable task with ternary input symbols is treated in  exercise 2.7Z .
  • The idea for this task arose during a lecture by  Prof. Robert Fischer  from the University of Ulm at the Technical University of Munich on the topic of "Der goldene Schnitt in der Nachrichtentechnik".



Questions

1

Give the code word lengths with redundancy-free binary source.

$\text{Code 1}$:   $L_{\rm M} \ = \ $

$\ \rm bit/source symbol$
$\text{Code 2}$:   $L_{\rm M} \ = \ $

$\ \rm bit/source symbol$
$\text{Code 3}$:   $L_{\rm M} \ = \ $

$\ \rm bit/source symbol$

2

Determine the Huffman code with respect to two-tuple for  $p_{\rm X}= 0.6$.

The result is  $\text{Code 1}$.
The result is  $\text{Code 2}$.
The result is  $\text{Code 3}$.

3

What is the mean codeword length of the best Huffman code for  $p_{\rm X}= 0.6$ ?

$L_{\rm M} \ = \ $

$\ \rm bit/source symbol$

4

Determine the Huffman code with respect to two-tuple for  $p_{\rm X}= 0.8$.

The result is  $\text{Code 1}$.
The result is  $\text{Code 2}$.
The result is  $\text{Code 3}$.

5

What is the mean codeword length of the best Huffman code for  $p_{\rm X}= 0.8$ ?

$L_{\rm M} \ = \ $

$\ \rm bit/source symbol$

6

In what range may the probability  $p_{\rm X}$  for the symbol  $\rm X$  lie so that the  $\text{code 1}$  results according to Huffman?

$p_\text{X, min}\ = \ $

$p_\text{X, max}\ = \ $


Solution

(1)  Bei redundanzfreier Binärquelle  $(p_{\rm X} = p_{\rm Y} = 0.5)$  erhält man  $p_{\rm A} = p_{\rm B} = p_{\rm C} = p_{\rm D} = 0.25$  und mit der angegebenen Gleichung:

$$L_{\rm M} = \big [ \hspace{0.05cm}p_{\rm A} \cdot L_{\rm A} + p_{\rm B} \cdot L_{\rm B} + p_{\rm C} \cdot L_{\rm C} + p_{\rm D} \cdot L_{\rm D} \hspace{0.05cm} \big ] / 2 = \big [ \hspace{0.05cm} L_{\rm A} + L_{\rm B} + L_{\rm C} + L_{\rm D}\hspace{0.05cm} \big ] / 8 \hspace{0.05cm}.$$

Berücksichtigt man die angegebenen Zuordnungen, so erhält man für

  • $\text{Code 1}$:    $L_{\rm M} \hspace{0.15cm}\underline{= 1.000 \ {\rm bit/Quellensymbol} }$,
  • $\text{Code 2}$:    $L_{\rm M} \hspace{0.15cm}\underline{= 1.125 \ {\rm bit/Quellensymbol} }$,
  • $\text{Code 3}$:    $L_{\rm M} \hspace{0.15cm}\underline{= 1.250 \ {\rm bit/Quellensymbol} }$.
Im Verlauf der Aufgabe wird sich zeigen, dass die beiden ersten Codes durchaus als Ergebnis des Huffman–Algorithmus möglich sind  (natürlich nur bei geeigneten Symbolwahrscheinlichkeiten).  Der  $\text{Code 3}$  ist zwar ebenfalls präfixfrei, aber hinsichtlich der mittleren Codewortlänge nie optimal.


(2)  Die Wahrscheinlichkeiten der möglichen Zweiertupel lauten:

$$p_{\rm A} = 0.6^2 = 0.36 \hspace{0.05cm}, \hspace{0.4cm}p_{\rm B}= 0.6 \cdot 0.4 = 0.24 = p_{\rm C} \hspace{0.05cm},\hspace{0.4cm} p_{\rm D}= 0.4^2 = 0.16 \hspace{0.05cm}.$$
  • Damit ergibt sich das  linke Baumdiagramm  (in nebenstehender Grafik) und der folgende Huffman–Code:
Huffman–Baumdiagramm für zwei unterschiedliche Zweiertupel–Konstellationen
    $\rm A$   →   11,   $\rm B$   →   10,   $\rm C$   →   01,   $\rm D$   →   00.
  • Es handelt sich um den  $\text{Code 1}$   ⇒   Lösungsvorschlag 1.


(3)  Jedes Zweiertupel wird durch zwei Bit dargestellt.  Damit ist

$$L_{\rm M} \hspace{0.15cm}\underline{= 1.000 \ {\rm bit/Quellensymbol} }.$$


(4)  Hier lauten die Wahrscheinlichkeiten der einzelnen Zweiertupel:

$$p_{\rm A} = 0.8^2 = 0.64 \hspace{0.05cm}, \hspace{0.4cm}p_{\rm B}= 0.8 \cdot 0.2 = 0.16 \hspace{0.05cm}, $$
$$p_{\rm C} = p_{\rm B}= 0.8 = 0.16 \hspace{0.05cm},\hspace{0.4cm} p_{\rm D}= 0.2^2 = 0.04 \hspace{0.05cm}. $$

Entsprechend dem rechten Baumdiagramm ergibt sich nun der  $\text{Code 2}$   ⇒   Lösungsvorschlag 2:

    $\rm A$   →   1,   $\rm B$   →   01,   $\rm C$   →   001,   $\rm D$   →   010.


(5)  Beim  $\text{Code 2}$  gilt für die mittlere Zweiertupellänge bzw. die mittlere Codewortlänge:

$$L_{\rm M}\hspace{0.01cm}' = 0.64 \cdot 1 + 0.16 \cdot 2 + (0.16 + 0.04) \cdot 3 = 1.56\,{\rm bit/Zweiertupel}\hspace{0.3cm} \Rightarrow\hspace{0.3cm}L_{\rm M} = {L_{\rm M}\hspace{0.01cm}'}/{2}\hspace{0.15cm}\underline{ = 0.78\,{\rm bit/Quellensymbol}}\hspace{0.05cm}.$$


(6)  Aus den früheren Teilaufgaben hat sich ergeben:

  • Für  $p_{\rm X} = 0.6$  ist der  $\text{Code 1}$  optimal und die mittlere Codewortlänge dieses Codes ist  $($unabhängig von  $p_{\rm X})$  $L_{\rm M} = 1$  bit/Quellensymbol.
  • Für  $p_{\rm X} = 0.8$  entsprechend der Teilaufgabe  (4)  ist der  $\text{Code 2}$  optimal und die mittlere Codewortlänge beträgt  $L_{\rm M} = 0.78$  bit/Quellensymbol.


Der gesuchte Maximalwert  $p_\text{X, max}$  wird somit zwischen  $0.6$  und  $0.8$  liegen.  Die Bestimmungsgleichung ist dabei, dass für den Grenzfall  $p_\text{X} = p_\text{X, max}$  beide Codes genau die gleiche mittlere Codewortlänge  $L_{\rm M} = 1$  bit/Quellensymbol besitzen, bzw.  $L_{\rm M}\hspace{0.03cm}' = 2$  bit/Zweiertupel.

  • Mit der Abkürzung  $p = p_\text{X, max}$  lautet die entsprechende Bestimmungsgleichung:
$$L_{\rm M}\hspace{0.01cm}'\hspace{0.15cm}{\rm (Code \hspace{0.15cm}2)} = p^2 \cdot 1 + p \cdot (1-p) \cdot 2 + p \cdot (1-p) \cdot 3 + (1-p)^2 \cdot 3 \stackrel{!}{=} 2 \hspace{0.05cm}.$$
  • Dies führt zum zahlenmäßigen Ergebnis:
$$p^2 + p - 1 \stackrel{!}{=} 0 \hspace{0.3cm}\Rightarrow\hspace{0.3cm} p_{\rm X,\hspace{0.05cm}max} = p = \frac{\sqrt{5}-1}{2} \hspace{0.15cm}\underline{ \approx 0.618} \hspace{0.05cm}.$$
  • Da sich die grundsätzliche Huffman–Struktur durch Vertauschen von  $\rm X$  und  $\rm Y$  nicht ändert, gilt für die untere Grenze:
$$p_{\rm X,\hspace{0.05cm}min} = 1 - p_{\rm X,\hspace{0.05cm}max}\hspace{0.15cm}\underline{ \approx 0.382} \hspace{0.05cm}.$$

Die Darstellung der Zweiertupel durch unterschiedlich lange Bitfolgen  $\text{(Code 2)}$  macht also nur Sinn, wenn sich die Symbolwahrscheinlichkeiten von  $\rm X$  und  $\rm Y$  signifikant unterscheiden.  Liegen diese dagegen zwischen  $0.382$  und  $0.618$, so ist der  $\text{Code 1}$  anzuwenden.

Die Aufteilung einer Strecke der Länge  $1$  in zwei Abschnitte der Länge  $0.618$...  und  $0.382$...  bezeichnet man als  Goldenen Schnitt, auf den man in den verschiedensten Fachgebieten immer wieder stößt.