Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2012-08-29 21:49:27

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,724

Spigot algorithms and log(2)

Hi;

How can we use a spigot algorithm to calculate the digits of a constant? I will use the Wikipedia article and flesh out the explanation a bit so that we can see it used on a real problem.

Let's see if we can get the 50th binary digit of log(2). We will use the relation:

First we multiply both sides of 1) by 2^49.

The RHS is split into two parts.

This term on the right is the important one.

We can replace 4) with

This form can be rapidly computed using mods and only needs floating point arithmetic of the single precision variety. So 3) becomes:


Okay, let's do the number crunching and let's try to get it right.

We are only interested in the fractional part so this becomes,

( You may have noticed the smearing error in the above calculation and how to repair it.)

Now we need that number in binary.

So according to our calculations the 50th - 56th binary digit of log(2) is 1111001

Checking this we find that we have agreement between our prediction in 7) and the answer from the 50th to the 56th digit.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#2 2012-08-30 00:37:08

anonimnystefy
Real Member
From: The Foundation
Registered: 2011-05-23
Posts: 14,860

Re: Spigot algorithms and log(2)

Hi bobbym

Could you explain how you got from 4) to 5) ?


“Here lies the reader who will never open this book. He is forever dead.

“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment

Offline

#3 2012-08-30 04:48:05

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,724

Re: Spigot algorithms and log(2)

Hi;

To say you get from 4 to 5 is a misconception. Try

and

then see what you get.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

Board footer

Powered by FluxBB