Python for philosophers

rusi rustompmody at gmail.com
Mon May 13 14:14:16 EDT 2013


On May 13, 9:24 pm, Chris Angelico <ros... at gmail.com> wrote:
>
> Your final conclusion is of course correct; nothing we build can be
> truly infinite. But we can certainly give some very good
> approximations, if we're prepared to pay for them. The reality is,
> though, that we usually do not want to pay for approximations to
> infinity; why is IEEE 754 floating point so much more used than, say,
> arbitrary-precision rational? Most of the time, we'd rather have good
> performance and adequate accuracy than abysmal performance and perfect
> accuracy. But hey, if you want to render a Mandelbrot set and zoom in
> to infinity, the option IS there.

Lets look at the costs of locomotion (which I am rounding to neat
figures for an easy discussion)

It costs $10K for a car which goes at around 80 kmph

Now if I want to move at 800 kmph I need to switch from car to plane
and that will cost me in millions

And if I want to move at 8000 kmph I need to be in a rocket in outer
space. Cost perhaps in billions

And maybe if I spend in trillions (leaving aside the question where I
got the trillions) maybe my rocket can go at 80,000 kmph

So what will it cost me to have a rocket that will go at 300,000 m/sec
(186,000 miles per second may be more familiar)?

So what am I driving at?

Some limitations are technological. Some are fundamental.

Earlier I talked of the fact that C, python and scheme hit the
finiteness wall in different ways/places.
machine word size is C's casualty
stack size is python's
memory is scheme's

The details are technological; the fact of finiteness is fundamental
just like the speed-of-light bar is fundamental.

The example of numbers is another such case.

The set of real numbers is in general not computable
Even if we restrict ourselves to the so-called computable real
numbers...
[interestingly Turing's original paper was on computable (real)
numbers]
we get into a soup because:
One can (somewhat simplistically) think of a real number as a
(potentially) infinite list of digits.
Now comparing two finite lists for equality is a trivial operation

However comparing two infinite lists gets us into trouble because both
lists may go on and on... and be same and same... for ever and ever...
In short equality for infinite lists (and therefore real numbers) is
undecidable.
[Well technically semidecidable because if they are different we get a
'not-equal' answer]

Sorry if this all sounds abstruse...
The other day I was reading someone saying that java -- which is after
all such an 'enterprisey' language -- had goofed by not providing a
half-decent money-type.

If you think about it, this is saying the opposite of your:
> But we can certainly give some very good  approximations, if we're prepared to pay for them.

He cannot use int and have a billionaire (or more correctly a
2147483648-aire) add a dollar and get to zero
Nor is it a great idea to use floating point and have some clever
programmer skim off the sub-penny round-off errors into his personal
account.

tl;dr
Computers are hopelessly finite
Much harder to deal with this finitude than to hand-wave the problem
away



More information about the Python-list mailing list