Difference between revisions of "Aufgaben:Exercise 3.4: Entropy for Different PMF"

From LNTwww
m (Text replacement - "Category:Aufgaben zu Informationstheorie" to "Category:Information Theory: Exercises")
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  
{{quiz-Header|Buchseite=Informationstheorie/Einige Vorbemerkungen zu zweidimensionalen Zufallsgrößen
+
{{quiz-Header|Buchseite=Information_Theory/Some_Preliminary_Remarks_on_Two-Dimensional_Random_Variables
 
}}
 
}}
  
[[File:P_ID2758__Inf_Z_3_3.png|right|frame|Wahrscheinlichkeitsfunktionen, jeweils mit  $M = 4$  Elementen]]
+
[[File:EN_Inf_Z_3_3.png|right|frame|Probability functions, each with  $M = 4$  elements]]
In der ersten Zeile der nebenstehenden Tabelle ist die im Folgenden die mit  $\rm (a)$  bezeichnete Wahrscheinlichkeitsfunktion angegeben. Für diese PMF  $P_X(X) = \big [0.1, \ 0.2, \ 0.3, \ 0.4 \big ]$  soll  in der Teilaufgabe  '''(1)'''  die Entropie berechnet werden:
+
In the first row of the adjacent table, the probability mass function denoted by  $\rm (a)$  is given in the following.  
 +
 
 +
For this PMF  $P_X(X) = \big [0.1, \ 0.2, \ 0.3, \ 0.4 \big ]$  the entropy is to be calculated in subtask  '''(1)''' :
 
:$$H_{\rm a}(X) = {\rm E} \big [ {\rm log}_2 \hspace{0.1cm} \frac{1}{P_{X}(X)}\big ]= - {\rm E} \big  [ {\rm log}_2 \hspace{0.1cm}{P_{X}(X)}\big ].$$
 
:$$H_{\rm a}(X) = {\rm E} \big [ {\rm log}_2 \hspace{0.1cm} \frac{1}{P_{X}(X)}\big ]= - {\rm E} \big  [ {\rm log}_2 \hspace{0.1cm}{P_{X}(X)}\big ].$$
Da hier der Logarithmus zur Basis  $2$  verwendet wird, ist die Pseudo–Einheit „bit” anzufügen.
+
Since the logarithm to the base  $2$  is used here, the pseudo-unit  "bit"  is to be added.
 
 
In den weiteren Aufgaben sollen jeweils einige Wahrscheinlichkeiten variiert werden und zwar derart, dass sich jeweils die größtmögliche Entropie ergibt:
 
  
* Durch geeignete Variation von  $p_3$  und  $p_4$  kommt man zur maximalen Entropie  $H_{\rm b}(X)$  unter der Voraussetzung  $p_1 = 0.1$  und  $p_2 = 0.2$    ⇒   Teilaufgabe  '''(2)'''.
+
In the further tasks, some probabilities are to be varied in each case in such a way that the greatest possible entropy results:
* Durch geeignete Variation von  $p_2$  und  $p_3$ kommt man zur maximalen Entropie  $H_{\rm c}(X)$  unter der Voraussetzung  $p_1 = 0.1$  und  $p_4 = 0.4$   ⇒   Teilaufgabe  '''(3)'''.
 
* In der Teilaufgabe  '''(4)'''  sind alle vier Parameter zur Variation freigegeben, die entsprechend der maximalen Entropie   ⇒   $H_{\rm max}(X)$   zu bestimmen sind.
 
  
 +
* By suitably varying  $p_3$  and  $p_4$,  one arrives at the maximum entropy  $H_{\rm b}(X)$  under the condition  $p_1 = 0.1$  and  $p_2 = 0.2$    ⇒   subtask  '''(2)'''.
 +
* By varying  $p_2$  and  $p_3$ appropriately, one arrives at the maximum entropy  $H_{\rm c}(X)$  under the condition  $p_1 = 0.1$  and  $p_4 = 0.4$   ⇒   subtask  '''(3)'''.
 +
* In subtask  '''(4)'''  all four parameters are released for variation,  which are to be determined according to the maximum entropy   ⇒   $H_{\rm max}(X)$ .
  
  
Line 22: Line 23:
  
  
''Hinweise:''
+
Hints:
*Die Aufgabe gehört zum  Kapitel  [[Information_Theory/Einige_Vorbemerkungen_zu_zweidimensionalen_Zufallsgrößen|Einige Vorbemerkungen zu den 2D-Zufallsgrößen]].
+
*The exercise belongs to the chapter  [[Information_Theory/Einige_Vorbemerkungen_zu_zweidimensionalen_Zufallsgrößen|Some preliminary remarks on two-dimensional random variables]].
*Insbesondere wird Bezug genommen auf die Seite  [[Information_Theory/Einige_Vorbemerkungen_zu_zweidimensionalen_Zufallsgrößen#Wahrscheinlichkeitsfunktion_und_Entropie|Wahrscheinlichkeitsfunktion und Entropie]].
+
*In particular, reference is made to the page  [[Information_Theory/Einige_Vorbemerkungen_zu_zweidimensionalen_Zufallsgrößen#Probability_mass_function_and_entropy|Probability mass function and entropy]].
 
   
 
   
  
  
===Fragebogen===
+
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
{Zu welcher Entropie führt die Wahrscheinlichkeitsfunktion&nbsp; $P_X(X) = \big [ 0.1, \ 0.2, \ 0.3, \ 0.4 \big ]$ ?
+
{To which entropy does the probability mass function&nbsp; $P_X(X) = \big [ 0.1, \ 0.2, \ 0.3, \ 0.4 \big ]$ lead?
 
|type="{}"}
 
|type="{}"}
 
$H_{\rm a}(X) \ = \ $ { 1.846 0.5% } $\ \rm bit$  
 
$H_{\rm a}(X) \ = \ $ { 1.846 0.5% } $\ \rm bit$  
  
{Es gelte nun allgemein&nbsp; $P_X(X) = \big [ 0.1, \ 0.2, \ p_3, \ p_4\big ]$.&nbsp; Welche Entropie erhält man, wenn&nbsp; $p_3$&nbsp; und&nbsp; $p_4$&nbsp; bestmöglich gewählt werden?
+
{Let&nbsp; $P_X(X) = \big [ 0.1, \ 0.2, \ p_3, \ p_4\big ]$ apply in general.&nbsp; What entropy is obtained if&nbsp; $p_3$&nbsp; and&nbsp; $p_4$&nbsp; are chosen as best as possible?
 
|type="{}"}
 
|type="{}"}
 
$H_{\rm b}(X) \ = \ $ { 1.857 0.5% } $\ \rm bit$
 
$H_{\rm b}(X) \ = \ $ { 1.857 0.5% } $\ \rm bit$
  
{ Nun gelte&nbsp; $P_X(X) = \big [ 0.1, \ p_2, \ p_3, \ 0.4 \big ]$.&nbsp; Welche Entropie erhält man, wenn&nbsp; $p_2$&nbsp; und&nbsp; $p_3$&nbsp; bestmöglich gewählt werden?
+
{ Now let&nbsp; $P_X(X) = \big [ 0.1, \ p_2, \ p_3, \ 0.4 \big ]$.&nbsp; What entropy is obtained if&nbsp; $p_2$&nbsp; and&nbsp; $p_3$&nbsp; are chosen as best as possible?
 
|type="{}"}
 
|type="{}"}
 
$H_{\rm c}(X) \ = \ $ { 1.861 0.5% } $\ \rm bit$
 
$H_{\rm c}(X) \ = \ $ { 1.861 0.5% } $\ \rm bit$
  
{ Welche Entropie erhält man, wenn alle Wahrscheinlichkeiten &nbsp;$(p_1, \ p_2 , \ p_3, \ p_4)$&nbsp; bestmöglich gewählt werden können?
+
{ What entropy is obtained if all probabilities &nbsp;$(p_1, \ p_2 , \ p_3, \ p_4)$&nbsp; can be chosen as best as possible?
 
|type="{}"}
 
|type="{}"}
 
$H_{\rm max}(X) \ = \ $ { 2 1% } $\ \rm bit$
 
$H_{\rm max}(X) \ = \ $ { 2 1% } $\ \rm bit$
Line 50: Line 51:
 
</quiz>
 
</quiz>
  
===Musterlösung===
+
===Solution===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
'''(1)'''&nbsp;  Mit&nbsp; $P_X(X) = \big [ 0.1, \ 0.2, \ 0.3, \ 0.4 \big ]$&nbsp; erhält man für die Entropie:  
+
'''(1)'''&nbsp;  With&nbsp; $P_X(X) = \big [ 0.1, \ 0.2, \ 0.3, \ 0.4 \big ]$&nbsp; we get for the entropy:
 
:$$H_{\rm a}(X) =  
 
:$$H_{\rm a}(X) =  
 
0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} +
 
0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} +
Line 59: Line 60:
 
0.4 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.4}  
 
0.4 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.4}  
 
\hspace{0.15cm} \underline {= 1.846}  \hspace{0.05cm}.$$
 
\hspace{0.15cm} \underline {= 1.846}  \hspace{0.05cm}.$$
Hier (und bei den anderen Aufgaben) ist jeweils die  Pseudo–Einheit „bit” anzufügen.
+
Here (and in the other tasks) the pseudo-unit&nbsp; "bit"&nbsp; is to be added in each case.
  
  
  
'''(2)'''&nbsp; Die Entropie&nbsp; $H_{\rm b}(X)$&nbsp; lässt sich als Summe zweier Anteile&nbsp;  $H_{\rm b1}(X)$&nbsp; und&nbsp; $H_{\rm b2}(X)$&nbsp; darstellen, mit:  
+
'''(2)'''&nbsp; The entropy&nbsp; $H_{\rm b}(X)$&nbsp; can be represented as the sum of two parts&nbsp;  $H_{\rm b1}(X)$&nbsp; and&nbsp; $H_{\rm b2}(X)$,&nbsp; with:
 
:$$H_{\rm b1}(X) =  
 
:$$H_{\rm b1}(X) =  
 
0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} +
 
0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} +
Line 71: Line 72:
 
(0.7-p_3) \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.7-p_3} \hspace{0.05cm}.$$
 
(0.7-p_3) \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.7-p_3} \hspace{0.05cm}.$$
  
*Die zweite Funktion ist  maximal für&nbsp; $p_3 = p_4 = 0.35$.&nbsp; Ein ähnlicher Zusammenhang hat sich bei der binären Entropiefunktion ergeben.&nbsp;  
+
*The second function is maximum for&nbsp; $p_3 = p_4 = 0.35$.&nbsp; A similar relationship has been found for the binary entropy function. &nbsp;  
*Damit erhält man:  
+
*Thus one obtains:
  
 
:$$H_{\rm b2}(X) = 2 \cdot  
 
:$$H_{\rm b2}(X) = 2 \cdot  
Line 81: Line 82:
  
  
'''(3)'''&nbsp; Analog zur Teilaufgabe&nbsp; '''(2)'''&nbsp; ergibt sich mit&nbsp; $p_1 = 0.1$&nbsp; und&nbsp; $p_4 = 0.4$&nbsp; das Maximum für&nbsp; $p_2 = p_3  = 0.25$:
+
'''(3)'''&nbsp; Analogous to subtask&nbsp; '''(2)''',&nbsp; $p_1 = 0.1$&nbsp; and&nbsp; $p_4 = 0.4$&nbsp; yield the maximum for&nbsp; $p_2 = p_3  = 0.25$:
 
:$$H_{\rm c}(X) =  
 
:$$H_{\rm c}(X) =  
 
0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} +
 
0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} +
Line 90: Line 91:
  
  
'''(4)'''&nbsp; Die maximale Entropie für den Symbolumfang&nbsp; $M=4$&nbsp; ergibt sich bei gleichen Wahrscheinlichkeiten, also für&nbsp; $p_1 = p_2 = p_3 = p_4 = 0.25$:
+
'''(4)'''&nbsp; The maximum entropy for the symbol range&nbsp; $M=4$&nbsp; is obtained for equal probabilities, i.e. for&nbsp; $p_1 = p_2 = p_3 = p_4 = 0.25$:
 
:$$H_{\rm max}(X) =  
 
:$$H_{\rm max}(X) =  
 
{\rm log}_2 \hspace{0.1cm} M  
 
{\rm log}_2 \hspace{0.1cm} M  
 
\hspace{0.15cm} \underline {= 2}  \hspace{0.05cm}.$$
 
\hspace{0.15cm} \underline {= 2}  \hspace{0.05cm}.$$
  
*Die Differenz der Entropien entsprechend&nbsp; '''(4)'''&nbsp; und&nbsp; '''(3)'''&nbsp; ergibt&nbsp; ${\rm \Delta} H(X) = 0.139 \ \rm bit$.&nbsp;  Hierbei gilt:
+
*The difference of the entropies according to&nbsp; '''(4)'''&nbsp; and&nbsp; '''(3)'''&nbsp; gives&nbsp; ${\rm \Delta} H(X) = 0.139 \ \rm bit$.&nbsp;  Here:
 
:$${\rm \Delta}  H(X) = 1-
 
:$${\rm \Delta}  H(X) = 1-
 
0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} -
 
0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} -
Line 101: Line 102:
 
  \hspace{0.05cm}.$$
 
  \hspace{0.05cm}.$$
  
*Mit der binären Entropiefunktion
+
*With the binary entropy function
  
 
:$$H_{\rm bin}(p) =  
 
:$$H_{\rm bin}(p) =  
Line 107: Line 108:
 
(1-p) \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{1-p}$$
 
(1-p) \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{1-p}$$
  
:lässt sich hierfür auch schreiben:
+
:can also be written for this:
  
 
:$${\rm \Delta} H(X) = 0.5 \cdot \big [ 1- H_{\rm bin}(0.2) \big ] =
 
:$${\rm \Delta} H(X) = 0.5 \cdot \big [ 1- H_{\rm bin}(0.2) \big ] =
Line 124: Line 125:
  
  
[[Category:Information Theory: Exercises|^3.1 Allgemeines zu 2D-Zufallsgrößen^]]
+
[[Category:Information Theory: Exercises|^3.1 General Information on 2D Random Variables^]]

Latest revision as of 10:13, 24 September 2021

Probability functions, each with  $M = 4$  elements

In the first row of the adjacent table, the probability mass function denoted by  $\rm (a)$  is given in the following.

For this PMF  $P_X(X) = \big [0.1, \ 0.2, \ 0.3, \ 0.4 \big ]$  the entropy is to be calculated in subtask  (1) :

$$H_{\rm a}(X) = {\rm E} \big [ {\rm log}_2 \hspace{0.1cm} \frac{1}{P_{X}(X)}\big ]= - {\rm E} \big [ {\rm log}_2 \hspace{0.1cm}{P_{X}(X)}\big ].$$

Since the logarithm to the base  $2$  is used here, the pseudo-unit  "bit"  is to be added.

In the further tasks, some probabilities are to be varied in each case in such a way that the greatest possible entropy results:

  • By suitably varying  $p_3$  and  $p_4$,  one arrives at the maximum entropy  $H_{\rm b}(X)$  under the condition  $p_1 = 0.1$  and  $p_2 = 0.2$   ⇒   subtask  (2).
  • By varying  $p_2$  and  $p_3$ appropriately, one arrives at the maximum entropy  $H_{\rm c}(X)$  under the condition  $p_1 = 0.1$  and  $p_4 = 0.4$   ⇒   subtask  (3).
  • In subtask  (4)  all four parameters are released for variation,  which are to be determined according to the maximum entropy   ⇒   $H_{\rm max}(X)$ .





Hints:


Questions

1

To which entropy does the probability mass function  $P_X(X) = \big [ 0.1, \ 0.2, \ 0.3, \ 0.4 \big ]$ lead?

$H_{\rm a}(X) \ = \ $

$\ \rm bit$

2

Let  $P_X(X) = \big [ 0.1, \ 0.2, \ p_3, \ p_4\big ]$ apply in general.  What entropy is obtained if  $p_3$  and  $p_4$  are chosen as best as possible?

$H_{\rm b}(X) \ = \ $

$\ \rm bit$

3

Now let  $P_X(X) = \big [ 0.1, \ p_2, \ p_3, \ 0.4 \big ]$.  What entropy is obtained if  $p_2$  and  $p_3$  are chosen as best as possible?

$H_{\rm c}(X) \ = \ $

$\ \rm bit$

4

What entropy is obtained if all probabilities  $(p_1, \ p_2 , \ p_3, \ p_4)$  can be chosen as best as possible?

$H_{\rm max}(X) \ = \ $

$\ \rm bit$


Solution

(1)  With  $P_X(X) = \big [ 0.1, \ 0.2, \ 0.3, \ 0.4 \big ]$  we get for the entropy:

$$H_{\rm a}(X) = 0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} + 0.2 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.2} + 0.3 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.3} + 0.4 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.4} \hspace{0.15cm} \underline {= 1.846} \hspace{0.05cm}.$$

Here (and in the other tasks) the pseudo-unit  "bit"  is to be added in each case.


(2)  The entropy  $H_{\rm b}(X)$  can be represented as the sum of two parts  $H_{\rm b1}(X)$  and  $H_{\rm b2}(X)$,  with:

$$H_{\rm b1}(X) = 0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} + 0.2 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.2} = 0.797 \hspace{0.05cm},$$
$$H_{\rm b2}(X) = p_3 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{p_3} + (0.7-p_3) \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.7-p_3} \hspace{0.05cm}.$$
  • The second function is maximum for  $p_3 = p_4 = 0.35$.  A similar relationship has been found for the binary entropy function.  
  • Thus one obtains:
$$H_{\rm b2}(X) = 2 \cdot p_3 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{p_3} = 0.7 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.35} = 1.060 $$
$$ \Rightarrow \hspace{0.3cm} H_{\rm b}(X) = H_{\rm b1}(X) + H_{\rm b2}(X) = 0.797 + 1.060 \hspace{0.15cm} \underline {= 1.857} \hspace{0.05cm}.$$


(3)  Analogous to subtask  (2),  $p_1 = 0.1$  and  $p_4 = 0.4$  yield the maximum for  $p_2 = p_3 = 0.25$:

$$H_{\rm c}(X) = 0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} + 2 \cdot 0.25 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.25} + 0.4 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.4} \hspace{0.15cm} \underline {= 1.861} \hspace{0.05cm}.$$


(4)  The maximum entropy for the symbol range  $M=4$  is obtained for equal probabilities, i.e. for  $p_1 = p_2 = p_3 = p_4 = 0.25$:

$$H_{\rm max}(X) = {\rm log}_2 \hspace{0.1cm} M \hspace{0.15cm} \underline {= 2} \hspace{0.05cm}.$$
  • The difference of the entropies according to  (4)  and  (3)  gives  ${\rm \Delta} H(X) = 0.139 \ \rm bit$.  Here:
$${\rm \Delta} H(X) = 1- 0.1 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.1} - 0.4 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.4} \hspace{0.05cm}.$$
  • With the binary entropy function
$$H_{\rm bin}(p) = p \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{p} + (1-p) \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{1-p}$$
can also be written for this:
$${\rm \Delta} H(X) = 0.5 \cdot \big [ 1- H_{\rm bin}(0.2) \big ] = 0.5 \cdot \big [ 1- 0.722 \big ] = 0.139 \hspace{0.05cm}.$$