Published
Edited
Nov 12, 2020
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
0.042*415+207*0.083+0.125*68+0.167*23+4*0.208
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
data1 = (() => {
let dataset = [];

dataset[0] = {0: 907, 0.042:0, 0.045:0, 0.05:0, 0.056:0, 0.063:0, 0.071:0, 0.083:0, 0.091:0, 0.1:0, 0.111:0, 0.125:0, 0.136:0, 0.143:0, 0.15:0, 0.167: 0, 0.182:0, 0.188:0, 0.2:0, 0.208:0, 0.214:0, 0.222:0, 0.227:0, 0.25:0 , 0.286:0, 0.3:0, 0.333:0, 0.375:0, 0.4:0, 0.5: 93}
dataset[1] = {0: 806, 0.042:0, 0.045:0, 0.05:0, 0.056:0, 0.063:0, 0.071:0, 0.083:0, 0.091:0, 0.1:0, 0.111:0, 0.125:0, 0.136:0, 0.143:0, 0.15:0, 0.167: 0, 0.182:0, 0.188:0, 0.2:0, 0.208:0, 0.214:0, 0.222:0, 0.227:0, 0.25:185 , 0.286:0, 0.3:0, 0.333:0, 0.375:0, 0.4:0, 0.5: 9}
return dataset;
})();
Insert cell
A = [[]];
Insert cell
B = (()=> {
})()
Insert cell
calc1 = {
while(A.lenth){A.pop(); }
var i,j,k;
for(i=0; i<1; i++){
for(j=0; j<31; j++){
for(k=0; k<29; k++){
if(Number((ARRAY[i][j][0])).toFixed(3) == parseInt(stackedDataX[k]))
{
A[i][stackedDataX[k]] = parseInt(ARRAY[i][k].length)
}
}
}
}

}
Insert cell
Number((ARRAY[0][2][0]))
Insert cell
stackedDataX[1]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
/*tooltip_tot = { //tooltip for the histogram
if((b2 == 'Auto Randomize')||(b3 == 'Auto Randomize')){
chart_tot;
const tooltip = d3
.select("body")
.append("div")
.attr("class", "svg-tooltip")
.style("position", "absolute")
.style("visibility", "hidden");

// select all rect
d3.selectAll("rect")
.on("mouseover", function(d) {
// change the selection style
d3.select(this)
.attr('stroke-width', '2')
.attr("stroke", "black");
// make the tooltip visible and update its text
tooltip
.style("visibility", "visible")
.text(`count: ${d}\n`);
})
.on("mousemove", function() {
tooltip
.style("top", d3.event.pageY - 10 + "px")
.style("left", d3.event.pageX + 10 + "px");
})
.on("mouseout", function() {
// change the selection style
d3.select(this).attr('stroke-width', '0');

tooltip.style("visibility", "hidden");
});
}
}*/
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
prob1 = {
var non_viable_calc_1_avg = 0;
var non_viable_calc_1 = 0;
for (var count=1; count<20000; count++){
var cnt = 0;
var a = array.sample();


if(a == 3){cnt++;}
else if(a == 4){cnt++;}
else {cnt==0;}


non_viable_calc_1 = cnt / (1*2);
non_viable_calc_1_avg = (non_viable_calc_1_avg + non_viable_calc_1) ;console.log(count)
};console.log(count)
return non_viable_calc_1_avg / (count-1)
}
Insert cell
prob2 = {
var non_viable_calc_2_avg = 0;
var non_viable_calc_2 = 0;
for (var count=1; count<20000; count++){
var cnt = 0;
var a = array.sample();console.log(a)
var b = array.sample();console.log(b)

if(a == 3){cnt++;}
else if(a == 4){cnt++;}
if(b == 3){cnt++;}
else if(b == 4){cnt++;}


non_viable_calc_2 = cnt / (2*2);
non_viable_calc_2_avg = (non_viable_calc_2_avg + non_viable_calc_2);
}
return non_viable_calc_2_avg / (count-1)
}
Insert cell
prob8 = {
var non_viable_calc_2_avg = 0;
var non_viable_calc_2 = 0;
for (var count=1; count<2000; count++){
var cnt = 0;
var a = array.sample();console.log(a)
var b = array.sample();console.log(b)
var c = array.sample();console.log(a)
var d = array.sample();console.log(b)
var e = array.sample();console.log(a)
var f = array.sample();console.log(b)
var g = array.sample();console.log(a)
var h = array.sample();console.log(b)
if(a == 3){cnt++;}
else if(a == 4){cnt++;}
if(b == 3){cnt++;}
else if(b == 4){cnt++;}
if(c == 3){cnt++;}
else if(c == 4){cnt++;}
if(d == 3){cnt++;}
else if(d == 4){cnt++;}
if(e == 3){cnt++;}
else if(e == 4){cnt++;}
if(f == 3){cnt++;}
else if(f == 4){cnt++;}
if(g == 3){cnt++;}
else if(g == 4){cnt++;}
if(h == 3){cnt++;}
else if(h == 4){cnt++;}
non_viable_calc_2 = cnt / (8*2);
non_viable_calc_2_avg = (non_viable_calc_2_avg + non_viable_calc_2);
}
return non_viable_calc_2_avg / (count-1)
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more