Batch Spreadsheet for C Programmers -
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Monte-Carlo Example
Test the distribution of nrand values
- using 60 counters over the range -3 to 3
- with 50000 samples (iterations)
- Note: does not converge
sample = nrand(); ++trials; fill a1:a61 -3, 0.1;
c1 += (sample>=a1)&&(sample<a2) ? 1 : 0;
b1 = c1/trials; copy b2:c60 b1:c59;
eval c1:b60 50000; plot a1:b60;