Skip to content

Instantly share code, notes, and snippets.

@dagss
Created January 5, 2014 18:59
Show Gist options
  • Save dagss/8272376 to your computer and use it in GitHub Desktop.
Save dagss/8272376 to your computer and use it in GitHub Desktop.
from __future__ import division
import numpy as np
import math
for n in [2**50, 2**55., 2**60.]:
print
print '===', n
print
m = 1e10 * 1e2 * 365 * 1e2
print m, '%e' % 2**60
a = m / n
print 'load', a, m > n
print 'coll', 1 - sum(a**k * np.exp(-a) / math.factorial(k) for k in (0, 1))
for k in range(10):
print k, a**k * np.exp(-a) / math.factorial(k)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment