Difference between revisions of "Aufgaben:Exercise 1.1Z: Binary Entropy Function"

From LNTwww
m (Text replacement - "Category:Aufgaben zu Informationstheorie" to "Category:Information Theory: Exercises")
Line 3: Line 3:
 
}}
 
}}
  
[[File:P_ID2234__Inf_Z_1_1.png|right|frame|Binäre Entropiefunktion <br>in &bdquo;bit&rdquo; und &bdquo;nat&rdquo;]]
+
[[File:P_ID2234__Inf_Z_1_1.png|right|frame|Binary entropy function <br>in &bdquo;bits&rdquo; und &bdquo;nats&rdquo;]]
Wir betrachten eine Folge von binären Zufallsgrößen mit dem Symbolvorrat&nbsp; $\{ \rm A, \ B \}$ &nbsp; &rArr; &nbsp; $M = 2$.&nbsp; Die Auftrittswahrscheinlichkeiten der beiden Symbole seien&nbsp; $p_{\rm A }= p$ &nbsp;und&nbsp; $p_{\rm B } = 1 - p$.
+
We consider a sequence of binary random variables with the symbol set&nbsp; $\{ \rm A, \ B \}$ &nbsp; &rArr; &nbsp; $M = 2$.&nbsp; Let the probabilities of occurrence of the two symbols be&nbsp; $p_{\rm A }= p$ &nbsp;and&nbsp; $p_{\rm B } = 1 - p$.
  
Die einzelnen Folgenelemente sind statistisch unabhängig.&nbsp; Für die Entropie dieser Nachrichtenquelle gilt gleichermaßen:
+
The individual sequence elements are statistically independent.&nbsp; The entropy of this message source is equally valid:
 
:$$H_{\rm bin}(p) \hspace{0.1cm}  =  \hspace{0.1cm}  p \cdot {\rm ld}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm ld}\hspace{0.1cm}\frac{1}{1-p}\hspace{0.15cm}{\rm in \hspace{0.15cm} \big [bit \big  ]}\hspace{0.05cm},$$
 
:$$H_{\rm bin}(p) \hspace{0.1cm}  =  \hspace{0.1cm}  p \cdot {\rm ld}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm ld}\hspace{0.1cm}\frac{1}{1-p}\hspace{0.15cm}{\rm in \hspace{0.15cm} \big [bit \big  ]}\hspace{0.05cm},$$
 
:$$ H'_{\rm bin}(p) \hspace{0.1cm}  =  \hspace{0.1cm}  p \cdot {\rm ln}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm ln}\hspace{0.1cm}\frac{1}{1-p}\hspace{0.15cm}{\rm in \hspace{0.15cm} \big [nat\big ]}\hspace{0.05cm}.$$
 
:$$ H'_{\rm bin}(p) \hspace{0.1cm}  =  \hspace{0.1cm}  p \cdot {\rm ln}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm ln}\hspace{0.1cm}\frac{1}{1-p}\hspace{0.15cm}{\rm in \hspace{0.15cm} \big [nat\big ]}\hspace{0.05cm}.$$
In diesen Gleichungen werden als Kurzbezeichnungen verwendet:
+
In these equations, the shorthand terms used are:
  
* der <i>natürliche</i>&nbsp; Logarithmus &nbsp; &rArr; &nbsp; $ {\ln} \hspace{0.09cm} p = \log_{\rm e} \hspace{0.05cm} p$,
 
* der Logarithmus <i>dualis</i> &nbsp; &rArr; &nbsp; ${\rm ld} \hspace{0.09cm} p = \log_2 \hspace{0.05cm} p$.
 
  
 +
* the <i>natural</i>&nbsp; logarithm &nbsp; &rArr; &nbsp; $ {\ln} \hspace{0.09cm} p = \log_{\rm e} \hspace{0.05cm} p$,
 +
* the <i>binary</i> &nbsp; logarithm &rArr; &nbsp; ${\rm ld} \hspace{0.09cm} p = \log_2 \hspace{0.05cm} p$.
  
Die Grafik zeigt die binäre Entropiefunktion in Abhängigkeit des Parameters&nbsp; $p$, wobei&nbsp; $0 ≤ p ≤ 1$&nbsp; vorausgesetzt wird.
 
  
In den Teilaufgaben&nbsp; '''(5)'''&nbsp; und&nbsp; '''(6)'''&nbsp; soll der relative Fehler ermittelt werden, wenn die Symbolwahrscheinlichkeit &nbsp;$p$&nbsp; per Simulation&nbsp; $($also als relative Häufigkeit&nbsp; $h)$&nbsp; ermittelt wurde und sich dabei fälschlicherweise &nbsp;$h = 0.9 \cdot p$&nbsp; ergeben hat.&nbsp; Der relative Fehler ist dann wie folgt gegeben:
+
The plot shows the binary entropy function as a function of the parameter&nbsp; $p$, assuming&nbsp; $0 ≤ p ≤ 1$&nbsp;.
 +
 
 +
In subtasks&nbsp; '''(5)'''&nbsp; and&nbsp; '''(6)'''&nbsp; the relative error is to be determined if the symbol probability &nbsp;$p$&nbsp; was determined by simulation&nbsp; $($i.e., as a relative frequency&nbsp; $h)$&nbsp;, resulting in &nbsp;$h = 0.9 \cdot p$&nbsp; by mistake.&nbsp; The relative error is then given as follows:
 
:$$\varepsilon_{H} = \frac{H_{\rm bin}(h)- H_{\rm bin}(p)}{H_{\rm bin}(p)}\hspace{0.05cm}.$$
 
:$$\varepsilon_{H} = \frac{H_{\rm bin}(h)- H_{\rm bin}(p)}{H_{\rm bin}(p)}\hspace{0.05cm}.$$
  
Line 25: Line 26:
  
  
''Hinweis:''  
+
''Hint:''  
*Die Aufgabe gehört zum  Kapitel&nbsp; [[Information_Theory/Gedächtnislose_Nachrichtenquellen|Gedächtnislose Nachrichtenquellen]].
+
*The task belongs to the chapter&nbsp; [[Information_Theory/Gedächtnislose_Nachrichtenquellen|Discrete Memoryless Sources]].
 
   
 
   
  
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
{Wie hängen&nbsp; $H_{\rm bin}(p)$&nbsp; mit der Einheit &bdquo;bit&rdquo; und&nbsp; $H'_{\rm bin}(p)$&nbsp; mit der Einheit &bdquo;nat&rdquo; zusammen?
+
{How are&nbsp; $H_{\rm bin}(p)$&nbsp; related to the unit &bdquo;bit&rdquo; and&nbsp; $H'_{\rm bin}(p)$&nbsp; related to the unit &bdquo;nat&rdquo;?
 
|type="[]"}
 
|type="[]"}
+ $H_{\rm bin}(p)$&nbsp; und&nbsp; $H'_{\rm bin}(p)$&nbsp; unterscheiden sich um einen Faktor.
+
+ $H_{\rm bin}(p)$&nbsp; and&nbsp; $H'_{\rm bin}(p)$&nbsp; differ by a factor.
- Es gilt&nbsp; $H'_{\rm bin}(p) = H_{\rm bin}(\ln \ p)$.
+
- It holds that&nbsp; $H'_{\rm bin}(p) = H_{\rm bin}(\ln \ p)$.
- Es gilt&nbsp; $H'_{\rm bin}(p) = 1 + H_{\rm bin}(2 p)$.
+
- It holds that&nbsp; $H'_{\rm bin}(p) = 1 + H_{\rm bin}(2 p)$.
  
  
{Zeigen Sie, dass sich das Maximum der binären Entropiefunktion für&nbsp; $p = 0.5$&nbsp; ergibt.&nbsp; Wie groß ist&nbsp; $H_\text{bin}(p = 0.5)$?
+
{Show that the maximum of the binary entropy function is obtained for&nbsp; $p = 0.5$&nbsp;.&nbsp; What is&nbsp; $H_\text{bin}(p = 0.5)$?
 
|type="{}"}
 
|type="{}"}
 
$H_\text{bin}(p = 0.5) \ = \ $  { 1 } $\ \rm bit$
 
$H_\text{bin}(p = 0.5) \ = \ $  { 1 } $\ \rm bit$
  
  
{Berechnen Sie den binären Entropiewert für&nbsp; $p = 0.05$.
+
{Calculate the binary entropy value for&nbsp; $p = 0.05$.
 
|type="{}"}
 
|type="{}"}
 
$H_\text{bin}(p = 0.05) \ =  \ $ { 0.286 3% } $\ \rm bit$
 
$H_\text{bin}(p = 0.05) \ =  \ $ { 0.286 3% } $\ \rm bit$
  
  
{Geben Sie den größeren der beiden&nbsp; $p$&ndash;Werte ein, die sich aus der Gleichung&nbsp; $H_\text{bin}(p)= 0.5 \ \rm bit$&nbsp; ergeben.
+
Enter the larger of the two&nbsp; $p$&ndash;values given by the equation &nbsp; $H_\text{bin}(p)= 0.5 \ \rm bit$&nbsp;.
 
|type="{}"}
 
|type="{}"}
 
$p \ =  \ $ { 0.89 3% }
 
$p \ =  \ $ { 0.89 3% }
  
  
{Durch unzureichende Simulation wurde&nbsp; $p = 0.5$&nbsp; um&nbsp; $10\%$ zu niedrig ermittelt.&nbsp; Wie groß ist der prozentuale Fehler hinsichtlich der Entropie?
+
{Due to insufficient simulation,&nbsp; $p = 0.5$&nbsp; was determined&nbsp; $10\%$ too low.&nbsp; What is the percentage error with respect to entropy?
 
|type="{}"}
 
|type="{}"}
$p = 0.45\ \ {\rm statt}\ \ p=0.5\hspace{-0.1cm}:\ \ \varepsilon_H \ =  \ $ { -0.72--0.68 } $\ \rm \%$
+
$p = 0.45\ \ {\rm instead of}\ \ p=0.5\hspace{-0.1cm}:\ \ \varepsilon_H \ =  \ $ { -0.72--0.68 } $\ \rm \%$
  
  
{Durch unzureichende Simulation wurde&nbsp; $p = 0.05$&nbsp; um&nbsp; $10\%$&nbsp; zu niedrig ermittelt.&nbsp; Wie groß ist hier der prozentuale Fehler hinsichtlich der Entropie?
+
{Due to insufficient simulation,&nbsp; $p = 0.05$&nbsp; was determined&nbsp; $10\%$&nbsp; too low.&nbsp; What is the percentage error with respect to entropy here?
 
|type="{}"}
 
|type="{}"}
 
$p = 0.045\ \ {\rm statt}\ \ p=0.05\hspace{-0.1cm}:\ \ \varepsilon_H \ =  \ $ { -7.44--7.16 } $\ \rm \%$
 
$p = 0.045\ \ {\rm statt}\ \ p=0.05\hspace{-0.1cm}:\ \ \varepsilon_H \ =  \ $ { -7.44--7.16 } $\ \rm \%$
Line 67: Line 68:
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solution===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
'''(1)'''&nbsp; Richtig ist der <u>erste Lösungsvorschlag</u>. Die beiden weiteren Vorgaben machen keinen Sinn.
+
'''(1)'''&nbsp; The <u>first suggested solution</u> is correct. The other two specifications do not make sense.
*Die Entropiefunktion&nbsp; $H'_{\rm bin}(p)$&nbsp; lautet entsprechend der Angabe:
+
*The entropy function&nbsp; $H'_{\rm bin}(p)$&nbsp; is according to the specification:
 
:$$H'_{\rm bin}(p) \hspace{0.1cm}  =  \hspace{0.1cm}  p \cdot {\rm ln}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm ln}\hspace{0.1cm}\frac{1}{1-p} = {\rm ln}\hspace{0.1cm}2 \cdot \left [ p \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{1-p}\right ]$$
 
:$$H'_{\rm bin}(p) \hspace{0.1cm}  =  \hspace{0.1cm}  p \cdot {\rm ln}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm ln}\hspace{0.1cm}\frac{1}{1-p} = {\rm ln}\hspace{0.1cm}2 \cdot \left [ p \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{1-p}\right ]$$
 
:$$\Rightarrow \hspace{0.3cm} H'_{\rm bin}(p) \hspace{0.15cm}{\rm (in \hspace{0.15cm} nat)}=
 
:$$\Rightarrow \hspace{0.3cm} H'_{\rm bin}(p) \hspace{0.15cm}{\rm (in \hspace{0.15cm} nat)}=
Line 77: Line 78:
  
  
'''(2)'''&nbsp; Die Optimierungsbedingung lautet&nbsp; ${\rm d}H_{\rm bin}(p)/{\rm d}p = 0$&nbsp; bzw.
+
'''(2)'''&nbsp; The optimisation condition is&nbsp; ${\rm d}H_{\rm bin}(p)/{\rm d}p = 0$&nbsp; resp.
 
:$$\frac{{\rm d}H'_{\rm bin}(p)}{{\rm d}p} \stackrel{!}{=} 0 \hspace{0.3cm}\Rightarrow \hspace{0.3cm} \frac{\rm d}{{\rm d}p}
 
:$$\frac{{\rm d}H'_{\rm bin}(p)}{{\rm d}p} \stackrel{!}{=} 0 \hspace{0.3cm}\Rightarrow \hspace{0.3cm} \frac{\rm d}{{\rm d}p}
 
   \big [ - p \cdot {\rm ln}\hspace{0.1cm}p - (1-p) \cdot {\rm ln}\hspace{0.1cm}({1-p})\big ] \stackrel{!}{=} 0$$
 
   \big [ - p \cdot {\rm ln}\hspace{0.1cm}p - (1-p) \cdot {\rm ln}\hspace{0.1cm}({1-p})\big ] \stackrel{!}{=} 0$$
Line 90: Line 91:
  
  
'''(3)'''&nbsp; Für&nbsp; $p = 5\%$&nbsp; erhält man:
+
'''(3)'''&nbsp; For&nbsp; $p = 5\%$&nbsp; we get:
 
:$$H_{\rm bin}(p = 0.05) \hspace{0.1cm}  =  \hspace{0.1cm}  0.05 \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{0.05}+ 0.95 \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{0.95}=  \frac{1}{0.693} \cdot \big [ 0.05 \cdot {\rm ln}\hspace{0.1cm}20+ 0.95 \cdot {\rm ln}\hspace{0.1cm}1.053\big ]
 
:$$H_{\rm bin}(p = 0.05) \hspace{0.1cm}  =  \hspace{0.1cm}  0.05 \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{0.05}+ 0.95 \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{0.95}=  \frac{1}{0.693} \cdot \big [ 0.05 \cdot {\rm ln}\hspace{0.1cm}20+ 0.95 \cdot {\rm ln}\hspace{0.1cm}1.053\big ]
 
  \hspace{0.15cm}\underline {\approx 0.286 \, {\rm bit}}\hspace{0.05cm}.$$
 
  \hspace{0.15cm}\underline {\approx 0.286 \, {\rm bit}}\hspace{0.05cm}.$$
Line 96: Line 97:
  
  
'''(4)'''&nbsp; Diese Teilaufgabe lässt sich nicht in geschlossener Form lösen, sondern durch &bdquo;Probieren&rdquo;.  
+
'''(4)'''&nbsp; This sub-task cannot be solved in closed form, but by &bdquo;trial and error&rdquo;.  
*Eine Lösung liefert das Ergebnis:
+
*A solution gives the result:
 
:$$H_{\rm bin}(p = 0.10) = 0.469 \, {\rm bit}\hspace{0.05cm},\hspace{0.2cm}H_{\rm bin}(p = 0.12) = 0.529 \, {\rm bit}\hspace{0.05cm},\hspace{0.2cm}
 
:$$H_{\rm bin}(p = 0.10) = 0.469 \, {\rm bit}\hspace{0.05cm},\hspace{0.2cm}H_{\rm bin}(p = 0.12) = 0.529 \, {\rm bit}\hspace{0.05cm},\hspace{0.2cm}
 
  H_{\rm bin}(p = 0.11) \approx 0.5 \, {\rm bit} \hspace{0.3cm}
 
  H_{\rm bin}(p = 0.11) \approx 0.5 \, {\rm bit} \hspace{0.3cm}
 
\Rightarrow \hspace{0.3cm}p_1 \approx 0.11\hspace{0.05cm}. $$
 
\Rightarrow \hspace{0.3cm}p_1 \approx 0.11\hspace{0.05cm}. $$
*Die zweite (gesuchte) Lösung ergibt sich aus der Symmetrie von&nbsp;  $H_{\rm bin}(p)$&nbsp; zu &nbsp;$p_2 = 1 -p_1 \hspace{0.15cm}\underline{= 0.89}$.
+
*The second solution results from the symmetry of &nbsp;  $H_{\rm bin}(p)$&nbsp; zu &nbsp;$p_2 = 1 -p_1 \hspace{0.15cm}\underline{= 0.89}$.
  
  

Revision as of 21:33, 2 May 2021

Binary entropy function
in „bits” und „nats”

We consider a sequence of binary random variables with the symbol set  $\{ \rm A, \ B \}$   ⇒   $M = 2$.  Let the probabilities of occurrence of the two symbols be  $p_{\rm A }= p$  and  $p_{\rm B } = 1 - p$.

The individual sequence elements are statistically independent.  The entropy of this message source is equally valid:

$$H_{\rm bin}(p) \hspace{0.1cm} = \hspace{0.1cm} p \cdot {\rm ld}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm ld}\hspace{0.1cm}\frac{1}{1-p}\hspace{0.15cm}{\rm in \hspace{0.15cm} \big [bit \big ]}\hspace{0.05cm},$$
$$ H'_{\rm bin}(p) \hspace{0.1cm} = \hspace{0.1cm} p \cdot {\rm ln}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm ln}\hspace{0.1cm}\frac{1}{1-p}\hspace{0.15cm}{\rm in \hspace{0.15cm} \big [nat\big ]}\hspace{0.05cm}.$$

In these equations, the shorthand terms used are:


  • the natural  logarithm   ⇒   $ {\ln} \hspace{0.09cm} p = \log_{\rm e} \hspace{0.05cm} p$,
  • the binary   logarithm ⇒   ${\rm ld} \hspace{0.09cm} p = \log_2 \hspace{0.05cm} p$.


The plot shows the binary entropy function as a function of the parameter  $p$, assuming  $0 ≤ p ≤ 1$ .

In subtasks  (5)  and  (6)  the relative error is to be determined if the symbol probability  $p$  was determined by simulation  $($i.e., as a relative frequency  $h)$ , resulting in  $h = 0.9 \cdot p$  by mistake.  The relative error is then given as follows:

$$\varepsilon_{H} = \frac{H_{\rm bin}(h)- H_{\rm bin}(p)}{H_{\rm bin}(p)}\hspace{0.05cm}.$$




Hint:


Questions

1

How are  $H_{\rm bin}(p)$  related to the unit „bit” and  $H'_{\rm bin}(p)$  related to the unit „nat”?

$H_{\rm bin}(p)$  and  $H'_{\rm bin}(p)$  differ by a factor.
It holds that  $H'_{\rm bin}(p) = H_{\rm bin}(\ln \ p)$.
It holds that  $H'_{\rm bin}(p) = 1 + H_{\rm bin}(2 p)$.

2

Show that the maximum of the binary entropy function is obtained for  $p = 0.5$ .  What is  $H_\text{bin}(p = 0.5)$?

$H_\text{bin}(p = 0.5) \ = \ $

$\ \rm bit$

3

Calculate the binary entropy value for  $p = 0.05$.

$H_\text{bin}(p = 0.05) \ = \ $

$\ \rm bit$
Enter the larger of the two  $p$–values given by the equation   $H_\text{bin}(p)= 0.5 \ \rm bit$ .
|type="{}"}
$p \ = \ $

4

Due to insufficient simulation,  $p = 0.5$  was determined  $10\%$ too low.  What is the percentage error with respect to entropy?

$p = 0.45\ \ {\rm instead of}\ \ p=0.5\hspace{-0.1cm}:\ \ \varepsilon_H \ = \ $

$\ \rm \%$

5

Due to insufficient simulation,  $p = 0.05$  was determined  $10\%$  too low.  What is the percentage error with respect to entropy here?

$p = 0.045\ \ {\rm statt}\ \ p=0.05\hspace{-0.1cm}:\ \ \varepsilon_H \ = \ $

$\ \rm \%$


Solution

(1)  The first suggested solution is correct. The other two specifications do not make sense.

  • The entropy function  $H'_{\rm bin}(p)$  is according to the specification:
$$H'_{\rm bin}(p) \hspace{0.1cm} = \hspace{0.1cm} p \cdot {\rm ln}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm ln}\hspace{0.1cm}\frac{1}{1-p} = {\rm ln}\hspace{0.1cm}2 \cdot \left [ p \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{\hspace{0.1cm}p\hspace{0.1cm}} + (1-p) \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{1-p}\right ]$$
$$\Rightarrow \hspace{0.3cm} H'_{\rm bin}(p) \hspace{0.15cm}{\rm (in \hspace{0.15cm} nat)}= {\rm ln}\hspace{0.1cm}2 \cdot H_{\rm bin}(p) \hspace{0.15cm}{\rm (in \hspace{0.15cm} bit)} = 0.693\cdot H_{\rm bin}(p)\hspace{0.05cm}.$$


(2)  The optimisation condition is  ${\rm d}H_{\rm bin}(p)/{\rm d}p = 0$  resp.

$$\frac{{\rm d}H'_{\rm bin}(p)}{{\rm d}p} \stackrel{!}{=} 0 \hspace{0.3cm}\Rightarrow \hspace{0.3cm} \frac{\rm d}{{\rm d}p} \big [ - p \cdot {\rm ln}\hspace{0.1cm}p - (1-p) \cdot {\rm ln}\hspace{0.1cm}({1-p})\big ] \stackrel{!}{=} 0$$
$$\Rightarrow \hspace{0.3cm} - {\rm ln}\hspace{0.1cm}p - p \cdot \frac {1}{p}+ {\rm ln}\hspace{0.1cm}(1-p) + (1-p)\cdot \frac {1}{1- p}\stackrel{!}{=} 0$$
$$\Rightarrow \hspace{0.3cm} {\rm ln}\hspace{0.1cm}\frac {1-p}{p}= 0 \hspace{0.3cm}\Rightarrow \hspace{0.3cm}\frac {1-p}{p}= 1 \hspace{0.3cm}\Rightarrow \hspace{0.3cm} \underline { p = 0.5}\hspace{0.05cm}.$$
  • Die Entropiewerte für  $p = 0.5$  lauten somit:
$$H'_{\rm bin}(p = 0.5) \hspace{0.1cm} = \hspace{0.1cm} -2 \cdot 0.5 \cdot {\rm ln}\hspace{0.1cm}0.5 = {\rm ln}\hspace{0.1cm}2 = 0.693 \, {\rm nat}\hspace{0.05cm},$$
$$ H_{\rm bin}(p = 0.5) \hspace{0.1cm} = \hspace{0.1cm} -2 \cdot 0.5 \cdot {\rm ld}\hspace{0.1cm}0.5 = {\rm log_2}\hspace{0.1cm}2 \hspace{0.15cm}\underline {= 1 \, {\rm bit}}\hspace{0.05cm}.$$


(3)  For  $p = 5\%$  we get:

$$H_{\rm bin}(p = 0.05) \hspace{0.1cm} = \hspace{0.1cm} 0.05 \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{0.05}+ 0.95 \cdot {\rm log_2}\hspace{0.1cm}\frac{1}{0.95}= \frac{1}{0.693} \cdot \big [ 0.05 \cdot {\rm ln}\hspace{0.1cm}20+ 0.95 \cdot {\rm ln}\hspace{0.1cm}1.053\big ] \hspace{0.15cm}\underline {\approx 0.286 \, {\rm bit}}\hspace{0.05cm}.$$


(4)  This sub-task cannot be solved in closed form, but by „trial and error”.

  • A solution gives the result:
$$H_{\rm bin}(p = 0.10) = 0.469 \, {\rm bit}\hspace{0.05cm},\hspace{0.2cm}H_{\rm bin}(p = 0.12) = 0.529 \, {\rm bit}\hspace{0.05cm},\hspace{0.2cm} H_{\rm bin}(p = 0.11) \approx 0.5 \, {\rm bit} \hspace{0.3cm} \Rightarrow \hspace{0.3cm}p_1 \approx 0.11\hspace{0.05cm}. $$
  • The second solution results from the symmetry of   $H_{\rm bin}(p)$  zu  $p_2 = 1 -p_1 \hspace{0.15cm}\underline{= 0.89}$.



(5)  Mit  $p = 0.45$  erhält man  $H_{\rm bin}(p) = 0.993\hspace{0.05cm}\rm bit$.  Der relative Fehler bezüglich Entropie ist somit

$$\varepsilon_{H} = \frac{H_{\rm bin}(p = 0.45)- H_{\rm bin}(p= 0.5)}{H_{\rm bin}(p = 0.5)}= \frac{0.993- 1}{1}\hspace{0.15cm}\underline {= -0.7 \, {\rm \%}} \hspace{0.05cm}.$$
  • Das Minuszeichen deutet darauf hin, dass der Entropiewert  $H_{\rm bin}(p) = 0.993\hspace{0.05cm}\rm bit$  zu klein ist.
  • Hätte die Simulation den zu großen Wert  $p = 0.55$  ergeben, so wäre die Entropie und auch der relative Fehler genau so groß.



(6)  Es gilt  $H_{\rm bin}(p = 0.045) = 0.265\hspace{0.05cm}\rm bit$.

  • Mit dem Ergebnis der Teilaufgabe  (3)   ⇒   $H_{\rm bin}(p = 0.05) = 0.286\hspace{0.05cm}\rm bit$  folgt daraus für den relativen Fehler bezüglich der Entropie:
$$\varepsilon_{H} = \frac{H_{\rm bin}(p = 0.045)- H_{\rm bin}(p= 0.05)}{H_{\rm bin}(p = 0.05)}= \frac{0.265- 0.286}{0.286}\hspace{0.15cm}\underline {= -7.3 \, {\rm \%}} \hspace{0.05cm}.$$
  • Das Ergebnis zeigt:
  1.  Eine falsche Bestimmung der Symbolwahrscheinlichkeiten um  $10\%$  macht sich für  $p = 0.05$  aufgrund des steileren  $H_{\rm bin}(p)$–Verlaufs deutlich stärker bemerkbar als für  $p = 0.5$.
  2.  Eine zu große Wahrscheinlichkeit  $p = 0.055$  hätte zu  $H_{\rm bin}(p = 0.055) = 0.307\hspace{0.05cm}\rm bit$  geführt und damit zu einer Verfälschung um  $\varepsilon_H = +7.3\%$.  In diesem Bereich verläuft die Entropiekurve also (mit guter Näherung) linear.