Percolation/Mean cluster density: Difference between revisions

m
J: just in case anyone wants the definitions without having to wade through the entire narrative here.
m (J: fix header)
m (J: just in case anyone wants the definitions without having to wade through the entire narrative here.)
Line 378:
.M.A.AA.AA..AA.
.MM..A.N..O..A.</lang>
 
===Collected definitions===
 
<lang J>congeal=: |.@|:@((*@[*>.)/\.)^:4^:_
idclust=: $ $ [: (~. i.])&.(0&,)@,@congeal ] * 1 + i.@$
 
K=: (%&#~ }.@~.)&,
 
experiment=: K@ idclust@: > 0 ?@$~ ,~
trials=: 0.5&experiment"0@#
 
mean=:+/ % #
 
thru=: <./ + i.@(+*)@-~</lang>
 
=={{header|Python}}==
6,962

edits