Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!tank!paideia!vevea From: vevea@paideia.uchicago.edu (Jack L. Vevea) Newsgroups: comp.lang.c Subject: Re: standard deviation Message-ID: <2466@tank.uchicago.edu> Date: 26 Mar 89 19:31:45 GMT References: <9847@ihlpl.ATT.COM> Sender: news@tank.uchicago.edu Reply-To: vevea@paideia.uchicago.edu (Jack L. Vevea) Distribution: usa Organization: University of Chicago, Dept of Education Lines: 40 In article <9847@ihlpl.ATT.COM> kat3@ihlpl.UUCP (Craig,R.J.) writes: >------------------------- cut here ------------------------- >The input data is given below: >------------------------- cut here ------------------------- >10 >111111111.0 >111111112.0 >111111111.0 >111111112.0 >111111111.0 >111111112.0 >111111111.0 >111111112.0 >111111111.0 >111111112.0 >-------------------------- cut here ------------------------ > > >Notice that the onepass standard deviation is 1.78, while the twopass >standard deviation is 0.5!!!!!! Incidentally, the true value is 0.5!! > Sure; and you could just as easily have picked another data set that produced a correct result from the onepass program, and an incorrect result from twopass. Which is why, as has been pointed out before, neither algorithm should be used in a general standard deviation program. There was a posting recently to sci.math.stat, not crossposted here, that gave a reference for better computational algorithms. Saepe fidelis.