Difference between revisions of "Aufgaben:Exercise 1.1: Entropy of the Weather"

From LNTwww
Line 3: Line 3:
 
}}
 
}}
  
[[File:Inf_A_1_1_vers2.png|right|frame|Fünf verschiedene Binärquellen]]
+
[[File:Inf_A_1_1_vers2.png|right|frame|Five different binary sources]]
Eine Wetterstation fragt täglich verschiedene Regionen ab und bekommt als Antwort jeweils eine Meldung   $x$  zurück, nämlich
+
A weather station queries different regions every day and receives a message   $x$  back as a response in each case, namely
  
* $x =  \rm B$:   Das Wetter ist eher schlecht.
+
* $x =  \rm B$:   The weather is rather bad.
* $x =  \rm G$:   Das Wetter ist eher gut.
+
* $x =  \rm G$:   The weather is rather good.
  
  
Die Daten wurden über viele Jahre für verschiedene Gebiete in Dateien abgelegt, so dass die Entropien der  $\rm B/G$–Folgen ermittelt werden können:
+
The data were stored in files over many years for different regions, so that the entropies of the  $\rm B/G$–sequences can be determined:
 
:$$H =  p_{\rm B} \cdot {\rm log}_2\hspace{0.1cm}\frac{1}{p_{\rm B}} + p_{\rm G} \cdot {\rm log}_2\hspace{0.1cm}\frac{1}{p_{\rm G}}$$
 
:$$H =  p_{\rm B} \cdot {\rm log}_2\hspace{0.1cm}\frac{1}{p_{\rm B}} + p_{\rm G} \cdot {\rm log}_2\hspace{0.1cm}\frac{1}{p_{\rm G}}$$
  
mit dem <i>Logarithmus dualis</i>
+
with the <i>binary logarithm</i>
 
:$${\rm log}_2\hspace{0.1cm}p=\frac{{\rm lg}\hspace{0.1cm}p}{{\rm lg}\hspace{0.1cm}2}\hspace{0.3cm} \left ( =  {\rm ld}\hspace{0.1cm}p \right ) \hspace{0.05cm}.$$
 
:$${\rm log}_2\hspace{0.1cm}p=\frac{{\rm lg}\hspace{0.1cm}p}{{\rm lg}\hspace{0.1cm}2}\hspace{0.3cm} \left ( =  {\rm ld}\hspace{0.1cm}p \right ) \hspace{0.05cm}.$$
&bdquo;lg&rdquo;&nbsp; kennzeichnet hierbei den Logarithmus zur Basis&nbsp; $10$.&nbsp; Zu erwähnen ist ferner, dass jeweils noch die Pseudoeinheit&nbsp; $\text{bit/Anfrage}$ &nbsp;anzufügen ist.
+
Here, &bdquo;lg&rdquo;&nbsp; denotes the logarithm to the base&nbsp; $10$.&nbsp; It should also be mentioned that the pseudo-unit&nbsp; $\text{bit/query}$ &nbsp;must be added in each case.
  
Die Grafik zeigt diese binären Folgen jeweils für&nbsp; $60$&nbsp; Tage und folgende Regionen:
+
The graph shows these binary sequences for&nbsp; $60$&nbsp; days and the following regions:
  
* Region &bdquo;Durchwachsen&rdquo;: &nbsp;&nbsp; $p_{\rm B} = p_{\rm G} =0.5$,
+
* Region &bdquo;mixed&rdquo;: &nbsp;&nbsp; $p_{\rm B} = p_{\rm G} =0.5$,
* Region &bdquo;Regenloch&rdquo;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $p_{\rm B} = 0.8, \; p_{\rm G} =0.2$,  
+
* Region &bdquo;rainy&rdquo;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $p_{\rm B} = 0.8, \; p_{\rm G} =0.2$,  
* Region &bdquo;Angenehm&rdquo;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $p_{\rm B} = 0.2, \; p_{\rm G} =0.8$,  
+
* Region &bdquo;pleasant&rdquo;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $p_{\rm B} = 0.2, \; p_{\rm G} =0.8$,  
* Region &bdquo;Paradies&rdquo;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $p_{\rm B} = 1/30, \; p_{\rm G} =29/30$.
+
* Region &bdquo;paradise&rdquo;: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $p_{\rm B} = 1/30, \; p_{\rm G} =29/30$.
  
  
Schließlich ist auch noch die Datei &bdquo;Unbekannt&rdquo; angegeben, deren statistische Eigenschaften zu schätzen sind.
+
Finally, the file &bdquo;Unknown&rdquo; is also given, whose statistical properties are to be estimated.
  
  
Line 34: Line 34:
  
  
''Hinweise:''  
+
''Hinss:''  
*Die Aufgabe gehört zum  Kapitel&nbsp; [[Information_Theory/Gedächtnislose_Nachrichtenquellen|Gedächtnislose Nachrichtenquellen]].
+
*This task belongs to the chapter&nbsp; [[Information_Theory/Gedächtnislose_Nachrichtenquellen|Discrete Memoryless Sources]].
 
   
 
   
*Für die vier ersten Dateien wird vorausgesetzt, dass die Ereignisse&nbsp; $\rm B$&nbsp; und&nbsp; $\rm G$&nbsp; statistisch unabhängig seien, eine für die Wetterpraxis eher unrealistische Annahme.
+
*For the first four files it is assumed that the events&nbsp; $\rm B$&nbsp; and&nbsp; $\rm G$&nbsp; are statistically independent, a rather unrealistic assumption for weather practice.
  
*Die Aufgabe wurde zu einer Zeit konzipiert, als&nbsp; [https://de.wikipedia.org/wiki/Greta_Thunberg Greta]&nbsp; gerade in die Schule kam.&nbsp; Wir überlassen es Ihnen, &bdquo;Paradies&rdquo; in &bdquo;Hölle&rdquo; umzubenennen.  
+
*he task was designed at a time when&nbsp; [https://en.wikipedia.org/wiki/Greta_Thunberg Greta]&nbsp; was just starting school.&nbsp; We leave it to you to rename &bdquo;paradise&rdquo; to &bdquo;hell&rdquo;.  
  
  
  
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
{Welche Entropie&nbsp; $H_{\rm D}$&nbsp; weist die Datei&nbsp; &bdquo;Durchwachsen"&nbsp; auf?
+
{What is the entropy&nbsp; $H_{\rm D}$&nbsp; of the file&nbsp; &bdquo;mixed"&nbsp;?
 
|type="{}"}
 
|type="{}"}
$H_{\rm D}\ = \ $  { 1 3% } $\ \rm bit/Anfrage$
+
$H_{\rm D}\ = \ $  { 1 3% } $\ \rm bit/query$
  
  
{Welche Entropie&nbsp; $H_{\rm R}$&nbsp; weist die Datei&nbsp; &bdquo;Regenloch&rdquo;&nbsp; auf?
+
{What is the entropy&nbsp; $H_{\rm R}$&nbsp; of the file&nbsp; &bdquo;rainy&rdquo;&nbsp?
 
|type="{}"}
 
|type="{}"}
$H_{\rm R}\ =  \ $ { 0.722 3% }  $\ \rm bit/Anfrage$
+
$H_{\rm R}\ =  \ $ { 0.722 3% }  $\ \rm bit/query$
  
  
{Welche Entropie&nbsp; $H_{\rm A}$&nbsp; weist die Datei&nbsp; &bdquo;Angenehm&rdquo;&nbsp; auf?
+
{What is the entropy&nbsp; $H_{\rm A}$&nbsp; of the file&nbsp; &bdquo;pleasant&rdquo;&nbsp;?
 
|type="{}"}
 
|type="{}"}
$H_{\rm A}\ =  \ $ { 0.722 3% } $\ \rm bit/Anfrage$
+
$H_{\rm A}\ =  \ $ { 0.722 3% } $\ \rm bit/query$
  
  
{Wie groß sind die Informationsgehalte der Ereignisse&nbsp; $\rm B$&nbsp; und&nbsp; $\rm G$&nbsp; bezogen auf die Datei&nbsp; &bdquo;Paradies&rdquo;?
+
{How large are the information contents of events&nbsp; $\rm B$&nbsp; and&nbsp; $\rm G$&nbsp; in relation to the file&nbsp; &bdquo;paradise&rdquo;?
 
|type="{}"}
 
|type="{}"}
$I_{\rm B}\ =  \ $ { 4.907 3% } $\ \rm bit/Anfrage$
+
$I_{\rm B}\ =  \ $ { 4.907 3% } $\ \rm bit/query$
$I_{\rm G}\ =  \ $ { 0.049 3% } $\ \rm bit/Anfrage$
+
$I_{\rm G}\ =  \ $ { 0.049 3% } $\ \rm bit/query$
  
  
{Wie groß ist die Entropie&nbsp; (das heißt:&nbsp; der mittlere Informationsgehalt)&nbsp; $H_{\rm P}$&nbsp; der Datei&nbsp; &bdquo;Paradies&rdquo;?&nbsp; Interpretieren Sie das Ergebnis?
+
{What is the entropy&nbsp; (that is:&nbsp; the average information content)&nbsp; $H_{\rm P}$&nbsp; of the file&nbsp; &bdquo;paradise&rdquo;?&nbsp; Interpret the result.
 
|type="{}"}
 
|type="{}"}
$H_{\rm P}\ =  \ $ { 0.211 3% } $\ \rm bit/Anfrage$
+
$H_{\rm P}\ =  \ $ { 0.211 3% } $\ \rm bit/query$
  
  
{Welche Aussagen könnten für die Datei&nbsp; &bdquo;Unbekannt&rdquo;&nbsp; gelten?
+
{Which statements could be true for the file&nbsp; &bdquo;unknown&rdquo;&nbsp;?
 
|type="[]"}
 
|type="[]"}
+ Die Ereignisse&nbsp; $\rm B$&nbsp; und&nbsp; $\rm G$&nbsp; sind etwa gleichwahrscheinlich.
+
+ Events&nbsp; $\rm B$&nbsp; and&nbsp; $\rm G$&nbsp; are approximately equally likely.
- Die Folgenelemente sind statistisch voneinander unabhängig.
+
- The sequence elements are statistically independent of each other.
+ Die Entropie dieser Datei ist&nbsp; $H_\text{U} \approx 0.7 \; \rm bit/Anfrage$.
+
+ The entropy of this file is&nbsp; $H_\text{U} \approx 0.7 \; \rm bit/query$.
- Die Entropie dieser Datei ist&nbsp; $H_\text{U} = 1.5 \; \rm bit/Anfrage$.
+
- The entropy of this file is&nbsp; $H_\text{U} = 1.5 \; \rm bit/query$.
  
  
Line 84: Line 84:
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solution===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
 
'''(1)'''&nbsp; Bei der Datei&nbsp; &bdquo;Durchwachsen&rdquo;&nbsp; sind die beiden Wahrscheinlichkeiten gleich: &nbsp;  $p_{\rm B} = p_{\rm G} =0.5$.&nbsp; Damit ergibt sich für die Entropie:
 
'''(1)'''&nbsp; Bei der Datei&nbsp; &bdquo;Durchwachsen&rdquo;&nbsp; sind die beiden Wahrscheinlichkeiten gleich: &nbsp;  $p_{\rm B} = p_{\rm G} =0.5$.&nbsp; Damit ergibt sich für die Entropie:

Revision as of 20:29, 4 May 2021

Five different binary sources

A weather station queries different regions every day and receives a message  $x$  back as a response in each case, namely

  • $x = \rm B$:   The weather is rather bad.
  • $x = \rm G$:   The weather is rather good.


The data were stored in files over many years for different regions, so that the entropies of the  $\rm B/G$–sequences can be determined:

$$H = p_{\rm B} \cdot {\rm log}_2\hspace{0.1cm}\frac{1}{p_{\rm B}} + p_{\rm G} \cdot {\rm log}_2\hspace{0.1cm}\frac{1}{p_{\rm G}}$$

with the binary logarithm

$${\rm log}_2\hspace{0.1cm}p=\frac{{\rm lg}\hspace{0.1cm}p}{{\rm lg}\hspace{0.1cm}2}\hspace{0.3cm} \left ( = {\rm ld}\hspace{0.1cm}p \right ) \hspace{0.05cm}.$$

Here, „lg”  denotes the logarithm to the base  $10$.  It should also be mentioned that the pseudo-unit  $\text{bit/query}$  must be added in each case.

The graph shows these binary sequences for  $60$  days and the following regions:

  • Region „mixed”:    $p_{\rm B} = p_{\rm G} =0.5$,
  • Region „rainy”:             $p_{\rm B} = 0.8, \; p_{\rm G} =0.2$,
  • Region „pleasant”:            $p_{\rm B} = 0.2, \; p_{\rm G} =0.8$,
  • Region „paradise”:                $p_{\rm B} = 1/30, \; p_{\rm G} =29/30$.


Finally, the file „Unknown” is also given, whose statistical properties are to be estimated.





Hinss:

  • For the first four files it is assumed that the events  $\rm B$  and  $\rm G$  are statistically independent, a rather unrealistic assumption for weather practice.
  • he task was designed at a time when  Greta  was just starting school.  We leave it to you to rename „paradise” to „hell”.



Questions

1

What is the entropy  $H_{\rm D}$  of the file  „mixed" ?

$H_{\rm D}\ = \ $

$\ \rm bit/query$

2

What is the entropy  $H_{\rm R}$  of the file  „rainy”&nbsp?

$H_{\rm R}\ = \ $

$\ \rm bit/query$

3

What is the entropy  $H_{\rm A}$  of the file  „pleasant” ?

$H_{\rm A}\ = \ $

$\ \rm bit/query$

4

How large are the information contents of events  $\rm B$  and  $\rm G$  in relation to the file  „paradise”?

$I_{\rm B}\ = \ $

$\ \rm bit/query$
$I_{\rm G}\ = \ $

$\ \rm bit/query$

5

What is the entropy  (that is:  the average information content)  $H_{\rm P}$  of the file  „paradise”?  Interpret the result.

$H_{\rm P}\ = \ $

$\ \rm bit/query$

6

Which statements could be true for the file  „unknown” ?

Events  $\rm B$  and  $\rm G$  are approximately equally likely.
The sequence elements are statistically independent of each other.
The entropy of this file is  $H_\text{U} \approx 0.7 \; \rm bit/query$.
The entropy of this file is  $H_\text{U} = 1.5 \; \rm bit/query$.


Solution

(1)  Bei der Datei  „Durchwachsen”  sind die beiden Wahrscheinlichkeiten gleich:   $p_{\rm B} = p_{\rm G} =0.5$.  Damit ergibt sich für die Entropie:

$$H_{\rm D} = 0.5 \cdot {\rm log}_2\hspace{0.1cm}\frac{1}{0.5} + 0.5 \cdot {\rm log}_2\hspace{0.1cm}\frac{1}{0.5} \hspace{0.15cm}\underline {= 1\,{\rm bit/Anfrage}}\hspace{0.05cm}.$$


(2)  Mit  $p_{\rm B} = 0.8$  und  $p_{\rm G} =0.2$  erhält man einen kleineren Entropiewert:

$$H_{\rm R} \hspace{-0.05cm}= \hspace{-0.05cm}0.8 \cdot {\rm log}_2\hspace{0.05cm}\frac{5}{4} \hspace{-0.05cm}+ \hspace{-0.05cm}0.2 \cdot {\rm log}_2\hspace{0.05cm}\frac{5}{1}\hspace{-0.05cm}=\hspace{-0.05cm} 0.8 \cdot{\rm log}_2\hspace{0.05cm}5\hspace{-0.05cm} - \hspace{-0.05cm}0.8 \cdot {\rm log}_2\hspace{0.05cm}4 \hspace{-0.05cm}+ \hspace{-0.05cm}0.2 \cdot {\rm log}_2 \hspace{0.05cm} 5 \hspace{-0.05cm}=\hspace{-0.05cm} {\rm log}_2\hspace{0.05cm}5\hspace{-0.05cm} -\hspace{-0.05cm} 0.8 \cdot {\rm log}_2\hspace{0.1cm}4\hspace{-0.05cm} = \hspace{-0.05cm} \frac{{\rm lg} \hspace{0.1cm}5}{{\rm lg}\hspace{0.1cm}2} \hspace{-0.05cm}-\hspace{-0.05cm} 1.6 \hspace{0.15cm} \underline {= 0.722\,{\rm bit/Anfrage}}\hspace{0.05cm}.$$


(3)  In der Datei  „Angenehm”  sind die Wahrscheinlichkeiten gegenüber der Datei  „Regenloch”  genau vertauscht.  Durch diese Vertauschung wird die Entropie jedoch nicht verändert:

$$H_{\rm A} = H_{\rm R} \hspace{0.15cm} \underline {= 0.722\,{\rm bit/Anfrage}}\hspace{0.05cm}.$$


(4)  Mit  $p_{\rm B} = 1/30$  und  $p_{\rm G} =29/30$  ergeben sich folgende Informationsgehalte:

$$I_{\rm B} \hspace{0.1cm} = \hspace{0.1cm} {\rm log}_2\hspace{0.1cm}30 = \frac{{\rm lg}\hspace{0.1cm}30}{{\rm lg}\hspace{0.1cm}2} = \frac{1.477}{0.301} \hspace{0.15cm} \underline {= 4.907\,{\rm bit/Anfrage}}\hspace{0.05cm},$$
$$I_{\rm G} \hspace{0.1cm} = \hspace{0.1cm} {\rm log}_2\hspace{0.1cm}\frac{30}{29} = \frac{{\rm lg}\hspace{0.1cm}1.034}{{\rm lg}\hspace{0.1cm}2} = \frac{1.477}{0.301} \hspace{0.15cm} \underline {= 0.049\,{\rm bit/Anfrage}}\hspace{0.05cm}.$$


(5)  Die Entropie  $H_{\rm P}$  ist der mittlere Informationsgehalt der beiden Ereignisse  $\rm B$  und  $\rm G$:

$$H_{\rm P} = \frac{1}{30} \cdot 4.907 + \frac{29}{30} \cdot 0.049 = 0.164 + 0.047 \hspace{0.15cm} \underline {= 0.211\,{\rm bit/Anfrage}}\hspace{0.05cm}.$$
  • Obwohl  (genauer:  weil)  das Ereignis  $\rm B$  seltener auftritt als  $\rm G$, ist sein Beitrag zur Entropie größer.


(6)  Richtig sind die Aussagen 1 und 3:

  • $\rm B$  und  $\rm G$  sind bei der Datei „Unbekannt” tatsächlich gleichwahrscheinlich:   Die  $60$  dargestellten Symbole teilen sich auf in  $30$ mal  $\rm B$  und  $30$ mal  $\rm G$.
  • Es bestehen nun aber starke statistische Bindungen innerhalb der zeitlichen Folge.  Nach längeren Schönwetterperioden folgen meist viele schlechte Tage am Stück.
  • Aufgrund dieser statistischen Abhängigkeit innerhalb der  $\rm B/G$–Folge ist  $H_\text{U} = 0.722 \; \rm bit/Anfrage$  kleiner als  $H_\text{D} = 1 \; \rm bit/Anfrage$.
  • $H_\text{D}$  ist gleichzeitig das Maximum für  $M = 2$   ⇒   die letzte Aussage ist mit Sicherheit falsch.