Kalkulator distribusi multinomial
Distribusi multinomial menggambarkan probabilitas diperolehnya sejumlah penghitungan tertentu untuk k hasil yang berbeda, ketika setiap hasil memiliki probabilitas terjadinya yang tetap.
Untuk menghitung probabilitas ini, cukup isi nilai di bawah ini hingga 10 hasil, lalu klik tombol “Hitung”:
Catatan: Kolom Probabilitas harus berjumlah 1.
Hasil | Kemungkinan | Frekuensi |
---|---|---|
Hasil 1 | ||
Hasil 2 | ||
Hasil 3 | ||
Hasil 4 | ||
Hasil 5 | ||
Hasil 6 | ||
Hasil 7 | ||
Hasil 8 | ||
Hasil 9 | ||
Hasil 10 |
Probabilitas multinomial: 0,118125
Probabilitasnya harus berjumlah 1. Saat ini totalnya 0,359
//show answer to start var answer_display = document.getElementById("answer");
//hide error message to start var error_msg_display = document.getElementById("error_msg"); error_msg_display.style.display = "none";
//define factorial function
function factorial(num)
{
var rval=1;
for (var i = 2; i <= num; i++)
rval = rval * i;
return rval;
}
function calc() {
//get input data
var p1 = document.getElementById('p1').value;
var p2 = document.getElementById('p2').value;
var p3 = document.getElementById('p3').value;
var p4 = document.getElementById('p4').value;
var p5 = document.getElementById('p5').value;
var p6 = document.getElementById('p6').value;
var p7 = document.getElementById('p7').value;
var p8 = document.getElementById('p8').value;
var p9 = document.getElementById('p9').value;
var p10 = document.getElementById('p10').value;
var f1 = document.getElementById('f1').value;
var f2 = document.getElementById('f2').value;
var f3 = document.getElementById('f3').value;
var f4 = document.getElementById('f4').value;
var f5 = document.getElementById('f5').value;
var f6 = document.getElementById('f6').value;
var f7 = document.getElementById('f7').value;
var f8 = document.getElementById('f8').value;
var f9 = document.getElementById('f9').value;
var f10 = document.getElementById('f10').value;
var p_group = [p1, p2, p3, p4, p5, p6, p7, p8, p9, p10];
var f_group = [f1, f2, f3, f4, f5, f6, f7, f8, f9, f10];
var p_sum = parseFloat(math.sum(p_group)).toFixed(5);
var n = math.sum(f_group);
//do calculations
if (p_sum == 1) {
answer_display.style.display = "block";
error_msg_display.style.display = "none";
var nPORTION = factorial(n);
var xFACT = [];
for (var i=0; i
var pxFACT = [];
for (var j=0; j
var p = nPORTION*pxPORTION/xPORTION; document.getElementById('p').innerHTML = p.toFixed(6); } else { answer_display.style.display = "none"; error_msg_display.style.display = "block"; document.getElementById('p_sum').innerHTML = p_sum; }
} //end massive calc function