Init

95%-PI zeigen

p = 0.7 (slider from 0 to 1, step 0.01)
n = 25 (slider from 1 to 2000, step 1)
streck = 0.25 (slider from 0 to 2, step 0.01)
σ: sqrt(((n * p) * (1 - p)))
μ: (n * p)
links: p - (2 * sqrt((p * (1 - p) / n)))
rechts: p + (2 * sqrt((p * (1 - p) / n)))
A: (links, 0)
B: (rechts, 0)
hoehe: 5
A_1: (x(A), hoehe)
B_1: (x(B), hoehe)
f = Segment(A, A_1)
g = Segment(B, B_1)
i = Segment(A, B)
k_i: 0
a = false
h_i: {}
PunktePlot = DotPlot(h_i, streck)
h_a: {}
PunktePlot_a = DotPlot(h_a, streck)
k_a: 0
Text1: "\text{Anzahl an Stichproben\!: } " + (LaTeX[k_i + k_a]) + ""
h: RandomBinomial[n, p] / n
C: (p, 0)
Text2: "\text{95%-PI: } [" + (LaTeX[links]) + ";" + (LaTeX[rechts]) + "]\\
μ=" + (LaTeX[μ]) + ";\;\;σ=" + (LaTeX[σ]) + ""
Text3: "\text{Stichproben innerhalb des 95%-PI: }" + (LaTeX[k_i]) + "\\
\text{Stichproben außerhalb des 95%-PI: }" + (LaTeX[k_a]) + "\\" + (LaTeX[round((k_i / (k_i + k_a) * 100), 2)]) + "\text{% im PI}"