Distribution of 0 digits in factorial series: Difference between revisions

Content added Content deleted
(Add C# implementation)
(Added Quackery.)
 
Line 1,182: Line 1,182:
Total time: 648.3583232999999 seconds.
Total time: 648.3583232999999 seconds.
</pre>
</pre>

=={{header|Quackery}}==

<syntaxhighlight lang="Quackery"> [ $ "bigrat.qky" loadfile ] now!

[ stack ] is digits ( --> s )
[ stack ] is zeroes ( --> s )

[ 0 digits put
0 zeroes put
[ 1 digits tally
10 /mod 0 =
zeroes tally
dup 0 = until ]
drop
zeroes take
digits take
reduce ] is zeroprop ( n --> n/d )

[ dup dip
[ 0 n->v
1 ]
times
[ i^ 1+ *
dup zeroprop
rot dip v+ ]
drop
rot n->v v/ ] is distribution ( n --> n/d )

100 distribution 10 point$ echo$ cr
1000 distribution 10 point$ echo$ cr
10000 distribution 10 point$ echo$ cr</syntaxhighlight>

{{out}}

<pre>0.2467531862
0.2035445511
0.1730038482
</pre>

=={{header|Raku}}==
=={{header|Raku}}==
Works, but depressingly slow for 10000.
Works, but depressingly slow for 10000.