Make a 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.2706 | 0.2053 | 0.1494 |
---|
x = 2 | 0.0758 | 0.1840 | 0.2510 | 0.2706 | 0.2566 | 0.2241 |
---|
x = 3 | 0.0126 | 0.0613 | 0.1255 | 0.1804 | 0.2138 | 0.2241 |
---|
x = 4 | 0.0016 | 0.0153 | 0.0471 | 0.0902 | 0.1336 | 0.1681 |
---|
x = 5 | 0.0002 | 0.0031 | 0.0141 | 0.0361 | 0.0668 | 0.1009 |
---|
x = 6 | 0.0000 | 0.0005 | 0.0035 | 0.0120 | 0.0278 | 0.0505 |
---|
x = 7 | 0.0000 | 0.0001 | 0.0008 | 0.0034 | 0.0099 | 0.0216 |
---|
x = 8 | 0.0000 | 0.0000 | 0.0002 | 0.0008 | 0.0031 | 0.0081 |
---|
Sample code
let d=[]; const L = [0.5, 1, 1.5, 2, 2.5, 3];
let row = "<th></th>";
for (let j = 0.5; j <= 3; j=j+0.5)
row += "<th>"+j+"</th>";
let text = "<tr>"+row+"</tr>";
for (let i = 0; i <= 8; i++) {
row = "<th>"+i+"</th>";
for (let j = 0; j <= 5; j++) {
let p = 5*(i-1)+j;
let s = "<span class=tip>C"+p+"</span>"
if(i==0){
row += "<td>"+ Math.exp(-L[j]).toFixed(4) +"</td>";
}
d[j]=(Math.exp(-L[j]).toFixed(4));
}
else{
deneme(d,i,j);
}
}
text +="<tr>"+row+"</tr>";
}
tablo.innerHTML = text;
function deneme([],i,j){
row += "</td>"+ ((d[j]*L[j])/i).toFixed(4)+"</td>";
d[j]=((d[j]*L[j])/i).toFixed(4);
}