Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
NB. translation of python
|
||||
|
||||
NB. 'N P T' =: 100 0.5 500 NB. hypothetical example values, to aid comprehension...
|
||||
|
||||
newv =: (> ?@(#&0))~ NB. generate a random binary vector. Use: N newv P
|
||||
runs =: {: + [: +/ 1 0&E. NB. add the tail to the sum of 1 0 occurrences Use: runs V
|
||||
mean_run_density =: [ %~ [: runs newv NB. perform experiment. Use: N mean_run_density P
|
||||
|
||||
main =: 3 : 0 NB.Usage: main T
|
||||
T =. y
|
||||
smoutput' T P N P(1-P) SIM DELTA%'
|
||||
for_P. 10 %~ >: +: i. 5 do.
|
||||
LIMIT =. (* -.) P
|
||||
smoutput ''
|
||||
for_N. 2 ^ 10 + +: i. 3 do.
|
||||
SIM =. T %~ +/ (N mean_run_density P"_)^:(<T) 0
|
||||
smoutput 4 5j2 6 6j3 6j3 4j1 ": T, P, N, LIMIT, SIM, SIM (100 * [`(|@:(- % ]))@.(0 ~: ])) LIMIT
|
||||
end.
|
||||
end.
|
||||
EMPTY
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue