<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki-de.moshellshocker.dns64.de/index.php?action=history&amp;feed=atom&amp;title=Box-Muller-Methode</id>
	<title>Box-Muller-Methode - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-de.moshellshocker.dns64.de/index.php?action=history&amp;feed=atom&amp;title=Box-Muller-Methode"/>
	<link rel="alternate" type="text/html" href="https://wiki-de.moshellshocker.dns64.de/index.php?title=Box-Muller-Methode&amp;action=history"/>
	<updated>2026-05-24T00:41:26Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Wikipedia (Deutsch) – Lokale Kopie</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki-de.moshellshocker.dns64.de/index.php?title=Box-Muller-Methode&amp;diff=130871&amp;oldid=prev</id>
		<title>imported&gt;SweetWood: Wikicode optimiert; Wikilink eingefügt; (TeX-)Formelsatz optimiert; Tippfehler behoben; Abschnitt „Weblinks“ eingefügt</title>
		<link rel="alternate" type="text/html" href="https://wiki-de.moshellshocker.dns64.de/index.php?title=Box-Muller-Methode&amp;diff=130871&amp;oldid=prev"/>
		<updated>2025-06-28T15:07:29Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/Wikicode&quot; class=&quot;mw-redirect&quot; title=&quot;Wikicode&quot;&gt;Wikicode&lt;/a&gt; optimiert; &lt;a href=&quot;/index.php/Wikilink&quot; class=&quot;mw-redirect&quot; title=&quot;Wikilink&quot;&gt;Wikilink&lt;/a&gt; eingefügt; (&lt;a href=&quot;/index.php/Hilfe:TeX&quot; title=&quot;Hilfe:TeX&quot;&gt;TeX&lt;/a&gt;-)&lt;a href=&quot;/index.php/Formelsatz&quot; title=&quot;Formelsatz&quot;&gt;Formelsatz&lt;/a&gt; optimiert; Tippfehler behoben; Abschnitt „Weblinks“ eingefügt&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Datei:Box Muller.svg|mini|160px|Grafische Veran&amp;amp;shy;schau&amp;amp;shy;lichung der Box-Muller-Methode]]&lt;br /&gt;
Die &amp;#039;&amp;#039;&amp;#039;Box-Muller-Methode&amp;#039;&amp;#039;&amp;#039; (nach [[George Edward Pelham Box]] und [[Mervin Edgar Muller]] 1958) ist ein Verfahren zur Erzeugung [[Normalverteilung|normalverteilter]] [[Zufallszahl]]en.&lt;br /&gt;
&lt;br /&gt;
== Definition ==&lt;br /&gt;
[[Datei:Box-Muller transform visualisation.svg|mini|Visualisierung der Box-Muller-Methode. Die farbigen Punkte des [[Einheitsquadrat]]s (&amp;#039;&amp;#039;u&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;, &amp;#039;&amp;#039;u&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;), die als Kreise gezeichnet werden, werden einem Punkt in der [[Komplexe Zahlenebene|komplexen Zahlenebene]] zugeordnet, das als Kreuze gezeichnet ist. Die Darstellungen an den Rändern sind die [[Wahrscheinlichkeitsverteilung|Wahrscheinlichkeits&amp;amp;shy;verteilungen]] von &amp;#039;&amp;#039;z&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;0&amp;lt;/sub&amp;gt; und &amp;#039;&amp;#039;z&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt;.]]&lt;br /&gt;
Bei dieser Methode werden zunächst zwei unabhängige [[Standardzufallszahl]]en &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;u_2&amp;lt;/math&amp;gt; benötigt. Diese lassen sich beispielsweise mit einem [[Zufallszahlengenerator]] erzeugen. Standardzufallszahlen unterliegen einer [[Rechteckverteilung]] mit den Parametern &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Es lässt sich zeigen, dass man nach folgendem Transformationsschritt daraus zwei [[Standardnormalverteilung|standardnormalverteilte]] (stochastisch) unabhängige Zufallszahlen &amp;lt;math&amp;gt;z_0&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;z_1&amp;lt;/math&amp;gt; erhält:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;z_0 = \sqrt{-2 \ln u_1} \cos ( 2 \pi u_2 )&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
und&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;z_1 = \sqrt{-2 \ln u_1} \sin ( 2 \pi u_2 )&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Schreibt man das [[Geordnetes Paar|Paar]] &amp;lt;math&amp;gt;(z_ 0, z_1)&amp;lt;/math&amp;gt; in [[Polarkoordinate]]n, also&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;z_0 = r \cos \varphi&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;z_1 = r \sin \varphi&amp;lt;/math&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
dann gilt:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;r = \sqrt{-2 \ln u_1}\ &amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;\varphi = 2 \pi u_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Anwendung der  [[Inversionsmethode]] zur Transformation von &amp;lt;math&amp;gt;u_1&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;u_2&amp;lt;/math&amp;gt; in die Polarkoordinaten &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;\varphi&amp;lt;/math&amp;gt; zeigt, dass &amp;lt;math&amp;gt;\varphi&amp;lt;/math&amp;gt; einer [[Rechteckverteilung]] mit den Parametern &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;2 \pi&amp;lt;/math&amp;gt; unterliegt und &amp;lt;math&amp;gt;r^2&amp;lt;/math&amp;gt; einer [[Exponentialverteilung]] mit dem Parameter &amp;lt;math&amp;gt;\tfrac{1}{2}&amp;lt;/math&amp;gt;. Aus diesem Ergebnis lässt sich die [[Gemeinsame Verteilung von Zufallsvariablen|gemeinsame Verteilung]] von &amp;lt;math&amp;gt;z_ 1&amp;lt;/math&amp;gt; und &amp;lt;math&amp;gt;z_2&amp;lt;/math&amp;gt; herleiten. Sie beruht auf der Beziehung:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\tfrac 12e^{-\frac 12 r^2}\mathrm{d}(r^2)\tfrac{1}{2\pi}\mathrm{d}\varphi=\tfrac{1}{2\pi}e^{-\frac 12 r^2}r\mathrm{d}r\mathrm{d}\varphi=\tfrac{1}{2\pi}e^{-\frac 12 (z_0^2+z_1^2)}\mathrm{d}z_0\mathrm{d}z_1&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Die bisherigen Transformationsschritte erzeugen zwei standardnormalverteilte Zufallszahlen. Eine Standardnormalverteilung ist ein Spezialfall der [[Normalverteilung]], nämlich mit dem [[Erwartungswert]] &amp;lt;math&amp;gt;\mu = 0&amp;lt;/math&amp;gt; und der [[Varianz (Stochastik)|Varianz]] &amp;lt;math&amp;gt;\sigma^2 = 1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Um mit der Box-Muller-Methode Normalverteilungen mit beliebigen Parametern zu erzeugen, lassen sich die erhaltenen &amp;lt;math&amp;gt;z_i&amp;lt;/math&amp;gt; nach dem Muster&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;x_i = \mu + \sigma\cdot z_i&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
transformieren. In der obigen Notation steht &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; wie üblich für die [[Kreiszahl]], &amp;lt;math&amp;gt;\sin&amp;lt;/math&amp;gt; für den [[Sinus]], &amp;lt;math&amp;gt;\cos&amp;lt;/math&amp;gt; für den [[Kosinus]] und &amp;lt;math&amp;gt;\ln&amp;lt;/math&amp;gt; für den [[natürlicher Logarithmus|natürlichen Logarithmus]].&lt;br /&gt;
&lt;br /&gt;
Verwendet man zur Erzeugung der &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; einen [[Linearer Kongruenzgenerator|linearen Kongruenzgenerator]], so liegen die Paare &amp;lt;math&amp;gt;(z_0, z_1)&amp;lt;/math&amp;gt; auf einer durch eine Spirale beschriebenen Kurve. Dieses Verhalten ist eng mit dem im [[Satz von Marsaglia]] beschriebenen [[Hyperebene]]nverhalten linearer Kongruenzgeneratoren verwandt.&lt;br /&gt;
&lt;br /&gt;
Dieses Problem lässt sich umgehen, wenn statt des linearen Kongruenzgenerators ein [[inverser Kongruenzgenerator]] oder die [[Polar-Methode]] verwendet wird.&lt;br /&gt;
&lt;br /&gt;
Die Box-Muller-Methode erzeugt zunächst zwei stochastisch unabhängige und standardnormalverteilte [[Zufallszahl]]en, die sich dann in eine [[Normalverteilung]] mit beliebigen Parametern transformieren lassen. Die Box-Muller-Methode erfordert die Auswertung von [[Logarithmus|Logarithmen]] und [[Trigonometrische Funktion|trigonometrischen Funktionen]], was auf einigen Rechnern sehr zeitaufwendig sein kann.&lt;br /&gt;
&lt;br /&gt;
Weitere Möglichkeiten zur Erzeugung normalverteilter [[Zufallszahl]]en sind im Artikel [[Normalverteilung]] beschrieben. Eine Alternative ist z.&amp;amp;nbsp;B. die [[Polar-Methode]].&amp;lt;ref&amp;gt;Vgl. Albert J. Kinderman und John G. Ramage: &amp;#039;&amp;#039;Computer Generation of Normal Random Numbers&amp;#039;&amp;#039;. In: &amp;#039;&amp;#039;Journal of the American Statistical Association&amp;#039;&amp;#039;, Jg. 71 (1976), Heft 356, S. 893–896.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Programmierung ==&lt;br /&gt;
Die Standard-Box-Muller-Methode erzeugt Werte aus der [[Standardnormalverteilung]] mit [[Erwartungswert]] 0 und [[Standardabweichung]] 1. Die folgende Implementierung in der [[Programmiersprache]] [[C++]] generiert 10 Paare von standardnormalverteilten [[Zufallszahl]]en aus jeder [[Normalverteilung]] mit Erwartungswert &amp;lt;math&amp;gt;\mu&amp;lt;/math&amp;gt; und [[Varianz (Stochastik)|Varianz]] &amp;lt;math&amp;gt;\sigma&amp;lt;/math&amp;gt; und gibt sie auf der Konsole aus.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
#define _USE_MATH_DEFINES&lt;br /&gt;
#include &amp;lt;random&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
using namespace std;&lt;br /&gt;
&lt;br /&gt;
// Diese Funktion berechnet zwei standardnormalverteilte Zufallszahlen z0 und z1&lt;br /&gt;
pair&amp;lt;double, double&amp;gt; generateGaussianNoise(double mu, double sigma)&lt;br /&gt;
{&lt;br /&gt;
    constexpr double epsilon = numeric_limits&amp;lt;double&amp;gt;::epsilon();&lt;br /&gt;
&lt;br /&gt;
    // Initialisiert den Zufallszahlengenerator im Bereich von 0 bis 1&lt;br /&gt;
    static mt19937 rng(random_device{}()); // Standard Mersenne-Twister&lt;br /&gt;
    static uniform_real_distribution&amp;lt;&amp;gt; runif(0, 1);&lt;br /&gt;
&lt;br /&gt;
    double u1, u2; // Deklaration der lokalen Variablen für die Zufallszahlen u1 und u2&lt;br /&gt;
    do // Diese do-while-Schleife erzeugt solange Zufallszahlen bis u1 &amp;gt; epsilon ist&lt;br /&gt;
    {&lt;br /&gt;
        u1 = runif(rng);&lt;br /&gt;
    } while (u1 &amp;lt;= epsilon);&lt;br /&gt;
    u2 = runif(rng);&lt;br /&gt;
&lt;br /&gt;
    // Berechnet z0 und z1&lt;br /&gt;
    auto magnitude = sigma * sqrt(-2.0 * log(u1));&lt;br /&gt;
    auto z0 = magnitude * cos(2.0 * M_PI * u2) + mu;&lt;br /&gt;
    auto z1 = magnitude * sin(2.0 * M_PI * u2) + mu;&lt;br /&gt;
    return make_pair(z0, z1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Hauptfunktion die das Programm ausführt&lt;br /&gt;
void main()&lt;br /&gt;
{&lt;br /&gt;
    double mu = 0; // Deklaration der lokalen Variablen&lt;br /&gt;
    double sigma = 1;&lt;br /&gt;
    for (int i = 0; i &amp;lt; 10; i++) // Diese for-Schleife berechnet 10 Paare von standardnormalverteilten Zufallszahlen und gibt sie auf der Konsole aus&lt;br /&gt;
    {&lt;br /&gt;
        pair&amp;lt;double, double&amp;gt; gaussianNoise = generateGaussianNoise(mu, sigma); // Aufruf der Funktion&lt;br /&gt;
        cout &amp;lt;&amp;lt; gaussianNoise.first &amp;lt;&amp;lt; &amp;quot;,&amp;quot; &amp;lt;&amp;lt; gaussianNoise.second &amp;lt;&amp;lt; endl; // Ausgabe auf der Konsole&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Weblinks ==&lt;br /&gt;
* {{MathWorld|id=Box-MullerTransformation|title=Box-Muller Transformation}}&lt;br /&gt;
&lt;br /&gt;
== Literatur ==&lt;br /&gt;
* George Edward Pelham Box, Mervin Edgar Muller: &amp;#039;&amp;#039;A note on the generation of random normal deviates.&amp;#039;&amp;#039; In: &amp;#039;&amp;#039;[[Annals of Mathematical Statistics]]&amp;#039;&amp;#039;, Jg. 29 (1958), Heft 2, {{ISSN|0003-4851}}, S. 610–611.&lt;br /&gt;
* [[Donald Ervin Knuth]]: &amp;#039;&amp;#039;[[The Art of Computer Programming]]&amp;#039;&amp;#039;, Sec. 3.4.1, S. 117.&lt;br /&gt;
* Otto Moeschlin, Eugen Grycko, Claudia Pohl, Frank Steinert:  Kapitel 1.4 &amp;#039;&amp;#039;Generating Sample Values&amp;#039;&amp;#039;. In: Diess.: &amp;#039;&amp;#039;Experimental Stochastics.&amp;#039;&amp;#039; Springer, Berlin u. a. 1998, ISBN 3-540-14619-9.&lt;br /&gt;
&lt;br /&gt;
== Einzelnachweise ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Kategorie:Pseudozufallszahlengenerator]]&lt;/div&gt;</summary>
		<author><name>imported&gt;SweetWood</name></author>
	</entry>
</feed>