Statistics/Basic: Difference between revisions
Content added Content deleted
(→{{header|Python}}: bug fixes) |
(→{{header|Perl 6}}: arguably simpler version) |
||
Line 1,197:
=={{header|Perl 6}}==
<lang perl6>
my
printf "mean: %f\n", my $
my $variance = $mean**2 R- $N R/ [+] @data »**» 2;
for sort *.key, @data.classify( (10 * *).Int / 10 ) {
}
▲ say "stddev: $stddev";
▲ say "0.$i\t", '=' x (500 * $bin / $n);
▲ say "";
}</lang>
{{out}}
Line 1,239 ⟶ 1,222:
0.8 ======================================================================
0.9 =============================================
size: 1000
Line 1,254 ⟶ 1,236:
0.8 ==============================================
0.9 ========================================================
size: 10000
Line 1,269 ⟶ 1,250:
0.8 ====================================================
0.9 ==================================================
size: 100000
Line 1,300 ⟶ 1,280:
0.9 =================================================
(elapsed: 47.345431089401245)</pre>
=={{header|PicoLisp}}==
The following has no limit on the number of samples. The 'statistics' function accepts an executable body 'Prg', which it calls repeatedly to get the samples.
|