حاسبة التوزيع الهندسي
ف(س = 7 ): 0.02471
ف(س < 7 ): 0.91765
ف( X≥7 ): 0.94235
ف(س> 7 ): 0.05765
ف(س ≥ 7 ): 0.08235
function calc() {
//get input values var p = +document.getElementById('p').value; var x = +document.getElementById('x').value;
//calculate SE var exactP = jStat.negbin.pdf(x, 1, p); var lessP = jStat.negbin.cdf(x-1, 1, p); var lessEP = jStat.negbin.cdf(x, 1, p); var greatP = 1-jStat.negbin.cdf(x, 1, p); var greatEP = 1-jStat.negbin.cdf(x-1, 1, p);
//output probabilities document.getElementById('exactP').innerHTML = exactP.toFixed(5); document.getElementById('lessP').innerHTML = lessP.toFixed(5); document.getElementById('lessEP').innerHTML = lessEP.toFixed(5); document.getElementById('greatP').innerHTML = greatP.toFixed(5); document.getElementById('greatEP').innerHTML = greatEP.toFixed(5);
document.getElementById('x1').innerHTML = x; document.getElementById('x2').innerHTML = x; document.getElementById('x3').innerHTML = x; document.getElementById('x4').innerHTML = x; document.getElementById('x5').innerHTML = x; }