Skip to content

Instantly share code, notes, and snippets.

@tetrapus
Created May 7, 2013 01:40
Show Gist options
  • Save tetrapus/5529689 to your computer and use it in GitHub Desktop.
Save tetrapus/5529689 to your computer and use it in GitHub Desktop.
import random
e_ish = []
for i in range(10000):
e = []
while sum(e) < 1:
e.append(random.random())
e_ish.append(len(e))
print(sum(e_ish)/len(e_ish))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment