proper (standardized) file size symbols?

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

Hi Jack Foo

You obviously know more math than I do...

I can just say that my little algorithm works great for the financial data I have used it for.

What sort of bias would be present? Bias would affect my algorithm, but only if there was a preponderance of, say, odd values just to the left of the 5 at the rounding point. What kind of bias would cause that?

Not saying there can't be bias, but it seems to me that bias of that particular form (greatly more than 50% odds -or evens- to the left of the rounding digit when that digit is a 5) would tend to be rare.

I've have taken us pretty far off the TC topic now, and will let the thread go.

Cheers!
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
chasbas
Junior Member
Junior Member
Posts: 52
Joined: 2003-02-06, 16:01 UTC
Location: New Jersey

Post by *chasbas »

JohnFred:

It's hard to believe you could successfully use your algorithm on financial data. For a simple example, consider if you were to receive a lot of checks for random amounts that had been rounded by your method. On some percentage of those checks you will receive a penny less than you are owed. While a penny isn't a lot, it does add up eventually.

Your original problem was that the sum of rounded values is not equal to the rounded sum of unrounded values. While your attempt to rectify that mathematical fact may or may not work, in the financial world everyone agrees to accept the mathematical reality.

By the way, the solution is biased partially because in 5.5 cases (when the last digit is 0,1,2,3,4 and sometimes 5) the number is not rounded, and in 4.5 cases (6,7,8,9 and sometimes 5) the number *is* rounded.
User avatar
JohnFredC
Power Member
Power Member
Posts: 886
Joined: 2003-03-14, 13:37 UTC
Location: Sarasota Florida

Post by *JohnFredC »

We never rounded the individual items. We rounded the intermediate sums... it is just common sense not to sum individually rounded components. Delay the rounding as long as you can...

By the way, my presentation of the algorithm (which was diagramed by my statistics professor) was incorrect anyway... so I caused misunderstanding my own self. You may feel better about the accuracy of corrected version.

You have to start with the right-most digit and apply the algorthm to each digit from there to the left until you get to the rounding point desired. Sorry for the confusion.

Here is the correct version:

For each digit starting on the right and proceeding left to the digit immediately to the right of the digit where the value is to be truncated by rounding, apply the following method:

Rule 1: If the digit_to_be_rounded<5, then replace it with 0.

Rule 2: If the digit_to_be_rounded>5, then replace it with 0 AND increment the digit to its left by 1

Rule 3: If the digit=5, then do:
if the digit to the left is odd, then apply Rule 1
else
apply Rule 2.

I'm stepping out now. All beat up.
Licensed, Mouse-Centric, moving (slowly) toward Touch-centric
Post Reply