„Empirisches Gesetz der großen Zahlen“

> restart;

Zufallsgenerator initialisieren:

> _seed:=readlib(randomize)(); #wg. Maple 5 Abwärtskompatibilität

_seed := 1030808156

laplace - Zufallsfunktion, gibt 0 (="Zahl") oder 1 (="Kopf") zurück.

> laplace:=rand(0..1);

laplace := proc () local t; global _seed; _seed := ...

n - Anzahl der Würfe:

> n:=200;

n := 200

kopf - Liste der n Ereignisse:

> kopf:=[seq(laplace(), i=1..n)];

kopf := [1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, ...
kopf := [1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, ...
kopf := [1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, ...
kopf := [1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, ...

k( i ) - Anzahl des Ereignisses "Kopf" bis zum i-ten Wurf :

> k:=i->sum(kopf[a], a=1..i);

k := proc (i) options operator, arrow; sum(kopf[a],...

Absolute Abweichung bis zum i-ten Wurf :

> AbsoluteAbweichung := i -> (i*0.5-k(i));

AbsoluteAbweichung := proc (i) options operator, ar...

Plot der Absoluten Abweichung (rot) :

> plot([AbsoluteAbweichung(i)], i=1..n, style=line, numpoints=n, adaptive=false, title="Absolute Abweichung");

[Maple Plot]

Relative Häufigkeit von Ereigniss "Kopf" bis zum i-ten Wurf :

> RelativeHaeufigkeit := i -> k(i)/i;

RelativeHaeufigkeit := proc (i) options operator, a...

epsilon: Abweichung von dem Erwartungswert 0.5 :

> epsilon := 0.04;

epsilon := .4e-1

Plot der Relative Häufigkeit (rot) mit Wahrscheinlichkeit für "Kopf" (grün) und Epsilon-"Schlauch" (blau):

> plot([RelativeHaeufigkeit(i), 0.5, 0.5+epsilon, 0.5-epsilon], i=1..n, 0..1, style=line, numpoints=n, adaptive=false, title="Relative Häufigkeit", color=[red, green, blue, blue]);

[Maple Plot]

Fortsetzung mit weiteren n Würfen

>

kopf - Liste der n Ereignisse:

> kopf:=[op(kopf),seq(laplace(), i=1..n)];

kopf := [0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, ...
kopf := [0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, ...

Plot der Absoluten Abweichung (rot) mit Wahrscheinlichkeit für "Kopf" (grün) :

> plot([AbsoluteAbweichung(i)], i=1..2*n, style=line, numpoints=2*n, adaptive=false, title="Absolute Abweichung");

[Maple Plot]

Plot der Relative Häufigkeit (rot) mit Wahrscheinlichkeit für "Kopf" (grün) und Epsilon-"Schlauch" (blau):

> plot([RelativeHaeufigkeit(i), 0.5, 0.5+epsilon, 0.5-epsilon], i=1..2*n, 0..1, style=line, numpoints=2*n, adaptive=false, title="Relative Häufigkeit", color=[red, green, blue, blue]);

[Maple Plot]

>