back to list

Re: How to cope with basic rounding errors?

🔗M. Schulter <MSCHULTER@VALUE.NET>

3/29/2001 2:53:48 PM

Hello, there, everyone, and I have a simple but somewhat perplexing
question maybe dealing more with conventions than strict logic: the
best way to treat rounding errors in dealing with such quantities as
the sizes of intervals in cents.

While discussions of such errors often focus on computer software
issues, I'm referring to a simpler and inevitable complication of
decimal arithmetic: the situation where adding two intervals rounded
in cents to a certain number of significant places produces a third
value which, when similarly rounded, appears to be too large or
small.

For example, in a paper otherwise ready to post, I discuss a tuning
which has these rounded values for the diesis or "12-comma" (12 fifths
up less 7 octaves), the "17-comma" (10 octaves less 17 fifths, or 17
fourths up), and the diatonic semitone or limma (5 fourths up). Note
that the first two intervals should add up precisely to the limma:

diesis or 12-comma ~55.28 cents
17-comma ~21.68 cents
------------
diatonic semitone or limma ~76.97 cents

What's happening here is that the two smaller intervals are actually
about 55.283 cents and 21.683 cents, while the limma is about 76.965
cents -- an explanation itself involving another rounding error of the
same type at the next higher level of decimal precision! In contrast,
going to yet another digit of precision seems to avoid this problem:

diesis or 12-comma ~55.2829 cents
17-comma ~21.6826 cents
--------------
diatonic semitone or limma ~76.9655 cents

Here's the question: what is the best, and/or most conventional,
way of coping with such results where the values don't seem quite to
"add up" when each interval is correctly rounded at a given precision:

(1) Simply let the result stand, maybe adding a
brief remark somewhere that this is the policy,
to reassure readers who may observe what appear
to be "anomalies" (e.g. 55.28 + 21.68 = 76.97);

(2) Take the license of inaccurately rounding
whichever value would be closest to the next
higher or lower amount permitting a result
which "looks" correct -- maybe not so shocking
a proposal, given the common statement of the
Pythagorean comma as "about 24 cents" when it
is actually around 23.46 cents, or a rounded
23 cents -- (e.g. 55.28 + 21.68 = 76.96);

(3) Use the closest convenient degree of precision
where accurately rounded values "add up" as
expected (e.g. 55.3 + 21.7 = 97.0; or
55.2829 + 21.6826 = 76.9655).

Might the context have something to do with the choice. In a table of
intervals for a tuning, I would follow (1) as a matter of course.

The problem I raise here comes up specifically in the setting of a bar
graph and discussion about the 12-comma or diesis, 17-comma, and
diatonic semitone where the way that the first two intervals "add up"
to the third is a main focus of attention, so that the rounding error
problem seems more glaring.

Here two decimals of precision for values in cents seems to be a
widespread style in the paper, so that I might lean toward (1) or
possibly (2) if people consider it reasonable or acceptable; but any
advice would be much appreciated.

Most respectfully,

Margo Schulter
mschulter@value.net

🔗Robert Walker <robert_walker@rcwalker.freeserve.co.uk>

3/30/2001 6:24:39 AM

Hi Margo,

This is just one of those awkward things one has to live with, and the
methods you describe are the main ones for dealing with it I believe.

You get it especially obviously with percentages. 41.3% voted for A,
36.4% for B, and 22.3 % for C. Round to the nearest percent, and
41% voted for A, 26% for B, and 22% for C, and a sharp eye will notice
the missing 1%.

I'd be inclined to go for (1)
> (1) Simply let the result stand, maybe adding a
> brief remark somewhere that this is the policy,
> to reassure readers who may observe what appear
> to be "anomalies" (e.g. 55.28 + 21.68 = 76.97);

Just round normally, and quote one more place of decimals thatn the
reader is going to need. Unless one is giving examples of how to
calculate, and the calculation involves adding the two values in
cents, in which case one miht feel it kinder to the beginner to
make the answer sum of the two numbers added, just as it would
be if they caclulated it themselves to the same number of
decimal places.

If one shows one extra place beyond the decimal places of interest
to the reader, only a very keen eye will spot anything, and one can
probably reasonably assume that aif anyone sees it, they are also
likely to understand the reason, or be able to derive it fairly
easily.

I wonder if you know the geometrical paradoxes that exploit a kind
of rounding error effect. Consists of a rectangle of squared paper
cut into triangles and other shapes. You work out the area in the usual way as the
number of squares. Then you re-arrange the triangles to make a rectangle
of another shape, and when you count the squares this time, you find
that there is an extra one. Where did the extra unit of area come
from?

Here is a modern version of it.
http://www.mathematik.uni-bielefeld.de/~sillke/PUZZLES/jigsaw-paradox.html

The two large triangles are exactly the same shape, and made out of the
same pieces, but the one below has a hole in it.

The pieces are accurately drawn, and there is no fudging involved in
the diagram - it is an accurate diagram in all respects.

Robert

🔗Robert Walker <robert_walker@rcwalker.freeserve.co.uk>

3/30/2001 6:37:39 AM

Hi Margo,

> The two large triangles are exactly the same shape, and made out of the
> same pieces, but the one below has a hole in it.

Sorry, should have said, the two large shapes have exactly the same
horizontal and vertical dimensions.

Hope this doesn't immediately give away the solution to the paradox.
I think perhaps not, or at least, one needs a little thought and one
has an extra step to accomplish.

Robert

🔗Haresh BAKSHI <hareshbakshi@hotmail.com>

3/30/2001 6:32:08 PM

--- In tuning@y..., "M. Schulter" <MSCHULTER@V...> wrote:
> Hello, there, everyone, and I have a simple but somewhat perplexing
> question maybe dealing more with conventions than strict logic: the
> best way to treat rounding errors in dealing with such quantities as
> the sizes of intervals in cents.
>

Hello Margo, while I am getting ready to post my response to your
excellent "Re: European counterpoint -- for Haresh", allow me to send
you the following list of sites related to rounding off of numbers
and significant figures. I presume that this topic is very relevant,
that rounding off has the same significance in music math as in day-
to-day math, and that it may qualify to be included in the FAQ. I
understand that the data type determines whether a number must be
rounded in order to be stored in any type of tabulation. Please
neglect this list if you think it may not serve any useful purpose.

Regards,
Haresh.

http://academic.brooklyn.cuny.edu/geology/leveson/core/linksa/roundoff
.html
http://inst.santafe.cc.fl.us/~natsci/adjunct/pbennett/Jan-12/
http://online.redwoods.cc.ca.us/instruct/Milo/1/tsld055.htm
http://www.mathleague.com/help/decwholeexp/decwholeexp.htm
http://www.pmel.org/HandBook/HBpage7.htm
http://www.phys.unt.edu/PIC/Home/significant_figures.htm
http://ecivwww.cwru.edu/civil/engr200/e200-lec1/tsld024.htm
http://west.pima.edu/~achristensen/197/metricandsci/sld002.htm
http://www.uop.edu/cop/psychology/Statistics/Rounding.html
http://cstl.syr.edu/FIPSE/decunit/roundec/Roundec.htm
http://dl.clackamas.cc.or.us/ch104-02/signific1.htm
http://wwwchem.tamu.edu/class/fyp/mathrev/mr-sigfg.html
http://www.accessexcellence.com/AE/newatg/Wasielewski/
http://sunsite.informatik.rwth-aachen.de/fortran/ch4-1.html
http://www.pcqna.com/Excel_Rounding.htm
http://master.natsci.csulb.edu/151lab/exp0/guideline_1-4/guide1-4.html

http://www.kindermagic.com/real_math/rnd_dec.html Too elementary, but
interesting
http://www.factmonster.com/ipka/A0875987.html -- " --