Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45258

Re: Python for philosophers

Newsgroups comp.lang.python
Date 2013-05-13 11:14 -0700
References (1 earlier) <mailman.1581.1368368230.3114.python-list@python.org> <avaqo7Fsj3pU1@mid.individual.net> <519052df$0$29997$c3e8da3$5496439d@news.astraweb.com> <5e2c6b41-e9af-4604-ad05-47fbea32ae15@zo5g2000pbb.googlegroups.com> <mailman.1631.1368462293.3114.python-list@python.org>
Message-ID <c1fac804-bf22-4786-b6d5-e699225d9530@a16g2000pbu.googlegroups.com> (permalink)
Subject Re: Python for philosophers
From rusi <rustompmody@gmail.com>

Show all headers | View raw


On May 13, 9:24 pm, Chris Angelico <ros...@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Python for philosophers Citizen Kant <citizenkant@gmail.com> - 2013-05-12 16:17 +0200
  Re: Python for philosophers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-12 14:30 +0000
    Re: Python for philosophers alex23 <wuwei23@gmail.com> - 2013-05-12 21:19 -0700
  Re: Python for philosophers rusi <rustompmody@gmail.com> - 2013-05-12 09:00 -0700
  Re: Python for philosophers Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-05-13 12:34 +1200
    Re: Python for philosophers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-13 02:41 +0000
      Re: Python for philosophers rusi <rustompmody@gmail.com> - 2013-05-13 07:53 -0700
        Re: Python for philosophers Chris Angelico <rosuav@gmail.com> - 2013-05-14 02:24 +1000
          Re: Python for philosophers rusi <rustompmody@gmail.com> - 2013-05-13 11:14 -0700
            Re: Python for philosophers Chris Angelico <rosuav@gmail.com> - 2013-05-14 04:22 +1000
          Re: Python for philosophers 88888 Dihedral <dihedral88888@googlemail.com> - 2013-05-18 16:56 -0700
            Re: Python for philosophers Chris Angelico <rosuav@gmail.com> - 2013-05-19 10:04 +1000
              Re: Python for philosophers 88888 Dihedral <dihedral88888@googlemail.com> - 2013-05-18 19:30 -0700
                Re: Python for philosophers Michael Torrie <torriem@gmail.com> - 2013-05-18 22:46 -0600
    Re: Python for philosophers Schneider <js@globe.de> - 2013-05-16 16:13 +0200
  Re: Python for philosophers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-13 03:25 +0000
    Re: Python for philosophers Grant Edwards <invalid@invalid.invalid> - 2013-05-13 14:33 +0000
  Re: Python for philosophers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-05-13 07:13 +0000
    Re: Python for philosophers alex23 <wuwei23@gmail.com> - 2013-05-13 02:05 -0700
    Re: Python for philosophers Neil Cerutti <neilc@norwich.edu> - 2013-05-13 13:52 +0000

csiph-web