Created
July 4, 2014 10:01
-
-
Save bwesterb/7eab3f2b86d2e58f917d 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
import math | |
import random | |
from fractions import Fraction | |
D = 365 | |
def ncr(n, r): | |
return math.factorial(n) / math.factorial(r) / math.factorial(n-r) | |
points = [] | |
for N in xrange(3000, 4000): | |
ret = 0 | |
for l in xrange(1, D + 1): | |
a = (-1)**(l+1) * ncr(D, l) * (D - l)**N | |
ret += a | |
ret = Fraction(ret, D**N) | |
points.append((N, float(ret))) | |
print N, float(ret) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment