Skip to content

Instantly share code, notes, and snippets.

@AndreaCrotti
Created February 23, 2010 18:02
Show Gist options
  • Select an option

  • Save AndreaCrotti/312487 to your computer and use it in GitHub Desktop.

Select an option

Save AndreaCrotti/312487 to your computer and use it in GitHub Desktop.
bash-3.2$ ./glue.sh 3 A A A 2 3
theoretical result:
-1 0.403918930283
5 0.000807333277269
6 0.00376755529392
7 0.0103159252095
8 0.0218877021837
9 0.0399181453761
10 0.0658425139461
11 0.101096067054
12 0.147114063858
13 0.205331763519
c program with 10^7 simulations:
-1: 0.403751
5: 0.000810
6: 0.003768
7: 0.010321
8: 0.021874
9: 0.039903
10: 0.065843
11: 0.101233
12: 0.147244
13: 0.205253
python program with 10^5 simulations:
-1 0.40313
5 0.00066
6 0.0042
7 0.01023
8 0.02241
9 0.04058
10 0.06539
11 0.10122
12 0.14644
13 0.20574
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment