Cumulative standard deviation: Difference between revisions
Content added Content deleted
m (→only show standard deviation: changed a comment.) |
m (→show running sums: aligned a comment.) |
||
Line 3,387: | Line 3,387: | ||
say ' item' right(j,L)":" right(_,4) ' average=' left($/j,12), |
say ' item' right(j,L)":" right(_,4) ' average=' left($/j,12), |
||
' standard deviation=' sqrt($$/j - ($/j)**2) |
' standard deviation=' sqrt($$/j - ($/j)**2) |
||
end /*j*/ /* [↑] prettify output with whitespace*/ |
end /*j*/ /* [↑] prettify output with whitespace*/ |
||
say 'standard deviation: ' sqrt($$/n - ($/n)**2) /*calculate & display the std deviation*/ |
say 'standard deviation: ' sqrt($$/n - ($/n)**2) /*calculate & display the std deviation*/ |
||
exit /*stick a fork in it, we're all done. */ |
exit /*stick a fork in it, we're all done. */ |