Splitting and Confirming Large File
Name: Bradley C.
Date: June 2003
I just calculated one billion digits of pi on my PC, how do I confirm them? I cannot
access them because the file size is 1.28 GB, my ram is only 512 MB, meaning none of my word
processor's will touch it.
Is it possible to split the document, somehow? Then how do I confirm the digits?
Checking the correctness of large numbers -- transcendental numbers like 'pi', or a large prime --
is not easy because there are many sources of error that are difficult to detect, or track down.
Some, but by no means all are:
1. How "good" (that is convergent) is the algorithm? If, for example the algorithm is some sort of
infinite series, there is always a truncation error, because you cannot compute an infinite number
of terms in a finite amount of time. The further out you go in the algorithm, the more significant
these errors become.
2. If you did indeed compute 'pi' to 10^9 digits and your hard drive is 1.28 GB, assuming that each
digit only required a single byte (not realistic) that only leaves 280 MB of memory for your
calculation. That probably is insufficient, because in any algorithm there are certain intermediate
pieces of the calculation that are going to have to be stored temporarily on the hard drive that
will be needed "down the road" in the calculation.
3. Is your computer protected against random errors in the software (Windows is not perfect), bad
spots on your disc, yes even a cosmic ray or two that can zap a byte or two on its way through the
earth. Every single one of your ~1.8GB's has to be functioning properly. How can you be sure?
I do not mean to discourage your effort, because you learn a lot, even if the answer is not correct.
One way to test your methodology is to match your result for the first 100, then 1000, then 10,000
digits,... These results have been determined and replicated by several sources. If you find an
error in digit 5127 you know the rest of the calculation is suspect. FYI there are some numbers,
I do not recall the reference, of "almost rational" numbers -- a bit like 'e' = 2.718281828...,
which appear to be a repeating decimal but, like 'e', then "wander off" and become transcendental.
However, these pathological numbers have a lot more repeating digits before they expose their
Click here to return to the Computer Science Archives
Update: June 2012