Difference between revisions of "Aufgaben:Exercise 3.4: Entropy for Different PMF"
Line 45: | Line 45: | ||
===Musterlösung=== | ===Musterlösung=== | ||
{{ML-Kopf}} | {{ML-Kopf}} | ||
− | '''1 | + | '''(1)''' Mit PX(X)=[0.1,0.2,0.3,0.4] erhält man für die Entropie: |
− | + | :$$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} + | ||
0.2 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.2} + | 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.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} | 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. | Hier (und bei den anderen Aufgaben) ist jeweils die Pseudo–Einheit „bit” anzufügen. | ||
− | '''2 | + | '''(2)''' Die Entropie $H_{\rm b}(X)$ lässt sich als Summe zweier Anteile $H_{\rm b1}(X)undH_{\rm b2}(X)$ darstellen, mit: |
− | + | :$$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} + | ||
− | 0.2 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.2} = 0.797 \hspace{0.05cm}$$ | + | 0.2 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.2} = 0.797 \hspace{0.05cm},$$ |
− | + | :$$H_{\rm b2}(X) = | |
− | $$H_{\rm b2}(X) = | ||
p_3 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{p_3} + | 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}$$ | + | (0.7-p_3) \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.7-p_3} \hspace{0.05cm}.$$ |
− | Die zweite Funktion ist für $ | + | Die zweite Funktion ist maximal für $p_3 = p_4 = 0.35$. Ein ähnlicher Zusammenhang hat sich bei der binären Entropiefunktion ergeben. Damit erhält man: |
− | $$H_{\rm b2}(X) = 2 \cdot | + | :$$H_{\rm b2}(X) = 2 \cdot |
p_3 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{p_3} = | 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$$ | 0.7 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.35} = 1.060$$ | ||
+ | :⇒Hb(X)=Hb1(X)+Hb2(X)=0.797+1.060=1.857_. | ||
− | |||
− | |||
− | |||
− | |||
− | $$H_{\rm c}(X) = | + | '''(3)''' Analog zur Teilaufgabe (2) ergibt sich mit p1=0.1, p4=0.4 das Maximum für p2=p3=p3=0.25: |
+ | :$$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} + | ||
2 \cdot 0.25 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.25} + | 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} | 0.4 \cdot {\rm log}_2 \hspace{0.1cm} \frac{1}{0.4} | ||
− | \hspace{0.15cm} \underline {= 1.861} \hspace{0.05cm}$$ | + | \hspace{0.15cm} \underline {= 1.861} \hspace{0.05cm}.$$ |
− | |||
− | |||
− | $$H_{\rm max}(X) = | + | '''(4)''' Die maximale Entropie für den Symbolumfang M=4 ergibt sich bei gleichen Wahrscheinlichkeiten ( p1=p2=p3=p4=0.25): |
+ | :$$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}.$$ |
− | |||
− | |||
− | $$\Delta H(X) = 1- | + | Die Differenz der Entropien entsprechend (4) und (3) ergibt ΔH(X)=0.139 bit. Hierbei gilt: |
+ | :$${\it \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} - | ||
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.05cm}$$ | + | \hspace{0.05cm}.$$ |
Mit der binären Entropiefunktion | Mit der binären Entropiefunktion | ||
Line 105: | Line 97: | ||
lässt sich hierfür auch schreiben: | lässt sich hierfür auch schreiben: | ||
− | $$\Delta H(X) = 0.5 \cdot \left [ 1- H_{\rm bin}(0.2) \right ] = | + | $${\it \Delta} H(X) = 0.5 \cdot \left [ 1- H_{\rm bin}(0.2) \right ] = |
0.5 \cdot \left [ 1- 0.722 \right ] = 0.139 | 0.5 \cdot \left [ 1- 0.722 \right ] = 0.139 | ||
− | \hspace{0.05cm}$$ | + | \hspace{0.05cm}.$$ |
Revision as of 15:18, 30 May 2017
In der ersten Zeile der nebenstehenden Tabelle ist die im Folgenden die mit „a” bezeichnete Wahrscheinlichkeitsfunktion angegeben. Für diese PMF PX(X)=[0.1,0.2,0.3,0.4] soll soll in der Teilaufgabe (1) die Entropie berechnet werden:
- Ha(X)=E[log21PX(X)]=−E[log2PX(X)].
Da hier der Logarithmus zur Basis 2 verwendet wird, ist die Pseudo–Einheit „bit” anzufügen.
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 p3 und p4 kommt man zur maximalen Entropie Hb(X) unter der Voraussetzung p1=0.1 und p2=0.2 ⇒ Teilaufgabe (2).
- Durch geeignete Variation von p2 und p3 kommt man zur maximalen Entropie Hc(X) unter der Voraussetzung p1=0.1 und p4=0.4 ⇒ Teilaufgabe (3).
- In der Teilaufgabe (4) sind alle vier Parameter zur Variation freigegeben, die entsprechend der maximalen Entropie ⇒ Hmax(X) zu bestimmen sind.
Hinweise:
- Die Aufgabe gehört zum Kapitel Einige Vorbemerkungen zu den 2D-Zufallsgrößen.
- Insbesondere wird Bezug genommen auf die Seite Wahrscheinlichkeitsfunktion undEntropie.
- Sollte die Eingabe des Zahlenwertes „0” erforderlich sein, so geben Sie bitte „0.” ein.
Fragebogen
Musterlösung
- Ha(X)=0.1⋅log210.1+0.2⋅log210.2+0.3⋅log210.3+0.4⋅log210.4=1.846_.
Hier (und bei den anderen Aufgaben) ist jeweils die Pseudo–Einheit „bit” anzufügen.
(2) Die Entropie Hb(X) lässt sich als Summe zweier Anteile Hb1(X) und Hb2(X) darstellen, mit:
- Hb1(X)=0.1⋅log210.1+0.2⋅log210.2=0.797,
- Hb2(X)=p3⋅log21p3+(0.7−p3)⋅log210.7−p3.
Die zweite Funktion ist maximal für p3=p4=0.35. Ein ähnlicher Zusammenhang hat sich bei der binären Entropiefunktion ergeben. Damit erhält man:
- Hb2(X)=2⋅p3⋅log21p3=0.7⋅log210.35=1.060
- ⇒Hb(X)=Hb1(X)+Hb2(X)=0.797+1.060=1.857_.
(3) Analog zur Teilaufgabe (2) ergibt sich mit p1=0.1, p4=0.4 das Maximum für p2=p3=p3=0.25:
- Hc(X)=0.1⋅log210.1+2⋅0.25⋅log210.25+0.4⋅log210.4=1.861_.
(4) Die maximale Entropie für den Symbolumfang M=4 ergibt sich bei gleichen Wahrscheinlichkeiten ( p1=p2=p3=p4=0.25):
- Hmax(X)=log2M=2_.
Die Differenz der Entropien entsprechend (4) und (3) ergibt ΔH(X)=0.139 bit. Hierbei gilt:
- ΔH(X)=1−0.1⋅log210.1−0.4⋅log210.4.
Mit der binären Entropiefunktion
Hbin(p)=p⋅log21p+(1−p)⋅log211−p
lässt sich hierfür auch schreiben:
ΔH(X)=0.5⋅[1−Hbin(0.2)]=0.5⋅[1−0.722]=0.139.