Pi is not a number.
Any algorithm that has a legitimate claim to actually computing pi can
do so for any precision. A good start would be
http://www.cs.uwaterloo.ca/~alopez-o/math-faq/mathtext/node12.html
Note that, for many algorithms, you won't get a "next" digit. You'll
just get an approximate result. In order to know that any particular
digit is correct, you also need an upper bound on the possible error of
the result. And, of course, you need a data type of the desired
precision and, if it's floating point, you need to account for rounding
error (how carefully depends on why you need the result).
--
Chris Smith
You will not get an approximate result. The result you get is always no
more or less than what it should be - completely accurate. Pi has no
'precision' of calculation.
So 3.14 is "completely accurate"?
> So 3.14 is "completely accurate"?
Of course 3.14 IS completely accurate. Pi isn't a number, nor is it
strictly speaking a method of calculation. But if you want to employ a
method of calculation and call the result pi, then whatever the result
of the calculation, it will always be completely accurate.
Of course not. It's a cloud formation.
As a precaution, it's always useful to check someone's posting history
here before taking trollish-looking statements too seriously. In this
case, it is very illuminating.
--
Chris Smith
:-)
Pi is a real number. As such it is a number. Do you agree?
Of course, pi defined as ratio between the circumference
of a circle and its diagonal.
--
Vänligen
Konrad
---------------------------------------------------
Sleep - thing used by ineffective people
as a substitute for coffee
Ambition - a poor excuse for not having
enough sence to be lazy
---------------------------------------------------
Stop picking your nose. It would be better if you could tackle the
issues that challenge you but I suspect a lack of ability and youth.
Tuck your shirt in.
That's really sad Bogle. He told you to ignore a question you couldn't
answer and so you ignored it.
> John Jones wrote/skrev/kaita/popisal/schreibt :
>
> > Newberry wrote:
> >
> >> Is there an algorithm to compute all the digits fo pi? I.e. will it
> >> keep appending digits at the end for ever? Or do you need a different
> >> algorithm for every precision? That will a given algorithm calculate
> >> pi only with a precision n and no more? Would you need a different
> >> algorithm to calculate it with precision n+1?
> >
> > Pi is not a number.
>
>
> Pi is a real number. As such it is a number. Do you agree?
> Of course, pi defined as ratio between the circumference
> of a circle and its diagonal.
Pi is not a real number, neither is it a ratio between the
circumference of a circle and its diameter. Why? The 'ratio' is an
arithmetical construction, while the relationship between the circle
and its diameter is fixed only as far as we can construct a circle.
One is also not a number. Did you see "number" written on it?
There is a primitive recursive function f such that f(n) is the n-th
digit of pi.
Rupert wrote:
>>Is there an algorithm to compute all the digits fo pi? I.e. will it
> There is a primitive recursive function f such that f(n) is the n-th
> digit of pi.
Yes. Take any pi taylor sum development. And use
an upper bound for the error, and then use high
precision computation up to the number of digits
discounted by the error.
A recent world record:
http://www.super-computing.org/pi_current.html
Don't forget to staff your project.
As pointed out, even if you force a small error you might not be able
to determine as many digits as you want. However, you can force that
there are only two possibilities for the first n digits. And then it
follows from one of the proofs that pi is irrational that you can
decide between these two possibilities using a primitive recursive
function. (The proofs that pi is irrational give a method for deciding
whether pi<r or pi>r, where r is any rational number).
And if you make this binary decision 4-times, you
should be able to decide a digit. Isn't it that you
contradict yourself now, denying you can decide a
decimal digit and affirming you can decide a binary
digit?
Bye
Chris Smith wrote:
> Any algorithm that has a legitimate claim to actually computing pi can
> do so for any precision. A good start would be
> http://www.cs.uwaterloo.ca/~alopez-o/math-faq/mathtext/node12.html
The above link is very nice. There are
even methods to compute the n-the
hexadecimal digit without knowing the
n-1 previous digits. Thanks.
Here is a link to an older method:
http://www.mathpages.com/home/kmath425/kmath425.htm
My interest in this is theoretical/philosophical. So how do you model
this by a Turing machine? Will the tape just keep moving left and
ouputing digits for good?
>
> --
> Chris Smith
This depends on what you want. A Turing machine can do all kinds of
things that involve computing approximations or digits of pi. What is
the precise task you're looking to perform?
--
Chris Smith
I want to construct a machine that will keep outputing the digits of
irrational numbers such as pi for ever. My understanding is that a
Turing machine will transform a finite number into another finite
number. How do I make it to output an infinite number? This seems even
harder with the Unlimited Register Machine.
>
> --
> Chris Smith
Use a Turing Machine with 2 tapes. These can be emulated by an ordinary TM.
Use the 1st tape to do working and the 2nd tape to output the digits of pi.
Note that a conventional TM always halts when it is computing properly, so
a non halting TM that performs a computation is non standard, but it works.
Herc
I'm not following you. I never denied that you could decide a demical
digit. For any base b>1, there is a primitive recursive function f_b
such that f_b(n) is the n-th base-b digit of pi. I was just pointing
out that it's a slightly stronger statement than just "pi is
computable". It immediately follows from the fact that pi is computable
that for any base b>1 there is a general recursive function f_b such
that f_b(n) is the n-th base-b digit of pi. To prove that the function
can even be chosen to be primitive recursive, you need to look at the
proofs that pi is irrational. That is the point I was making.
Run this Python program and you get an infinity of digits!
For Python see: http://www.python.org/
# Based on a algorithm of Lambert Meertens
import sys
def main():
k, a, b, a1, b1 = 2L, 4L, 1L, 12L, 4L
while 1:
p, q, k = k*k, 2L*k+1L, k+1L
a, b, a1, b1 = a1, b1, p*a+q*a1, p*b+q*b1
d, d1 = a/b, a1/b1
while d == d1:
output(d)
a, a1 = 10L*(a%b), 10L*(a1%b1)
d, d1 = a/b, a1/b1
def output(d):
sys.stdout.write(`int(d)`)
sys.stdout.flush()
main()
Cheers,
Jaap
What question? I don't see any questions in any of you posts above
this one.
************************
David C. Ullrich
>
If we're using the word "number" in its standard sense then yes,
pi is a number.
You're free to deny that, of course. Guffaw.
************************
David C. Ullrich
He didn't say it couldn't be done, he just said, correctly,
that merely getting an approximation with a small error may
not suffice. In particular what you said,
"Yes. Take any pi taylor sum development. And use
an upper bound for the error, and then use high
precision computation up to the number of digits
discounted by the error."
is not quite enough.
>Bye
************************
David C. Ullrich
A vanilla Turing machine has no concept of "output". The convention for
defining Turing-computable functions is that the machine halts with the
desired output on its work tape. That obviously doesn't work here;
which makes sense because asking for a rational expression equal to the
value of pi SHOULD be undefined.
So you need to do something else. With my earlier questions, I was
trying to figure out whether you already know what you need to do, or
you weren't sure yet. Since it doesn't look like you have a precise
description, there are a number of options that will work. If you need
to meet someone else's problem description (for example, if this is an
assignment for a class) then you should ask that person what they want.
Otherwise, I guess it's up to you.
Herc's suggestion to use an additional tape as the "running" output will
work. Another idea, which wouldn't be entirely unprecedented, would be
to add "output" to the machine as a new possible operation, and have the
machine output the digits one by one. This is already done in defining
logspace transducers, for example. The advantage here, versus using an
additional tape, is that it helps guarantee that you have a valid
partial result at any point in time. The tape approach doesn't make
that clear: a Turing machine could go back and change any cell of the
tape at any time. Without knowing something about the algorithm, you'd
never quite be sure when some tape cell contains its final answer.
Another thing you could do, if you want something closer to a Turing-
computable function, would be to have the input be the number of digits
of pi that you want, and have the machine halt when it's got that many.
--
Chris Smith
Yes, I thought about this. You mean the second tape would always move
to the left?
>
> Herc
> What question? I don't see any questions in any of you posts above
> this one.
>
>
> ************************
>
> David C. Ullrich
A response!
I made this assignment for myself. I want to make a list of all
computable rational numbers. I figured a (modified?) Turing machine
might be a way to do it.
> Otherwise, I guess it's up to you.
>
> Herc's suggestion to use an additional tape as the "running" output will
> work. Another idea, which wouldn't be entirely unprecedented, would be
> to add "output" to the machine as a new possible operation, and have the
> machine output the digits one by one.
How would you define the output operation? Would it simply output every
symbol it writes on the first tape?
This is already done in defining
> logspace transducers, for example. The advantage here, versus using an
> additional tape, is that it helps guarantee that you have a valid
> partial result at any point in time. The tape approach doesn't make
> that clear: a Turing machine could go back and change any cell of the
> tape at any time. Without knowing something about the algorithm, you'd
> never quite be sure when some tape cell contains its final answer.
>
> Another thing you could do, if you want something closer to a Turing-
> computable function, would be to have the input be the number of digits
> of pi that you want, and have the machine halt when it's got that many.
The whole idea behind this project is to let the machines run for ever
and keep outputting digits. Since we have just found something a
standard Turing machine cannot do does it mean that Church's thesis has
been invalidated?
>
> --
> Chris Smith
> Chris Smith wrote:
>> Newberry <newb...@ureach.com> wrote:
>> > I want to construct a machine that will keep outputing the digits of
>> > irrational numbers such as pi for ever. My understanding is that a
>> > Turing machine will transform a finite number into another finite
>> > number. How do I make it to output an infinite number? This seems even
>> > harder with the Unlimited Register Machine.
>>
>> A vanilla Turing machine has no concept of "output". The convention for
>> defining Turing-computable functions is that the machine halts with the
>> desired output on its work tape. That obviously doesn't work here;
>> which makes sense because asking for a rational expression equal to the
>> value of pi SHOULD be undefined.
>>
>> So you need to do something else. With my earlier questions, I was
>> trying to figure out whether you already know what you need to do, or
>> you weren't sure yet. Since it doesn't look like you have a precise
>> description, there are a number of options that will work. If you need
>> to meet someone else's problem description (for example, if this is an
>> assignment for a class) then you should ask that person what they want.
> I made this assignment for myself. I want to make a list of all
> computable rational numbers. I figured a (modified?) Turing machine
> might be a way to do it.
Every rational number is computable. Some irrational numbers (a
countable infinity of them, in fact) are likewise computable. Pi, e, and
sqrt(2) are examples of the latter. It's hard to "specify" an
uncomputable number, but we know that uncountably many such numbers must
exist.
--
Dave Seaman
U.S. Court of Appeals to review three issues
concerning case of Mumia Abu-Jamal.
<http://www.mumia2000.org/>
I meant real numbers.
> I meant real numbers.
Ok, but a "list of all computable real numbers" is not computable. That
is, the list is countable, but it is not recursively enumerable.
There are a large number of ways to do it. All of the sensible ones are
equivalent to each other. You could have it output everything it writes
to a tape, but that seems needlessly cumbersome. The obvious way, which
is as good as any, is to just modify the transition table so that each
transition can, in addition to writing to the tape and moving the head,
output some fixed string. So your new delta function would be:
delta: Q x Sigma x Gamma -> Gamma x {L,R} x Sigma*
The extra "x Sigma*" means that each transition has a (possibly empty)
string that it appends to the output.
> The whole idea behind this project is to let the machines run for ever
> and keep outputting digits.
Okay.
> Since we have just found something a standard Turing machine cannot do
> does it mean that Church's thesis has been invalidated?
No, of course not. Printing the value of pi as a decimal is NOT
possible, as evidenced by the fact that your Turing machine will never
halt. Church's thesis doesn't say that Turing machines can perform
impossible computations. It only asserts that Turing machines can
perform everything that's intuitively possible by algorithms. Printing
infinitely long strings clearly doesn't qualify.
Incidentally, the natural expression of this problem as a terminating
function would be to be able to pass in any desired precision and get a
result. That is possible, but you just didn't seem to interested in it.
--
Chris Smith
And this is, of course, completely nonsensical. My apologies. Make
that:
delta: Q x Gamma -> Q x Gamma x {L,R} x Sigma*
--
Chris Smith
Where can I read a proof of this?
I am interested in creating a list of all computable real numbers (or
rather a list of algorithms for all computable real numbers) and seeing
whether the anti-diagonal is computable.
>
> --
> Chris Smith
It's a diagonal proof due to Turing, which closely resembles the Cantor
diagonal proof of the uncountability of the reals. Let R_c be the set of
computable reals, and suppose there is a recursive enumeration f:N->R_c.
That is, f is assumed to be a recursive function and also a surjection.
Then we carry out the usual diagonal argument: define a number x whose
n-th digit is a 4 unless the n-th digit of f(n) is a 4, in which case we
make the n-th digit of x a 5.
Then the number x is obviously a real number that is not in the range of
f, which means x is not in R_c, since f was assumed to be a surjection.
But on the other hand, since we assumed f is recursive, it turns out that
the entire diagonalization process is effectively computable and
therefore x is a computable real. Contradiction. Therefore, we must reject
our assumption that a recursive enumeration of R_c exists.
The Cantor form of the diagonal argument makes sense for any f, whether
computable or not, but we need f to be computable in order to conclude
that the number x produced by the diagonalization is computable. Hence,
the contradiction disappears without that assumption.
I think there's a problem with this: it's not enough for
f to be recursive. You also need to have the algorithm that
produces digits of f(n) to be a recursive function of n.
Robert Israel isr...@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia Vancouver, BC, Canada
That's part of what I mean by a "computable real number". Sorry I didn't
make that clear.
I am taking the value of f(n) to be the Goedel number of a TM T_n such
that T_n(m) computes the m-th digit of a real number. There may be other
ways of representing a computable real number, but this is the one I am
used to.
The term "pi" is a symbol for a real number that is the limit of various
calculation methods approximating the perimeter of a circle, divided by
the length of the same circle's diameter, on an idealized plane surface.
Most people simply say "pi is a number", :-) but there are those who
are extremely pedantic. Like, well, me... :-)
As for the OP's question, there are a fair number of methods by which
one can calculate pi's digits, either in base 10 or in base 16.
http://mathworld.wolfram.com/PiFormulas.html
details quite a few of them.
One cannot compute all digits of pi, of course (since pi
is not an integer multiple of a power of 10). Depending on
implementation, one might require that the algorithm preallocate
its buffers so that one can calculate a certain number of digits;
for example, if one uses Machin's formula:
pi/4 = 4 * atan(1/5) - atan(1/239)
together with
atan(x) = x - x^3/3 + x^5/5 - x^7/7 + ...
and uses the rather simplistic algorithm
A = 16.0000000...0
B = 4.00000000...0
PI = 0.00000000...0
SIGN = 1
N = ....1
while(we can do more precision)
{
A = A / 5
B = B / 239
PI = PI + SIGN * A / N - SIGN * B / N
A = A / 5
B = B / 239
N = N + 2
SIGN = -SIGN
}
then one will ultimately run out of bits in both A and B.
Even if one uses a variant of the BBP (Bailey-Borwein-Plouffe) formula,
which can be represented as
sum(n=0,+oo) ( (1/16)^n * (4/(8n+1)-2/(8n+4)-1/(8n+5)-1/(8n+6)) )
(the coding is vaguely similar to Machin and is left to
the reader), one will ultimately run out of space in the
division (e.g., if n = 4096 the value 8 *n + 1 = 32769 >
32768 = 2^15 is too big to fit in a 15-bit value).
Of course if one uses 32 bits one can probably go up to about
2^29 = 536870912 digits. If one uses 64 bits one gets about
2305843009213693952 = 2.306 * 10^18 digits -- which is probably
more than enough.
--
#191, ewi...@earthlink.net
Murphy was an optimist.
--
Posted via a free Usenet account from http://www.teranews.com
Because pi _is_ a number. I didn't say "pi" was a number.
> but there are those who
>are extremely pedantic. Like, well, me... :-)
Pedantry is fine, as long as you're in a place where it's
legal. But pedantry is not going to suffice to refute the
statement that pi is a number.
************************
David C. Ullrich
OK, how about ths diagonal argument? Since the set of computable reals
is countable there must be a one-to-one correspondence between N and
the computable reals. That is, the countable reals are indexable by
integers and a list of computable reals exists. Now we construct the
anti-diagonal. It is not a computable real number because it is not in
the list of computable reals.
But not a *computable* one-to-one correspondence, as the argument above
demonstrates.
> That is, the countable reals are indexable by
> integers and a list of computable reals exists.
But not a *computable* list.
> Now we construct the
> anti-diagonal.
But the "construction" is not computable, since the first step is to
produce an uncomputable list.
> It is not a computable real number because it is not in
> the list of computable reals.
Correct, and there is no reason to expect that the number should be
computable, since the method we used to produce it is not an actual
computation. Therefore, there is no contradiction.
Well, there is no contradiction with your proof above. But a number of
people on this board have claimed that Cantor's proof is constructive
or that the antdiagonal number has been "constructed." In fact the
anti-diagonal is not computable.
I have probably said the same thing myself at various times. When people
talk about a "construction" in mathematics, they don't necessarily mean
that the process is effectively computable. A construction is merely a
demonstration that something exists, without necessarily giving a way to
find it computationally.
> In fact the
> anti-diagonal is not computable.
That depends. If the given list is computable (a recursive enumeration),
then the anti-diagonal is computable.
I think just about the only case when the anti-diagonal is computable
is when you start with a list of primitive recursive functions.
Each computable real is represented by a recursive function. It doesn't
matter whether the listed functions are primitive recursive or just plain
recursive, as long as each one computes a real number. What matters is
that the list itself must be a recursive enumeration.
Well, that and the functions are total. If the functions are not total,
then the diagonal construction generally will cause the function to be
defined at that point, and it will be defined for an input where the
enumerated function is not defined. Then the anti-diagonal is not
computable. Perhaps that's what Newberry was getting at by requiring
the functions to be primitive recursive; a sufficient but not necessary
condition.
--
Chris Smith
> Well, that and the functions are total.
Huh? How can a function be said to "compute a real number" and not be
total? There is no such thing as a partially defined real number. That
means, of course, that not every function computes a real number. In
fact, just being total is not sufficient; see below.
The point is, we are given by hypothesis a (computable) list of
computable real numbers. That places a sharp restriction on the kind of
functions that can appear in the list.
> If the functions are not total,
> then the diagonal construction generally will cause the function to be
> defined at that point, and it will be defined for an input where the
> enumerated function is not defined. Then the anti-diagonal is not
> computable. Perhaps that's what Newberry was getting at by requiring
> the functions to be primitive recursive; a sufficient but not necessary
> condition.
Nonsense. If any of the functions are not total, then you don't have a
"list of computable real numbers" to begin with.
In fact, in the absence of other restrictions, merely requiring the
functions to be primitive recursive is not sufficient. For example,
there is a primitive recursive function that returns the "digits":
1, 10, 100, 1000, ...
and if you attempt to interpret this function as a decimal number, you
get the sequence
1 + 10/10 + 100/100 + ...
which fails to be Cauchy.
Sorry, I missed that context.
> The point is, we are given by hypothesis a (computable) list of
> computable real numbers. That places a sharp restriction on the kind of
> functions that can appear in the list.
Yes, and you are of course right when that's the given.
--
Chris Smith
Where can I read about this stuff?
You can start with <http://en.wikipedia.org/wiki/Recursion_theory> and
<http://en.wikipedia.org/wiki/Computable_number>, both of which include
references.
The definition that I gave for a computable real differs from the ones
mentioned in the Wikipedia article, but it is provably equivalent.
However, given a computable real according to one of the Wikipedia
definitions, there is not necessarily an effective way to find an
algorithm that gives the n-th decimal digit, even though such an
algorithm must exist. That's the point that Robert Israel was making.
Pi represents a quantity.
Quantities can be represented as numbers.
Therefore Pi can be represented as a number.
IOW, Pi is a number.
The only issue is the precision of the numbers allowed.
B.
Uhhh . . . He might have a point there. I haven't read the later
replies, but what are numbers and what is pi?
C-B
> As a precaution, it's always useful to check someone's posting history
> here before taking trollish-looking statements too seriously. In this
> case, it is very illuminating.
Like whether they post comments that don't say a fucking thing about
Mathematics or Logic - and then sometimes even attack people on that
(non-)basis? What would you think about that activity - approve or
disapprove?
C-B
Mathematical validity is based on proofs, not on the past history of
people.
> --
> Chris Smith
How do you define a circle and its diagonal? But we all know what your
answers will be to the first few levels - how deep can you take it? In
the final analysis, is it a Turing Machine? No - not enough Turing
Machines!
C-B
> --
> Vänligen
> Konrad
> ---------------------------------------------------
>
> Sleep - thing used by ineffective people
> as a substitute for coffee
>
> Ambition - a poor excuse for not having
> enough sence to be lazy
> ---------------------------------------------------
(Being too lazy to look - damn) Doesn't Dedekind (I won't even look up
the spelling - gad!) define it as something that divides the real
numbers into two sets?
C-B
The CBL edge is that he is talking about less than being recursive
within the real numbers. (Of course we have to expand inputs into
aleph-1 or more.) And there's lots that CBL says about less than:
LT(I,J) Less than is recursive.
LT(x,I)* We can output all numbers less than any given number and
stop. (We can count!)
~LT(a,a) , TRUE No number is less than itself.
A great use of less than is Rosser 1936.
You are so fucking smart.
OMG You fill my ideas lists. Wonderful.
Yes, but how many p.r. functions are there and how many numbers are
there?
C-B
> John Jones wrote:
> > Tuck your shirt in.
>
> You are so fucking smart.
Eh? I replied to this, not to you -
> As a precaution, it's always useful to check someone's posting history
> here before taking trollish-looking statements too seriously. In this
> case, it is very illuminating.
So Get your ACT sorted.