Skip to content

Instantly share code, notes, and snippets.

@youhey
Last active June 20, 2018 09:39
Show Gist options
  • Save youhey/747dd584b750a06ba0d9cf690fc1dcec to your computer and use it in GitHub Desktop.
Save youhey/747dd584b750a06ba0d9cf690fc1dcec to your computer and use it in GitHub Desktop.
誕生日のパラドックス
from math import log1p, sqrt
def birthday(probability_exponent, bits):
probability = 10. ** probability_exponent
outputs = 2. ** bits
return sqrt(2. * outputs * -log1p(-probability))
@youhey
Copy link
Author

youhey commented Jun 20, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment