Comment

Comment by ekosz

You can try it yourself without any of the math with just a little bit of programming.

  function calc30(odds) {
    for (let i = 0; i < 30; i++) {
      if (Math.random() < odds) return true;
    }
    return false;
  }
  Array.from(Array(10000)).map(() => calc30(0.04)).filter(Boolean).length //=> 7022 or ~70%
  Array.from(Array(10000)).map(() => calc30(0.02)).filter(Boolean).length //=> 4545 or ~45%
parent ekosz 6 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton