Statistics/Basic: Difference between revisions

Content deleted Content added
→‎Tcl: Added implementation
m →‎{{header|Tcl}}: Finish off a few minor matters
Line 809: Line 809:
}
}


stats 100
foreach size {100 1000 10000} {
puts ""
stats $size
stats 1000
puts ""
puts ""
}</lang>
stats 10000</lang>
Output:
Output:
<pre>
<pre>
Line 856: Line 857:
*********************
*********************
********************
********************

</pre>
</pre>
As can be seen, increasing the sample size reduces the variation between the buckets, showing that the <code>rand()</code> function at least approximates a uniform distribution. (Because Tcl 8.5 supports arbitrary precision integer arithmetic there is no reason in principle why the details for a trillion numbers couldn't be calculated, but it would take quite a while.)