Cumulative standard deviation: Difference between revisions

m
added whitespace before the TOC.
(Added Elixir)
m (added whitespace before the TOC.)
Line 1:
r{{task|Probability and statistics}}
Write a stateful function, class, generator or coroutine that takes a series of floating point numbers, ''one at a time'', and returns the running [[wp:Standard Deviation|standard deviation]] of the series.
 
The task implementation should use the most natural programming style of those listed for the function in the implementation language; the task ''must'' state which is being used. Do not apply [[wp:Bessel's correction|Bessel's correction]]; the returned standard deviation should always be computed as if the sample seen so far is the entire population.
 
Use this to compute the standard deviation of this demonstration set, <math>\{2, 4, 4, 4, 5, 5, 7, 9\}</math>, which is <math>2</math>.
 
 
'''See also:'''
* [[Moving Average]]
* [[Random numbers]]
<br><br>
 
=={{header|360 Assembly}}==