Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Sep 24 19:33:38 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m8P2XcPt006237 for ; Wed, 24 Sep 2008 19:33:38 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m8P2acSF007234 for ; Wed, 24 Sep 2008 19:36:38 -0700 Message-Id: <200809250236.m8P2acSF007234@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Unit for std deviation Date: Wed, 24 Sep 2008 19:36:38 -0700 From: Bill Cheng Someone wrote: > I don’t really know how to do that. The faq says use .6g but that isnt > gaurunteed to print 3 digits after the decimal place and I don’t know how to > combine g and f formating? Hmm... You are right, it's kind of messy. It can be done, but you would probably need to write a function for this and do a bunch of if-then-elses. I've just removed part of the 3rd paragraph and not requiring at least 3 digits after the decimal point. So, you should be able to use "%.6g" in your printf(). I've also added to the first paragraph to say "%.6g". -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Wednesday, September 24, 2008 7:01 PM To: cs551@merlot.usc.edu Subject: Re: Unit for std deviation Some wrote: > In the spec it says to print 6 sig digits and it also says to print 3 digits > after the decimal place. Cant that be conflicting since significant digits > omit trailing 0's which means there might be less than 3 after the decimal > place? > > "All real values in the statistics must be printed with at least 6 > significant digits. A timestamp in the beginning of a line of trace output > must be in milliseconds with 8 digits (zero-padded) before the decimal point > and 3 digits (zero-padded) after the decimal point. > > Please use sample means when you calculated the averages. If n is the number > of sample, this mean that you should divide things by n (and not n-1). > > The unit for time related statistics must be in seconds (and have at least 3 > digits after the decimal points)." The first paragraph says that it must have at least 6 significant digits. The 3rd paragraph says that it must have at least 3 digits after the decimal point. I think both rules should be honored. For example, if the statistics value you want to print is 123456, then you should print 123456.000. If the statistics value you want to print is 3.14159265359, you should print 3.14159. -- Bill Cheng // bill.cheng@usc.edu -----Original Message----- From: Bill Cheng [mailto:william@bourbon.usc.edu] Sent: Wednesday, September 24, 2008 6:20 PM To: cs551@merlot.usc.edu Subject: Re: Unit for std deviation Someone wrote: > Does standard devation value have a unit? I am using seconds.  Variance of X has the same unit as the square of X. Since standard deviation is the square of variance, standard deviation of X should have the same unit as X. -- Bill Cheng // bill.cheng@usc.edu