Poisson Table
| λ = 0.5 | λ = 1 | λ = 1.5 | λ = 2 | λ = 2.5 | λ = 3 |
---|
x = 0 | 0.6065 | 0.3679 | 0.2231 | 0.1353 | 0.0821 | 0.0498 |
---|
x = 1 | 0.3033 | 0.3679 | 0.3347 | 0.2707 | 0.2052 | 0.1494 |
---|
x = 2 | 0.0758 | 0.1839 | 0.2510 | 0.2707 | 0.2565 | 0.2240 |
---|
x = 3 | 0.0126 | 0.0613 | 0.1255 | 0.1804 | 0.2138 | 0.2240 |
---|
x = 4 | 0.0016 | 0.0153 | 0.0471 | 0.0902 | 0.1336 | 0.1680 |
---|
x = 5 | 0.0002 | 0.0031 | 0.0141 | 0.0361 | 0.0668 | 0.1008 |
---|
x = 6 | 0.0000 | 0.0005 | 0.0035 | 0.0120 | 0.0278 | 0.0504 |
---|
x = 7 | 0.0000 | 0.0001 | 0.0008 | 0.0034 | 0.0099 | 0.0216 |
---|
x = 8 | 0.0000 | 0.0000 | 0.0001 | 0.0009 | 0.0031 | 0.0081 |
---|
Sample Code
function makeRows() {
let firstRow = [];
for (let λ of L) {
firstRow.push(Math.exp(-λ));
}
let otherRows = [];
otherRows.push(firstRow);
let lastRow = firstRow;
for (let i = 1; i <= 8; i++) {
let tempRow = [];
for (let j = 0; j < L.length; j++) {
tempRow.push((lastRow[j] * L[j]) / i);
}
lastRow = tempRow;
otherRows.push(tempRow);
}
return otherRows;
}<br>function makeTable() {
let allRows = makeRows();
let row = "<th></th>";
for (let j = 0; j < L.length; j++)
row += "<th>" + "λ = " + L[j] + "</th>";
let text = "<tr>" + row + "</tr>";
for (let i = 0; i < allRows.length; i++) {
row = "<th>" + "x = " + i + "</th>";
for (let j = 0; j < L.length; j++) {
row += "<td>" + Number(allRows[i][j]).toFixed(4) + "</td>";
}
text += "<tr>" + row + "</tr>";
}
tablo.innerHTML = text;
}