<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://sibiwiki.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Algorithmen%3A_Mathematik</id>
	<title>Algorithmen: Mathematik - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://sibiwiki.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Algorithmen%3A_Mathematik"/>
	<link rel="alternate" type="text/html" href="https://sibiwiki.de/wiki/index.php?title=Algorithmen:_Mathematik&amp;action=history"/>
	<updated>2026-11-27T02:28:30Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in sibiwiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://sibiwiki.de/wiki/index.php?title=Algorithmen:_Mathematik&amp;diff=7&amp;oldid=prev</id>
		<title>Akaibel: 1 Version importiert</title>
		<link rel="alternate" type="text/html" href="https://sibiwiki.de/wiki/index.php?title=Algorithmen:_Mathematik&amp;diff=7&amp;oldid=prev"/>
		<updated>2026-10-27T17:44:40Z</updated>

		<summary type="html">&lt;p&gt;1 Version importiert&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 27. Oktober 2026, 17:44 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;de&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(kein Unterschied)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Akaibel</name></author>
	</entry>
	<entry>
		<id>https://sibiwiki.de/wiki/index.php?title=Algorithmen:_Mathematik&amp;diff=6&amp;oldid=prev</id>
		<title>sibiwikialt&gt;Akaibel: /* Excel: Mittelwert und Standardabweichung berechnen */</title>
		<link rel="alternate" type="text/html" href="https://sibiwiki.de/wiki/index.php?title=Algorithmen:_Mathematik&amp;diff=6&amp;oldid=prev"/>
		<updated>2022-12-01T18:19:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Excel: Mittelwert und Standardabweichung berechnen&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Kategorie:Informatik]]&lt;br /&gt;
[[Kategorie:Algorithmen]]&lt;br /&gt;
Im Wesentlichen werden bei Algorithmen zwei Aspekte mathematisch geprüft:&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Laufzeit&amp;#039;&amp;#039;&amp;#039;: siehe [[Laufzeit_von_Algorithmen]]&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Genauigkeit&amp;#039;&amp;#039;&amp;#039; (oder &amp;#039;&amp;#039;&amp;#039;Zuverlässigkeit&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
Auf dieser Seite wird die Prüfung der Genauigkeit (oder Zuverlässigkeit) für sogenannte &amp;#039;&amp;#039;&amp;#039;Monte-Carlo-Algorithmen&amp;#039;&amp;#039;&amp;#039; dargestellt. Monte-Carlo-Algorithmen braucht man zur Simulation; sie beruhen auf Zufall.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Prüfung der Zuverlässigkeit: Konfidenzintervall und Wahrscheinlichkeit=&lt;br /&gt;
Bei &amp;#039;&amp;#039;&amp;#039;Simulationen&amp;#039;&amp;#039;&amp;#039; lässt man einen Prozess 1000mal (oder öfter) laufen, und erhält entsprechend viele Ergebnisse.&lt;br /&gt;
&lt;br /&gt;
Aus den Ergebnissen der Simulation kann man den &amp;#039;&amp;#039;&amp;#039;Mittelwert&amp;#039;&amp;#039;&amp;#039; bilden und erhält so eine Voraussage auf das tatsächliche Verhalten.&lt;br /&gt;
&lt;br /&gt;
Daran schließt sich die Frage an: &amp;#039;&amp;#039;&amp;#039;Wie &amp;lt;u&amp;gt;genau&amp;lt;/u&amp;gt; ist diese Voraussage?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Eine 100prozentig genaue Voraussage wird man mit einer Simulation nie erreichen; stattdessen gibt man ein &amp;#039;&amp;#039;&amp;#039;Konfidenzintervall&amp;#039;&amp;#039;&amp;#039; und eine &amp;#039;&amp;#039;&amp;#039;Wahrscheinlichkeit&amp;#039;&amp;#039;&amp;#039; an, z.B.:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Mit einer Wahrscheinlichkeit von 99% ist das tatsächliche Ergebnis im Intervall [0,7745 | 0,7957].&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=Ermittlung des Konfidenzintervalls mithilfe von Mittelwert und Standardabweichung=&lt;br /&gt;
Ergebnisse von Simulationen sind in der Regel &amp;#039;&amp;#039;&amp;#039;normalverteilt&amp;#039;&amp;#039;&amp;#039;, weil die einzelnen Durchläufe der Simulationen voneinander unabhängig sind.&lt;br /&gt;
&lt;br /&gt;
D.h. die Ergebnisse der Simulation können als &amp;#039;&amp;#039;&amp;#039;Stichprobe&amp;#039;&amp;#039;&amp;#039; angesehen werden, von der man auf die Gesamtheit schließt.&lt;br /&gt;
&lt;br /&gt;
Von der Stichprobe (d.h. allen Simulationsergebnissen) ermittelt man folgende Werte:&lt;br /&gt;
* Den &amp;#039;&amp;#039;&amp;#039;Mittelwert&amp;#039;&amp;#039;&amp;#039;: &amp;lt;math&amp;gt; \overline x = \frac{1}{n} \sum_{i=1}^n{x_i}&amp;lt;/math&amp;gt; &lt;br /&gt;
* Die &amp;#039;&amp;#039;&amp;#039;Standardabweichung der Stichprobie&amp;#039;&amp;#039;&amp;#039;: &amp;lt;math&amp;gt;s= \sqrt{\frac{1}{n-1} \sum \limits_{i=1}^n\left(x_i-\overline x\right)^2} &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Jetzt gilt (lt. Mathematik...):&lt;br /&gt;
* Mit 95% Sicherheit liegt der &amp;lt;u&amp;gt;Mittelwert der Grundgesamtheit&amp;lt;/u&amp;gt; im Intervall &amp;lt;math&amp;gt;[\overline x - 1,96 \cdot {\frac{s}{\sqrt{n}}} ~ | ~ \overline x + 1,96 \cdot {\frac{s}{\sqrt{n}}} ] &amp;lt;/math&amp;gt;.&lt;br /&gt;
* Mit 99% Sicherheit liegt der &amp;lt;u&amp;gt;Mittelwert der Grundgesamtheit&amp;lt;/u&amp;gt; im Intervall &amp;lt;math&amp;gt;[\overline x - 2,58 \cdot {\frac{s}{\sqrt{n}}} ~ | ~ \overline x + 2,58 \cdot {\frac{s}{\sqrt{n}}} ] &amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=Beispiel: Ermittlung von PI =&lt;br /&gt;
&amp;#039;&amp;#039;Es wird 10.000mal zufällig auf das Einheitsquadrat &amp;quot;geschossen&amp;quot;: Als &amp;quot;Treffer&amp;quot; zählt es, wenn der Punkt im Einheitskreis liegt.&amp;lt;br/&amp;gt;Von den 10.000 Schüssen sind 7851 Treffer, d.h. man hat eine Trefferwahrscheinlichkeit p=0,7851 .&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Das ist eindeutig eine Bernoulli-Kette, denn&lt;br /&gt;
* die &amp;quot;Schüsse&amp;quot; haben das Ergebnis 1 (=im Einheitskreis) oder 0 (daneben),&lt;br /&gt;
* die &amp;quot;Schüsse&amp;quot; sind voneinander unabhängig.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Mittelwert&amp;#039;&amp;#039;&amp;#039;: &amp;lt;math&amp;gt; \overline x = 0,7851 &amp;lt;/math&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Standardabweichung der Stichprobe&amp;#039;&amp;#039;&amp;#039;: &amp;lt;math&amp;gt; s = \sqrt{\frac{ {{7851}\cdot{(1 - 0,7851)^2}} + {2149} \cdot {(0 - 0,7851)^2}}{9999}} = 0,411&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bestimmung des Konfidenzinterfalls für eine Wahrscheinlichkeit von 99%:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;math&amp;gt;[\overline x - 2,58 \cdot {\frac{s}{\sqrt{n}}} ~ | ~ \overline x + 2,58 \cdot {\frac{s}{\sqrt{n}}} ] ~ = ~&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;[0,7851 - 2,58 \cdot{0,00411} ~ | ~ 0,7851 + 2,58 \cdot{0,00411} ]~ = ~&amp;lt;/math&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;[0,7745 ~ | ~ 0,7957]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Da man diese Simulation nur für einen Viertelkreis gemacht hat, muss man das Intervall noch mit 4 multiplizieren, um ein Konfidenzintervall für Pi zu erhalten:&lt;br /&gt;
&lt;br /&gt;
Mit 99% Wahrscheinlichkeit liegt Pi im Intervall&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;[4 \cdot 0,7745 ~|~ 4 \cdot 0,7957]~=&amp;lt;/math&amp;gt; &amp;lt;br/&amp;gt;&amp;lt;math&amp;gt;[3,0980 ~|~ 3,1828]&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Excel: Mittelwert und Standardabweichung berechnen=&lt;br /&gt;
* Die Daten in Spalte A packen.&lt;br /&gt;
** Wichtig: Zahlen mit Kommas!&lt;br /&gt;
* Folgende Formeln z.B. in die Felder &amp;lt;code&amp;gt;C1&amp;lt;/code&amp;gt; bis &amp;lt;code&amp;gt;C5&amp;lt;/code&amp;gt; eintragen:&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;C1: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;=ANZAHL(A:A)&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;C2: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;=MITTELWERT(A:A)&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;C3: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;=STABW.S(A:A)&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;C4: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;=C2-2,58*C3/WURZEL(C1)&amp;lt;/code&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;#039;&amp;#039;Berechnet die untere Grenze des 99%-Konfidenzintervalls.&amp;#039;&amp;#039;&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;C5: &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;=C2+2,58*C3/WURZEL(C1)&amp;lt;/code&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;#039;&amp;#039;Berechnet die obere Grenze des 99%-Konfidenzintervalls.&amp;#039;&lt;br /&gt;
&lt;br /&gt;
=Java: Mittelwert und Standardabweichung berechnen=&lt;br /&gt;
Hier ist eine Klasse &amp;lt;code&amp;gt;Statistik&amp;lt;/code&amp;gt;, mit der man Mittelwert und Standardabweichung einer Stichprobe berechnen kann.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;public class Statistik&amp;#039;&amp;#039;&amp;#039; {&lt;br /&gt;
    &lt;br /&gt;
   &amp;#039;&amp;#039;&amp;#039;public double mittelwert(double[] werte)&amp;#039;&amp;#039;&amp;#039; {&lt;br /&gt;
      double anzahl = werte.length;&lt;br /&gt;
      double summe = 0;&lt;br /&gt;
      for (int i = 0; i &amp;lt; werte.length; i++) {&lt;br /&gt;
         summe += werte[i];&lt;br /&gt;
      }&lt;br /&gt;
      return 1.0*summe / anzahl;&lt;br /&gt;
   }&lt;br /&gt;
   &lt;br /&gt;
   &amp;#039;&amp;#039;&amp;#039;public double standardAbweichungStichprobe(double[] werte)&amp;#039;&amp;#039;&amp;#039; {&lt;br /&gt;
      int anzahl = werte.length;&lt;br /&gt;
      double mittelwert = mittelwert(werte);&lt;br /&gt;
         double summeAbweichungZumQuadrat = 0.0;&lt;br /&gt;
         for(int i=0; i&amp;lt;werte.length; i++) {&lt;br /&gt;
            double wert = werte[i];&lt;br /&gt;
            summeAbweichungZumQuadrat += Math.pow(wert - mittelwert, 2);&lt;br /&gt;
         }&lt;br /&gt;
         double standardAbweichung = Math.sqrt(summeAbweichungZumQuadrat/(anzahl-1));&lt;br /&gt;
         return standardAbweichung;&lt;br /&gt;
   }&lt;br /&gt;
    &lt;br /&gt;
   // zu Testzwecken&lt;br /&gt;
   &amp;#039;&amp;#039;&amp;#039;public static void main(String[] args)&amp;#039;&amp;#039;&amp;#039; {&lt;br /&gt;
      Statistik st = new Statistik();&lt;br /&gt;
      double[] stichprobe = { 35, 48, 60, 71, 80, 95, 130};&lt;br /&gt;
      double mittelwert = st.mittelwert(stichprobe);&lt;br /&gt;
      double standardAbweichungStichprobe = st.standardAbweichungStichprobe(stichprobe);&lt;br /&gt;
      System.out.println(&amp;quot;Mittelwert: &amp;quot;+ mittelwert);&lt;br /&gt;
      System.out.println(&amp;quot;Standardabweichung: &amp;quot;+standardAbweichungStichprobe);&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Python: Mittelwert und Standardabweichung berechnen=&lt;br /&gt;
Um in Python den Mittelwert und die Standardabweichung zu berechnen, greift man am besten auf Funktionen der Bibliothek &amp;#039;&amp;#039;&amp;#039;numpy&amp;#039;&amp;#039;&amp;#039; zurück. (Natürlich könnte man das auch von Hand implementieren, aber das ist fehleranfälliger.) &lt;br /&gt;
&lt;br /&gt;
Das folgende Beispielprogramm zeigt, wie man das macht.&amp;lt;br/&amp;gt;Das Beispielprogramm kann man Copy&amp;amp;Paste in IDLE übernehmen.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;code&amp;gt;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;import numpy as np&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
  &lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;def mittelwert(x):&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    return np.mean(x)&lt;br /&gt;
 &lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;def standardabweichung(x):&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    return np.std(x,ddof=1)&lt;br /&gt;
    # damit man die Standardabweichung der &amp;#039;&amp;#039;Stichprobe&amp;#039;&amp;#039;&lt;br /&gt;
    # und nicht der &amp;#039;&amp;#039;Gesamtheit&amp;#039;&amp;#039; berechnet,&lt;br /&gt;
    # muss man als zusätzliches Argument &amp;#039;&amp;#039;ddof=1&amp;#039;&amp;#039; übergeben.&lt;br /&gt;
 &lt;br /&gt;
 #main&lt;br /&gt;
 x = [3.4,3.2,3.5,4.1,3.2]&lt;br /&gt;
 &lt;br /&gt;
 mi = mittelwert(x)&lt;br /&gt;
 std = standardabweichung(x)&lt;br /&gt;
 &lt;br /&gt;
 print(x)&lt;br /&gt;
 print(&amp;quot;Mittelwert&amp;quot;, mi)&lt;br /&gt;
 print(&amp;quot;Standardabweichung&amp;quot;,std)&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>sibiwikialt&gt;Akaibel</name></author>
	</entry>
</feed>