⊙ AntiQuark

Truth, Beauty, Charm, Strange

2005/05/08

pi in e, e in pi, and shower stalls

American Scientist: The Third Base
Long article about the base 3 numbering system. It's almost the most efficient possible (base e is the best in that respect) and it's probably the prettiest system of them all. A base-3 digit is called a "trit".

e in pi, pi in e
e in base pi is 2.2021201002111. pi in base e is 10.101002020002111. So there!


The pi-and-e Shower Stall
Man calculates binary digits of pi and e. Man puts pi and e in shower stall. Geekitude ensues. (Speaking of pi, I hear that Home Depot is now selling pi toilets. If you measure the circumference of the bowl and divide by the diameter, you miraculously get the value of pi. What will they think of next!)

pi in base e code
If you want to calculate pi in base e to 10000 digits, cut and paste the following code into Maple:
Digits := 10000;
mye := evalf(exp(1), 10000);
mypi:= evalf(Pi, 10000);
pi_part := mypi;
pi_recon := evalf(0, 10000);
answer := evalf(0, 10000);
for i from 1 by -1 to -10000 do
 digit := floor(pi_part / (mye^i));
 answer := 10 * answer + digit ;
 pi_part := pi_part - digit * mye ^ i ;
 pi_recon := pi_recon + digit * mye ^ i ;
od;
evalf(answer, 10000);
evalf(mypi - pi_recon, 10000);
(DISCLAIMER: maybe that code works, maybe it doesn't. The first 17 digits seem OK.)


0 Comments:

Post a Comment

<< Home