Skip to content

Commit a9db09f

Browse files
Updated README.md to identify whichs script to run
1 parent 11aeef2 commit a9db09f

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

examples/README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,40 @@ This data is post-processed as necessary for the application.
1717
Code is tested to estimate the probability that 3 segments, obtained by splitting a unit stick
1818
in two randomly chosen places, can be sides of a triangle. This probability is known in closed form to be $\frac{1}{4}$.
1919

20+
Run python script "stick_triangle.py" to estimate this probability using parallel Monte-Carlo algorithm:
21+
22+
```
23+
> python stick_triangle.py
24+
Parallel Monte-Carlo estimation of stick triangle probability
25+
Parameters: n_workers=12, batch_size=262144, n_batches=10000, seed=77777
26+
27+
Monte-Carlo estimate of probability: 0.250000
28+
Population estimate of the estimator's standard deviation: 0.000834
29+
Expected standard deviation of the estimator: 0.000846
30+
Execution time: 64.043 seconds
31+
32+
```
33+
2034
## Stick tetrahedron problem
2135

2236
Code is used to estimate the probability that 6 segments, obtained by splitting a unit stick in
2337
5 random chosen places, can be sides of a tetrahedron.
2438

2539
The probability is not known in closed form. See
26-
[math.stackexchange.com/questions/351913](https://math.stackexchange.com/questions/351913/probability-that-a-stick-randomly-broken-in-five-places-can-form-a-tetrahedron) for more details.
40+
[math.stackexchange.com/questions/351913](https://math.stackexchange.com/questions/351913/probability-that-a-stick-randomly-broken-in-five-places-can-form-a-tetrahedron) for more details.
41+
42+
```
43+
> python stick_tetrahedron.py -s 1274 -p 4 -n 8096
44+
Parallel Monte-Carlo estimation of stick tetrahedron probability
45+
Input parameters: -s 1274 -b 65536 -n 8096 -p 4 -d 0
46+
47+
Monte-Carlo estimate of probability: 0.01257113
48+
Population estimate of the estimator's standard deviation: 0.00000488
49+
Expected standard deviation of the estimator: 0.00000484
50+
Total MC size: 530579456
51+
52+
Bayesian posterior beta distribution parameters: (6669984, 523909472)
53+
54+
Execution time: 30.697 seconds
55+
56+
```

0 commit comments

Comments
 (0)