-
-
Save axiomsofchoice/a3e75cc7ea3516182a93fd611a6e5e6b to your computer and use it in GitHub Desktop.
How to estimate the number e on a checkerboard
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
# via https://twitter.com/JohnAllenPaulos/status/743085219511554049 | |
import string | |
import random | |
print 64.0 / float(string.count(bin(reduce(lambda x,y: x | (1L<<y), [random.randint(1,64) for _ in range(64)])), '0') - 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment