Last active
June 20, 2018 09:39
-
-
Save youhey/747dd584b750a06ba0d9cf690fc1dcec to your computer and use it in GitHub Desktop.
誕生日のパラドックス
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import log1p, sqrt | |
def birthday(probability_exponent, bits): | |
probability = 10. ** probability_exponent | |
outputs = 2. ** bits | |
return sqrt(2. * outputs * -log1p(-probability)) |
Author
youhey
commented
Jun 20, 2018
- see https://ja.wikipedia.org/wiki/誕生日のパラドックス
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment