الأمثلة التفاعلية
من MM*Stat Arabisch
كما في التوزيع الثنائي , يبنى التوزيع الهندسي على التجربة مع نتيجتين ممكنتين فقط .
يختلف التوزيع الهندسي عن التوزيع الثنائي بأننا نسحب دون اعادة, يعني ذلك لا تكون السحوبات من
التوزيع الهندسي مستقلة
Direct output
<R>1:25</R>
<R>1:25</R>
Iframe output
<R iframe="width:100%;height:40px">1:25</R>
<R iframe="width:100%;height:40px">1:25 </R>
يملك المتغير العشوائي X الذي يحتوي عدد النجاحات A بعد n تكرار للتجربة التوزيع الهندسي مع العناصر M,N و n مع تابع الكثافة الاحتمالي
<Rform name="cdfhyper">
n: <input name="n" type="text" size="5" maxlength="5" value="6"> N: <input name="N" type="text" size="5" maxlength="5" value="49"> M: <input name="M" type="text" size="5" maxlength="5" value="6"> <input type="submit" value="Absenden">
</Rform>
<R output="html" name="cdfhyper" iframe="width:200px,height:200px;">
if (exists("M")) M <- as.numeric(M) else M <- 6
if (exists("N")) N <- as.numeric(N) else N <- 49
if (exists("n")) n <- as.numeric(n) else n <- 6
xmin=max(0,M+n-N); xmax=min(n,M)
dis <- phyper(rep(xmin:xmax,1), M, N-M, n)
prob <- dhyper(rep(xmin:xmax,1), M, N-M, n)
m <- cbind(dis,prob)
dim(m) <- c(xmax-xmin+1,2)
colnames(m) <- c("F(x)", "P(X=i)")
rownames(m) <- format(xmin:xmax)
outHTML(rhtml, m, title="i", format="f", digits=8)
</R>
<Rform name="normal">
M: <input name="M" type="text" size="5" maxlength="5" value="10">
Variance: <input name="Variance" type="text" size="5" maxlength="5" value="2">
<input type="submit" value=" Submit "> (You may need to reload the iframe below after submitting).
</Rform>
<R output="display" name="normal" iframe="height:400px;"> if (exists("Variance")) prob <- as.numeric(Variance) else Variance <- 2 if (exists("M")) M <- as.numeric(M) else M <- 10 x <- seq(0, M, 1) Variance <- dVariance(x, M, Variance) param <- list(M, Variance) main <- c("Normalverteilung - Wahrscheinlichkeitsfunktion", paste (c("Stichprobenumfang M", "Wahrscheinlichkeit p"), param, sep="=")) pdf(rpdf, horizontal=FALSE, width=5, height=5) plot(x,p, type="h", main=main) </R>