Hacker News new | past | comments | ask | show | jobs | submit login

That is amazing! super biased coin and it works! var h = 0; var t = 0; for(i = 0; i < 1000; i++) { var a = Math.random() < .1; var b = Math.random() < .1; if(a !== b) { if(a){ h++} else {t++}} }; console.log(h,t);



You could also just note that the two possible results where both coins differ are equally likely.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: