[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [seul-edu] [no longer OT] summation of 1/2x
Ray Olszewski wrote:
>
> Actually, this gets me thinking again about Brian's original question --
> what language is best for doing mathematical demonstrations? I think we all
> (me included) answered this question with too little thought about the
> specific needs of mathematics.
>
> Whether Brian meant to write 1/n or (1/2)^n, a lot of the languages we
> suggested will have difficulties computing the series very far out, due to
> numerical-analysis limitations. Certainly any Basic I've ever actually used
> will perform poorly (though Ubasic might handle it okay -- I know it handles
> large integers well, but I don't know about high-precision floats).
>
> With 1/n, you get rounding errors very quickly, since 1/3 is an infinite
> decimal (its binary representation is also infinite, no?). Depending on how
> a particular language handles rounding and underflow errors, it might or
> might not demonstrate the unbounded growth that Jan (correctly) asociates
> with this series.
>
> With (1/2)^n, the number of significant (decimal or binary) digits in the
> fraction increases by 1 with every step in n -- here too, you'll run into
> rounding problems very fast. Here too, depending on how a language handles
> rounding and underflow, the series may or may not asymptotically approach 1
> or 2 (depending on if n starts as 1 or 0).
>
> So ... does anyone know if ANY of the languages we've collectively suggested
> handles these problems well? I do know that perl has BigInt and BigFloat
> packages that are said to handle arbitrarily-large precision. I've actually
> used BigInt, and (except for speed) it works fine with 100+ digit integers.
> I haven't used BigFloat.
>
If you are interested to go a bit into mathematics, take a look at
interval arithmetic, for example, at
http://www.cs.utep.edu/interval-comp/main.html
which has pointers to both theory and software. Basically, interval
arithmetic allows you to achieve any precision you want using finite
precision machines.
Most symbolic algebra packages also allows (more or less) arbitrary
precision computation.
Regards,
ST
--