Difference between revisions of "Aufgaben:Exercise 1.7Z: BARBARA Generator"

From LNTwww
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
  
{{quiz-Header|Buchseite=Stochastische Signaltheorie/Markovketten}}
+
{{quiz-Header|Buchseite=Theory_of_Stochastic_Signals/Markov_Chains}}
  
[[File:P_ID454__Sto_Z_1_7.png|right|BARBARA-Generator]]
+
[[File:P_ID454__Sto_Z_1_7.png|right|frame|$\rm BARBARA$  Generator]]
Betrachtet wird hier ein ternärer Zufallsgenerator mit den Symbolen $A$, $B$ und $R$, der durch eine homogene und stationäre Markovkette erster Ordnung beschrieben werden kann.
+
Here we consider a ternary random generator with symbols  $A$,  $B$  and  $R$,  which can be described by a homogeneous and stationary first order Markov chain.
  
Die Übergangswahrscheinlichkeiten können dem skizzierten Markovdiagramm entnommen werden. Für die ersten drei Teilaufgaben soll stets $p = 1/4$ gelten.
+
*The transition probabilities can be taken from the sketched Markov diagram.
 +
*For the first three subtasks,  $p = 1/4$  should always hold.
  
''Hinweise:''
 
*Die Aufgabe gehört zum  Kapitel [[Stochastische_Signaltheorie/Markovketten|Markovketten]].
 
*Sollte die Eingabe des Zahlenwertes „0” erforderlich sein, so geben Sie bitte „0.” ein.
 
  
 +
Hints:
 +
*The exercise belongs to the chapter  [[Theory_of_Stochastic_Signals/Markov_Chains|Markov Chains]].
 +
  
===Fragebogen===
+
 
 +
===Questions===
  
 
<quiz display=simple>
 
<quiz display=simple>
{Welche der nachfolgenden Aussagen sind zutreffend?
+
{Which of the following statements are true?
 
|type="[]"}
 
|type="[]"}
- Die Werte von $p > 0$ und $q < 1$ sind weitgehend frei wählbar.
+
- The values of&nbsp; $p > 0$&nbsp; and&nbsp; $q < 1$&nbsp; are largely arbitrary.
+ Für die Übergangswahrscheinlichkeiten muss gelten: &nbsp; $p + q = 1$.
+
+ For the transition probabilities,&nbsp; the following must hold: &nbsp; $p + q = 1$.
+ Alle Symbole haben gleiche ergodische Wahrscheinlichkeiten.
+
+ All symbols have equal ergodic probabilities.
- Es gilt hier: ${\rm Pr}(A) = 1/2, \; {\rm Pr}(B) = 1/3, \; {\rm Pr}(R) = 1/6$.
+
- It holds here:&nbsp; ${\rm Pr}(A) = 1/2, \; {\rm Pr}(B) = 1/3, \; {\rm Pr}(R) = 1/6$.
  
{Wie groß sind die bedingten Wahrscheinlichkeiten $p_{\rm A}$, $p_{\rm B}$ und $p_{\rm C}$, dass im Zeitbereich zwischen $ν+1$ und $ν+7$ $\rm die Sequenz $BARBARA$ ausgegeben wird, wenn man sich zum Zeitpunkt $ν$ im Zustand $A$, $B$ bzw. $R$ befindet? Es gelte $p = 1/4$.
+
{What are the conditional probabilities&nbsp; $p_{\rm A}$,&nbsp; $p_{\rm B}$&nbsp; and&nbsp; $p_{\rm C}$ that at times between&nbsp; $ν+1$&nbsp; and&nbsp; $ν+7$&nbsp; the sequence&nbsp; "$\rm BARBARA$"&nbsp; is output, <br>if one is at time&nbsp; $ν$&nbsp; in state&nbsp; $A$,&nbsp; $B$&nbsp; or&nbsp; $R$,&nbsp; respectively?&nbsp; Let&nbsp; $p = 1/4$.
 
|type="{}"}
 
|type="{}"}
$p_{\rm A} \ =$  { 0.549 3% } $\ \cdot 10^{-3}$  
+
$p_{\rm A} \ = \ $  { 0.549 3% } $\ \cdot 10^{-3}$  
$p_{\rm B} \ =$ { 0. } $\ \cdot 10^{-3}$  
+
$p_{\rm B} \ = \ $ { 0. } $\ \cdot 10^{-3}$  
$p_{\rm C} \ =$ { 0.183 3% } $\ \cdot 10^{-3}$  
+
$p_{\rm C} \ = \ $ { 0.183 3% } $\ \cdot 10^{-3}$  
  
{Wie groß ist die Wahrscheinlichkeit insgesamt, dass der Generator zu sieben aufeinanderfolgenden Zeitpunkten die Sequenz $BARBARA$ ausgibt.  Es gelte weiter $(p = 1/4)$?
+
{What is the overall probability that the generator outputs the sequence&nbsp; "$\rm BARBARA$"?&nbsp;  Let&nbsp; $p = 1/4$ continue to hold.
 
|type="{}"}
 
|type="{}"}
$p = 1/4\hspace{-0.1cm}: \hspace{0.3cm}{\rm Pr}(BARBARA)\ =$ { 0.244 3% } $\ \cdot 10^{-3}$
+
${\rm Pr}(\rm BARBARA)\ = \ $ { 0.244 3% } $\ \cdot 10^{-3}$
  
{Wie ist der Parameter $p_{\rm opt}$ zu wählen, damit $Pr(BARBARA)$ möglichst groß wird? Welche Wahrscheinlichkeit ergibt sich damit für BARBARA?
+
{How should the parameter&nbsp; $p_{\rm opt}$&nbsp; be chosen to make&nbsp; ${\rm Pr}(\rm BARBARA)$&nbsp; as large as possible? <br>What is the resulting probability for&nbsp; "$\rm BARBARA$"?
 
|type="{}"}
 
|type="{}"}
$p_{\rm opt} \ =$  { 0.8333 3% }
+
$p_{\rm opt} \ = \ $  { 0.8333 3% }
$p = p_{\rm opt}\hspace{-0.1cm}: \hspace{0.3cm}{\rm Pr}(BARBARA)$ = { 22 3% } $\ \cdot 10^{-3}$
+
$p = p_{\rm opt}\hspace{-0.1cm}: \hspace{0.3cm}{\rm Pr}(\rm BARBARA)\ = \ $ { 22 3% } $\ \cdot 10^{-3}$
  
 
</quiz>
 
</quiz>
Line 41: Line 43:
 
===Musterlösung===
 
===Musterlösung===
 
{{ML-Kopf}}
 
{{ML-Kopf}}
:<b>1.</b>&nbsp;&nbsp;Die Summe aller abgehenden Pfeile muss immer 1 sein. Deshalb gilt <i>q</i> = 1 - <i>p</i>. Aufgrund der Symmetrie des Markovdiagramms sind die ergodischen Wahrscheinlichkeiten alle gleich:
+
'''(1)'''&nbsp; Correct are&nbsp; <u>the second and third suggested solutions</u>:
 +
*The sum of all outgoing arrows must always be&nbsp; $1$.&nbsp; Therefore&nbsp; $q = 1 - p$ holds.  
 +
*Because of the symmetry of the Markov diagram,&nbsp; the ergodic probabilities are all equal:
 
:$${\rm Pr}(A) ={\rm Pr}(B) ={\rm Pr}(R) = 1/3.$$
 
:$${\rm Pr}(A) ={\rm Pr}(B) ={\rm Pr}(R) = 1/3.$$
:Richtig sind somit <u>der zweite und der dritte Lösungsvorschlag</u>.
 
:<b>2.</b>&nbsp;&nbsp;Wenn man zum Zeitpunkt <i>&nu;</i> im Zustand <i>B</i> ist, ist für den Zeitpunkt <i>&nu;</i> + 1 wegen Pr(<i>B</i>|<i>B</i>) = 0 der Zustand <i>B</i> nicht möglich. Man scheitert hier bereits beim Anfangsbuchstaben &bdquo;<i>B</i>&rdquo;: <i>p</i><sub>B</sub> <u>= 0</u>
 
  
:F&uuml;r die Berechnung von <i>p</i><sub>A</sub> ist zu beachten: Ausgehend von <i>A</i> geht man im Markovdiagramm zun&auml;chst zu <i>B</i> (mit der Wahrscheinlichkeit <i>q</i>), dann f&uuml;nfmal im Uhrzeigersinn (jeweils mit der Wahrscheinlichkeit <i>p</i>) und schlie&szlig;lich noch von <i>R</i> nach <i>A</i> (mit der Wahrscheinlichkeit <i>q</i>). Das bedeutet:0</u>.
+
 
:$$p_{\rm A} = q^2 \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 = 3^2 / 4^7 \hspace{0.15cm}\underline {\approx 5.49 \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-4}}.$$
+
'''(2)'''&nbsp; If one is in the state&nbsp; $B$&nbsp; at the starting time&nbsp; $\nu=0$,&nbsp; because of&nbsp; ${\rm Pr}(B\hspace{0.05cm}|\hspace{0.05cm}B) = 0$&nbsp; the state&nbsp; $B$&nbsp; is not possible at time&nbsp; $\nu=1$.
:In &auml;hnlicher Weise erh&auml;lt man:
+
*One fails here already with the initial letter&nbsp; $B$:
:$$p_{\rm R} = q \hspace{0.05cm}\cdot \hspace{0.05cm} p^6 = 3 / 4^7 \hspace{0.15cm}\underline {\approx 1.83 \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-4}}.$$
+
:$$p_{\rm B} \; \underline{ =0}.$$
:<b>3.</b>&nbsp;&nbsp;Durch Mittelung &uuml;ber die bedingten Wahrscheinlichkeiten erh&auml;lt man:
+
 
:$${\rm Pr}(BARBARA) = p_{\rm A}  \hspace{0.05cm}\cdot \hspace{0.05cm} {\rm Pr}(A) \hspace{0.1cm} + \hspace{0.1cm}p_{\rm B}  \hspace{0.05cm}\cdot \hspace{0.05cm} {\rm Pr}(B) \hspace{0.1cm} + \hspace{0.1cm}p_{\rm R}  \hspace{0.05cm}\cdot \hspace{0.05cm} {\rm Pr}(R).$$
+
*For the calculation of&nbsp; $p_{\rm A}$&nbsp; it should be noted: &nbsp; Starting from&nbsp; $A$&nbsp; one goes in the Markov diagram first to&nbsp; $B$&nbsp; $($with probability $q)$,&nbsp; then five times clockwise&nbsp; $($each time with probability $p)$&nbsp; and finally from&nbsp; $R$&nbsp; to&nbsp; $A$&nbsp; $($with probability&nbsp; $q)$. &nbsp; Meaning:
:Dies f&uuml;hrt zu dem Ergebnis:
+
:$$p_{\rm A} = q^2 \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 = 3^2 / 4^7 \hspace{0.15cm}\underline {\approx 0.549 \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-3}}.$$
:$${\rm Pr}(BARBARA) \hspace{-0.15cm} = \hspace{-0.15cm} \frac {1}{3} \cdot \left( q^2 \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 \hspace{0.1cm} +\hspace{0.1cm}0 \hspace{0.1cm} +\hspace{0.1cm}q \hspace{0.05cm}\cdot \hspace{0.05cm} p^6 \right)  
+
*In a similar way,&nbsp; one obtains:
  = \frac{q \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 }{3} \cdot (p+q) = \\
+
:$$p_{\rm R} = q \hspace{0.05cm}\cdot \hspace{0.05cm} p^6 = 3 / 4^7 \hspace{0.15cm}\underline {\approx 0.183 \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-3}}.$$
= \hspace{-0.15cm} \frac{q \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 }{3}
+
 
  \hspace{0.15cm}\underline { \approx 2.44  \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-4}}.$$
+
 
:<b>4.</b>&nbsp;&nbsp;Die im Punkt c) berechnete Wahrscheinlichkeit lautet <i>p</i><sup>5</sup> &middot; (1 - <i>p</i>)/3, wobei <i>q</i> = 1 &ndash; <i>p</i> berücksichtigt ist. Durch Nullsetzen des Differentials erh&auml;lt man die Bestimmungsgleichung:
+
'''(3)'''&nbsp; By averaging over the conditional probabilities we obtain:
:$$5 \cdot p^4 - 6 \cdot p^5 = 0 \hspace{0.5cm} \Rightarrow \hspace{0.5cm} p = 5/6 \hspace{0.15cm}\underline { \approx \rm 0.833}.$$
+
:$${\rm Pr}(\rm BARBARA) = p_{\rm A}  \hspace{0.05cm}\cdot \hspace{0.05cm} {\rm Pr}(A) \hspace{0.1cm} + \hspace{0.1cm}p_{\rm B}  \hspace{0.05cm}\cdot \hspace{0.05cm} {\rm Pr}(B) \hspace{0.1cm} + \hspace{0.1cm}p_{\rm R}  \hspace{0.05cm}\cdot \hspace{0.05cm} {\rm Pr}(R).$$
:Damit ergibt sich ein gegen&uuml;ber c) etwa um den Faktor 90 gr&ouml;&szlig;erer Wert: &nbsp;Pr(<i>BARBARA</i>) <u>&asymp; 0.022</u>.
+
*This leads to the result:
 +
:$${\rm Pr}(\rm BARBARA) = {1}/{3} \cdot \left( q^2 \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 \hspace{0.1cm} +\hspace{0.1cm}0 \hspace{0.1cm} +\hspace{0.1cm}q \hspace{0.05cm}\cdot \hspace{0.05cm} p^6 \right)  
 +
  = \frac{q \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 }{3} \cdot{p+q}
 +
= \hspace{-0.15cm} \frac{q \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 }{3}
 +
  \hspace{0.15cm}\underline { \approx 0.244 \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-3}}.$$
 +
 
 +
'''(4)'''&nbsp; The probability calculated in&nbsp; '''(3)'''&nbsp; is&nbsp; $p^5 \cdot (1-p)/3$,&nbsp; where&nbsp; $q= 1-p$&nbsp; is considered.  
 +
 
 +
*By setting the differential to zero, we obtain the governing equation:
 +
:$$5 \cdot p^4 - 6 \cdot p^5 = 0 \hspace{0.5cm} \Rightarrow \hspace{0.5cm} p_{\rm opt} = 5/6 \hspace{0.15cm}\underline { \approx \rm 0.833}.$$
 +
*This results in a value that is larger than the subtask&nbsp; '''(3)'''&nbsp; by a factor&nbsp; $90$&nbsp; approximately:
 +
:$${\rm Pr}\rm (BARBARA) \hspace{0.15cm}\underline { \approx 22 \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-3}}.$$
 +
 
 
{{ML-Fuß}}
 
{{ML-Fuß}}
  
  
  
[[Category:Aufgaben zu Stochastische Signaltheorie|^1.4 Markovketten
+
[[Category:Theory of Stochastic Signals: Exercises|^1.4 Markov Chains
 
^]]
 
^]]

Latest revision as of 17:29, 2 December 2021

$\rm BARBARA$  Generator

Here we consider a ternary random generator with symbols  $A$,  $B$  and  $R$,  which can be described by a homogeneous and stationary first order Markov chain.

  • The transition probabilities can be taken from the sketched Markov diagram.
  • For the first three subtasks,  $p = 1/4$  should always hold.


Hints:


Questions

1

Which of the following statements are true?

The values of  $p > 0$  and  $q < 1$  are largely arbitrary.
For the transition probabilities,  the following must hold:   $p + q = 1$.
All symbols have equal ergodic probabilities.
It holds here:  ${\rm Pr}(A) = 1/2, \; {\rm Pr}(B) = 1/3, \; {\rm Pr}(R) = 1/6$.

2

What are the conditional probabilities  $p_{\rm A}$,  $p_{\rm B}$  and  $p_{\rm C}$ that at times between  $ν+1$  and  $ν+7$  the sequence  "$\rm BARBARA$"  is output,
if one is at time  $ν$  in state  $A$,  $B$  or  $R$,  respectively?  Let  $p = 1/4$.

$p_{\rm A} \ = \ $

$\ \cdot 10^{-3}$
$p_{\rm B} \ = \ $

$\ \cdot 10^{-3}$
$p_{\rm C} \ = \ $

$\ \cdot 10^{-3}$

3

What is the overall probability that the generator outputs the sequence  "$\rm BARBARA$"?  Let  $p = 1/4$ continue to hold.

${\rm Pr}(\rm BARBARA)\ = \ $

$\ \cdot 10^{-3}$

4

How should the parameter  $p_{\rm opt}$  be chosen to make  ${\rm Pr}(\rm BARBARA)$  as large as possible?
What is the resulting probability for  "$\rm BARBARA$"?

$p_{\rm opt} \ = \ $

$p = p_{\rm opt}\hspace{-0.1cm}: \hspace{0.3cm}{\rm Pr}(\rm BARBARA)\ = \ $

$\ \cdot 10^{-3}$


Musterlösung

(1)  Correct are  the second and third suggested solutions:

  • The sum of all outgoing arrows must always be  $1$.  Therefore  $q = 1 - p$ holds.
  • Because of the symmetry of the Markov diagram,  the ergodic probabilities are all equal:
$${\rm Pr}(A) ={\rm Pr}(B) ={\rm Pr}(R) = 1/3.$$


(2)  If one is in the state  $B$  at the starting time  $\nu=0$,  because of  ${\rm Pr}(B\hspace{0.05cm}|\hspace{0.05cm}B) = 0$  the state  $B$  is not possible at time  $\nu=1$.

  • One fails here already with the initial letter  $B$:
$$p_{\rm B} \; \underline{ =0}.$$
  • For the calculation of  $p_{\rm A}$  it should be noted:   Starting from  $A$  one goes in the Markov diagram first to  $B$  $($with probability $q)$,  then five times clockwise  $($each time with probability $p)$  and finally from  $R$  to  $A$  $($with probability  $q)$.   Meaning:
$$p_{\rm A} = q^2 \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 = 3^2 / 4^7 \hspace{0.15cm}\underline {\approx 0.549 \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-3}}.$$
  • In a similar way,  one obtains:
$$p_{\rm R} = q \hspace{0.05cm}\cdot \hspace{0.05cm} p^6 = 3 / 4^7 \hspace{0.15cm}\underline {\approx 0.183 \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-3}}.$$


(3)  By averaging over the conditional probabilities we obtain:

$${\rm Pr}(\rm BARBARA) = p_{\rm A} \hspace{0.05cm}\cdot \hspace{0.05cm} {\rm Pr}(A) \hspace{0.1cm} + \hspace{0.1cm}p_{\rm B} \hspace{0.05cm}\cdot \hspace{0.05cm} {\rm Pr}(B) \hspace{0.1cm} + \hspace{0.1cm}p_{\rm R} \hspace{0.05cm}\cdot \hspace{0.05cm} {\rm Pr}(R).$$
  • This leads to the result:
$${\rm Pr}(\rm BARBARA) = {1}/{3} \cdot \left( q^2 \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 \hspace{0.1cm} +\hspace{0.1cm}0 \hspace{0.1cm} +\hspace{0.1cm}q \hspace{0.05cm}\cdot \hspace{0.05cm} p^6 \right) = \frac{q \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 }{3} \cdot{p+q} = \hspace{-0.15cm} \frac{q \hspace{0.05cm}\cdot \hspace{0.05cm} p^5 }{3} \hspace{0.15cm}\underline { \approx 0.244 \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-3}}.$$

(4)  The probability calculated in  (3)  is  $p^5 \cdot (1-p)/3$,  where  $q= 1-p$  is considered.

  • By setting the differential to zero, we obtain the governing equation:
$$5 \cdot p^4 - 6 \cdot p^5 = 0 \hspace{0.5cm} \Rightarrow \hspace{0.5cm} p_{\rm opt} = 5/6 \hspace{0.15cm}\underline { \approx \rm 0.833}.$$
  • This results in a value that is larger than the subtask  (3)  by a factor  $90$  approximately:
$${\rm Pr}\rm (BARBARA) \hspace{0.15cm}\underline { \approx 22 \hspace{0.05cm}\cdot \hspace{0.05cm} 10^{-3}}.$$