[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [seul-edu] [no longer OT] summation of 1/2x



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.

At 11:23 AM 4/5/00 -0700, you wrote:
><sigh> Looks like I missed it too, Jan, jm ... I read the problem as the one
>I assumed Brian meant (sum of (1/2)^n instead of what he actually wrote (1/n).
>
>At 01:06 PM 4/5/00 -0500, Jan wrote [in part]:
>
>>> so you can prove that 1/2+1/4+1/8+..+1/2n+.. = 1
>>
>>Actually, that is 1/2^n (one over 2 to the n), not 1/2n.  As a matter of
>>fact, the series 1/n does not have a finite sum. 
>

------------------------------------"Never tell me the odds!"---
Ray Olszewski                                        -- Han Solo
Palo Alto, CA           	 	         ray@comarre.com        
----------------------------------------------------------------