From Random Experiment to Random Variable

From LNTwww

# OVERVIEW OF THE SECOND MAIN CHAPTER #


This chapter is intended to familiarize you with  discrete random variables  assuming them to be statistically independent. Such random variables are needed in communications engineering, for example, for the simulation of a binary or multilevel digital signal, but equally for the emulation of a channel with statistically independent errors by a digital model, for example, the BSC model.

In detail, it covers:

  • the relationship between probability and relative frequency,
  • the expected values and moments,
  • the binomial and Poisson distributions as special cases of discrete distributions,
  • the generation of pseudorandom binaries using PN generators,  and
  • the generation of multilevel random variables on a digital computer.


For more information on discrete random variables, as well as assignments, simulations, and programming exercises, see

  • Chapter 1:   Discrete Random Variables (Program dis)
  • Chapter 2:   Pseudonoise Generators (Program png)


of the practical course "Simulationsmethoden in der Nachrichtentechnik".  This (former) LNT course at the TU Munich is based on

  • the teaching software package  LNTsim   ⇒   link refers to the ZIP version of the program,  and
  • of the associated  Internship Guide   ⇒   Link refers to the PDF version; Chapters 1 and 2: pages 7-32.



On the concept of random variable


In the first chapter of this book, the term  Random Experiment  has already been explained. By this is meant an experiment that can be repeated any number of times under the same conditions with an uncertain outcome  $E$,  but in which the set  $\{E_μ \}$  of possible outcomes is specifiable.

Often the experimental results are numerical values, as for example in the random experiment "throwing a die".  In contrast, the experiment "coin toss" yields the possible results "heads" and "tails".

For a uniform description of different kinds of experiments and also because of the better manageability one uses the term of  "random variable" .

$\text{Definition:}$  A  random variable  $z$  is a one-to-one mapping of the result set  $\{E_μ \}$  onto the set of real numbers.  Complementary to this definition, it is still allowed that the random variable has a unit in addition to the numerical value.

Definition of a random variable



Some examples of random variables are given below:

  • In the random experiment "throwing a roulette ball", a distinction between  $E$  and  $z$  has no practical implications, but may be useful for formal reasons.  Thus,  $E_μ = 8$ denotes that the ball has come to rest in the spot of the roulette wheel marked "8".  Arithmetic operations  (for example, an expected value formation)  are not possible on the basis of the results.  In contrast, the random variable  $z$  actually denotes a numerical value  $($here integer between  $0$  and  $36)$, from which the expected mean value of the random variable  $($here  $18)$  can be determined.  Quite possible, but not useful, would be, for example, the assignment  $E_μ = 8$    ⇔   $z_μ ≠ 8$.
  • In the "coin toss" experiment, the possible outcomes are  "heads"  and  "tails", to which no arithmetic operations can be applied per se.   Only by the arbitrary but unambiguous assignment between the event set  $\{E_μ\} = \{$"heads", "tails"$ \}$  and the number set  $\{z_μ\} = \{0, 1\}$  a characteristic value can be given here at all.   Similarly, however, one could also specify the assignment "heads"   ⇔   $0$  and "tails"   ⇔   $1$ .
  • In circuit engineering, one designates the two possible logical states of a memory cell (flip-flops) according to the possible voltage levels with  $\rm L$  (Low) and  $\rm H$  (High).  We adopt these designations here also for binary symbols.  For practical work, one usually maps these symbols back to random variables, although this mapping is also arbitrary, but should make sense.
  • In coding theory, it is useful to map  $\{ \text{L, H}\}$  to  $\{0, 1\}$  in order to be able to use the possibilities of modulo algebra.  On the other hand, to describe modulation with bipolar (antipodal) signals, one better chooses the mapping  $\{ \text{L, H}\}$ ⇔ $ \{-1, +1\}$.


Continuous and discrete random variables


$\text{Definition:}$  According to the possible numerical values  $z_μ = z(E_μ)$  we distinguish here between continuous and discrete random variables:

  • continuous random variable  $z$  can – at least in certain ranges – assume infinitely many different values.  More precisely:   The set of admissible values is also uncountable for such variables.
  • Examples for continuous random variables are the speed of a car  $($at appropriate driving between  $v = 0$  and  $v = 120 \ \rm km/h)$  or also the noise voltage at a communication system.  Both random variables have besides a numerical value also a unit.
  • If, on the other hand, the set  $\{z_μ\}$ is countable, it is a  discrete random variable. Usually, the number of possible values of  $z$  is limited to  $M$  In communications engineering,  $M$  is called the symbol range  (in the sense of coding theory)  or the number of steps  (from the point of view of transmission engineering).


First, we restrict ourselves to discrete,  $M$–stage random variables with no internal statistical bindings, which are fully characterized by the  $M$  probabilities of occurrence  $p_μ ={\rm Pr}(z = z_μ)$  according to the section  Some Basic Definitions  .   By definition, the sum over all  $M$  probabilities is equal to  $1$.

In contrast, the probability  ${\rm Pr}(z = z_μ)$  for a continuous random variable  $z$  to take on a very specific value  $z_μ$  is identically zero.   Here, as will be described in the following chapter  Continuous Random Variables  we must move to the  probability density function  (PDF).

Zufallsprozess und Zufallsfolge


$\text{Definition:}$  A  random process  differs from the random experiment considered so far in that it yields not just one outcome (event), but a  temporal sequence of outcomes  (events).


Damit kommt man zur  Zufallsfolge  $\langle z_ν\rangle$  mit den folgenden für unsere Darstellung festgelegten Eigenschaften:

  • Die Laufvariable  $ν$  beschreibt den zeitlichen Prozessablauf und kann Werte zwischen  $1$  und  $N$  annehmen.  Häufig wird eine solche Folge auch als  $N$–dimensionaler Vektor dargestellt.
  • Zu jeder Zeit  $ν$   kann die Zufallsgröße  $z_ν$  einen von  $M$  verschiedenen Werten annehmen.  Wir verwenden hierfür folgende Nomenklatur:
$$z_\nu \in z_\mu \hspace{0.3cm} {\rm mit} \hspace{0.3cm} \nu = 1,\hspace{0.1cm}\text{...} \hspace{0.1cm}, N \hspace{0.3cm} {\rm und} \hspace{0.3cm} \mu = 1,\hspace{0.1cm}\text{...} \hspace{0.1cm} , M.$$
  • Ist der Prozess  ergodisch, so weist jede Zufallsfolge  $\langle z_ν\rangle$  die gleichen statistischen Eigenschaften auf und kann als Repräsentant für den gesamten Zufallsprozess herangezogen werden.
  • Wir setzen hier zunächst voraus, dass zwischen den einzelnen Folgenelementen keine statistischen Bindungen bestehen, das heißt, es gilt für die  bedingten Wahrscheinlichkeiten:
$${\rm Pr}(z_\nu | z_{\nu \rm{ -1}} \hspace{0.1cm}\text{...} \hspace{0.1cm}z_{\rm 1})={\rm Pr}(z_\nu).$$

Mehr und vor allem Genaueres zu der Charakterisierung von Zufallsprozessen finden Sie im späteren Kapitel  Autokorrelationsfunktion.

$\text{Beispiel 1:}$  Wiederholt man das Zufallsexperiment "Werfen einer Roulettekugel" zehnmal, so ergibt sich zum Beispiel folgende Zufallsfolge:

$$\langle z_ν\rangle = \langle \ 8; \ 23; \ 0; \ 17; \ 36; \ 0; \ 33; \ 11; \ 11; \ 25 \ \rangle.$$

Zu jedem Zeitpunkt sind trotzdem – unabhängig von der Vergangenheit – alle Zufallsgrößen zwischen  $0$  und  $36$  möglich und auch gleichwahrscheinlich, was aber aus einer solch kurzen Folge nicht abgelesen werden kann.

Bernoullisches Gesetz der großen Zahlen


$\text{Definitionen:}$  Zur Beschreibung einer  $M$–stufigen Zufallsgröße verwendet man folgende Beschreibungsgrößen, deren Summe über alle  $μ = 1,\hspace{0.1cm}\text{...} \hspace{0.1cm} , M$  jeweils den Wert  $1$  ergeben:

  • Die  Wahrscheinlichkeiten  $p_μ = {\rm Pr}(z = z_μ)$  liefern Vorhersagen über das zu erwartende Ergebnis eines statistischen Versuchs und sind somit so genannte  A-priori-Kenngrößen.
  • Die  relativen Häufigkeiten  $h_μ^{(N)}$  sind  A-posteriori-Kenngrößen  und erlauben statistische Aussagen bezüglich eines vorher durchgeführten Versuches.  Sie werden wie folgt ermittelt:
$$h_{\mu}^{(N)} = \frac{n_{\mu} }{N}= \frac{ {\rm Anzahl \hspace{0.15cm}der \hspace{0.15cm}Versuche \hspace{0.15cm}mit \hspace{0.15cm}dem\hspace{0.15cm} Ergebnis\hspace{0.15cm} }z_{\mu} } { {\rm Anzahl \hspace{0.15cm}aller \hspace{0.15cm}Versuche } } \hspace{1cm}(\mu=1,\hspace{0.1cm}\text{...} \hspace{0.1cm},M).$$


Nur im Grenzfall  $N → ∞$  stimmen die relativen Häufigkeiten mit den entsprechenden Wahrscheinlichkeiten "exakt" überein, zumindest im statistischen Sinne.  Dagegen gilt nach dem von  Jakob I. Bernoulli  formulierten "Gesetz der großen Zahlen" für endliche Werte von  $N$:

$$\rm Pr \left( \it \mid h_\mu^{(N)} - p_\mu\mid \hspace{0.1cm} \ge \varepsilon \hspace{0.1cm} \right) \le \frac{1}{\rm 4\cdot \it N\cdot \varepsilon^{\rm 2}}.$$

Daraus folgt auch die Aussage, dass bei unendlich langen Zufallsfolgen  $(N → ∞)$  die relativen Häufigkeiten  $h_μ^{(N)}$  und die Wahrscheinlichkeiten  $p_μ$  mit der Wahrscheinlichkeit  $1$  identisch sind.

$\text{Beispiel 2:}$  Eine Binärdatei besteht aus  $N = 10^6$  Binärsymbolen ("Bit"), wobei die Nullen und Einsen gleichwahrscheinlich sind:   $p_0 = p_1 = 0.5$.

Das Bernoullische Gesetz der großen Zahlen  $($mit  $\varepsilon = 0.01)$  besagt nun, dass die Wahrscheinlichkeit des Ereignisses  „die Anzahl der Einsen in der Datei liegt zwischen  $495  \hspace{0.05cm}000$  und  $505\hspace{0.05cm}000$”  größer oder gleich  $1 - 1/400 = 99.75\%$  ist.


Die Wahrscheinlichkeit, dass sich die relative Häufigkeit  $h_μ^{(N)}$  eines Ereignisses  $E_μ$  und die zugehörige Wahrscheinlichkeit  $p_μ$  betragsmäßig um mehr als einen Wert  $\varepsilon$  unterscheiden, ist nach obiger Gleichung nicht größer als  $1/(4 · N · ε^2)$.  Für ein gegebenes  $\varepsilon$  und eine zu garantierende Wahrscheinlichkeit kann daraus der minimal erforderliche Wert von  $N$  berechnet werden.

Weiter ist anzumerken:

  • Der monotone Abfall mit  $N$  gilt nur im statistischen Sinne und nicht für jede einzelne Realisierung.  So können beim Experiment "Münzwurf" durchaus nach  $N = 1000$  Würfen die relative Häufigkeiten von "Zahl" und "Bild" exakt gleich  $0.5$  sein  (wenn  $n_{\rm Zahl} = n_{\rm Bild} = 500$  ist)  und nach  $N = 2000$  Würfen wieder mehr oder weniger stark davon abweichen.
  • Führen mehrere Probanden parallel dass Experiment "Münzwurf" durch und stellt man jeweils die relative Häufigkeit in Abhängigkeit von  $N$  dar, so ergeben sich dementsprechend Kurvenverläufe, die zwar tendenziell, aber nicht monoton abfallen.
  • Berechnet man aber den Mittelwert über unendlich viele solcher Kurven, so erhält man den monoton mit  $N$  abfallenden Verlauf gemäß der Bernouillischen Vorhersage.


Mit dieser Thematik, speziell mit dem Experiment von  Karl Pearson, beschäftigt sich das Lernvideo  Bernoullisches Gesetz der großen Zahlen.

Aufgaben zum Kapitel


Aufgabe 2.1: Wahlnachfrage

Aufgabe 2.1Z: Signalverläufe