Skip to content

Instantly share code, notes, and snippets.

@EdgeCaseBerg
Created September 11, 2013 00:09
Show Gist options
  • Save EdgeCaseBerg/6517582 to your computer and use it in GitHub Desktop.
Save EdgeCaseBerg/6517582 to your computer and use it in GitHub Desktop.
Imperical Analysis for Stephanie
1 tails = 0
2 heads = 0
3 success = 0
4 numTrials = 10000000
5
6 import random
7
8
9 for t in range(numTrials):
10 for i in range(256):
11 if random.randint(0,1) == 1:
12 tails += 1
13 else:
14 heads += 1
15 if tails >= 240:
16 success += 1
17 tails = 0
18 heads = 0
19
20 print "The imperical data says:"
21 print success/float(numTrials)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment