Skip to content

Instantly share code, notes, and snippets.

@okumurakengo
Created May 3, 2021 15:14
Show Gist options
  • Save okumurakengo/03a9385ff7aa82b80771dd37832318f1 to your computer and use it in GitHub Desktop.
Save okumurakengo/03a9385ff7aa82b80771dd37832318f1 to your computer and use it in GitHub Desktop.
誕生日のパラドックス
import math
n = 30 # 30人の場合
print(1 - (math.factorial(365) / (math.factorial(365 - n) * (365 ** n))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment