Skip to content

Instantly share code, notes, and snippets.

@DavidBruant
Created August 9, 2014 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DavidBruant/4fd1384487c867b04d21 to your computer and use it in GitHub Desktop.
Save DavidBruant/4fd1384487c867b04d21 to your computer and use it in GitHub Desktop.
draw with replacement
function yesProbabilityOverNDraws(p, n){
return p * ( (1- Math.pow(1-p, n) ) )/(1- (1-p));
}
console.log(yesProbabilityOverNDraws(0.01, 10) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment