Skip to content

Instantly share code, notes, and snippets.

@m4chinations
Last active December 12, 2018 21:09
Show Gist options
  • Select an option

  • Save m4chinations/ec19baeaae2c7ecd3b98372d6d1944a3 to your computer and use it in GitHub Desktop.

Select an option

Save m4chinations/ec19baeaae2c7ecd3b98372d6d1944a3 to your computer and use it in GitHub Desktop.
function P(numDraws) {
return 1 - (math.combinations(3, 0) * math.combinations(37, numDraws)) / math.combinations(40, numDraws)
}
let ans = [];
for (var i = 1; i < 40; i++) { ans.push(i); }
ans = ans.map(x => P(x));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment