Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65415 > unrolled thread
| Started by | Ayushi Dalmia <ayushidalmia2604@gmail.com> |
|---|---|
| First post | 2014-02-04 03:28 -0800 |
| Last post | 2014-02-05 15:22 +0000 |
| Articles | 20 on this page of 137 — 29 participants |
Back to article view | Back to comp.lang.python
Finding size of Variable Ayushi Dalmia <ayushidalmia2604@gmail.com> - 2014-02-04 03:28 -0800
Re: Finding size of Variable Peter Otten <__peter__@web.de> - 2014-02-04 12:40 +0100
Re: Finding size of Variable Ayushi Dalmia <ayushidalmia2604@gmail.com> - 2014-02-04 04:43 -0800
Re: Finding size of Variable Asaf Las <roegltd@gmail.com> - 2014-02-04 04:53 -0800
Re: Finding size of Variable Ayushi Dalmia <ayushidalmia2604@gmail.com> - 2014-02-04 05:18 -0800
Re: Finding size of Variable Dave Angel <davea@davea.name> - 2014-02-04 08:09 -0500
Re: Finding size of Variable Ayushi Dalmia <ayushidalmia2604@gmail.com> - 2014-02-04 05:19 -0800
Re: Finding size of Variable Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-02-04 09:06 -0500
Re: Finding size of Variable Ayushi Dalmia <ayushidalmia2604@gmail.com> - 2014-02-04 21:00 -0800
Re:Finding size of Variable Dave Angel <davea@davea.name> - 2014-02-04 14:21 -0500
Re: Finding size of Variable Ayushi Dalmia <ayushidalmia2604@gmail.com> - 2014-02-04 21:15 -0800
Re: Finding size of Variable Peter Otten <__peter__@web.de> - 2014-02-05 09:27 +0100
Re: Finding size of Variable Tim Golden <mail@timgolden.me.uk> - 2014-02-04 19:28 +0000
Re: Finding size of Variable Tim Chase <python.list@tim.thechases.com> - 2014-02-04 13:29 -0600
Re: Finding size of Variable Ayushi Dalmia <ayushidalmia2604@gmail.com> - 2014-02-04 21:35 -0800
Re: Finding size of Variable Rustom Mody <rustompmody@gmail.com> - 2014-02-04 21:45 -0800
Re: Finding size of Variable Ayushi Dalmia <ayushidalmia2604@gmail.com> - 2014-02-04 22:00 -0800
Re: Finding size of Variable Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-05 11:00 +0000
Re: Finding size of Variable Chris Angelico <rosuav@gmail.com> - 2014-02-05 22:44 +1100
Re: Finding size of Variable wxjmfauth@gmail.com - 2014-02-06 02:15 -0800
Re: Finding size of Variable Ned Batchelder <ned@nedbatchelder.com> - 2014-02-06 06:10 -0500
Re: Finding size of Variable wxjmfauth@gmail.com - 2014-02-06 05:51 -0800
Re: Finding size of Variable wxjmfauth@gmail.com - 2014-02-06 06:15 -0800
Re: Finding size of Variable Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-02-08 02:48 +0000
Re: Finding size of Variable Ethan Furman <ethan@stoneleaf.us> - 2014-02-07 19:02 -0800
Re: Finding size of Variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-08 13:17 +0000
Re: Finding size of Variable David Hutto <dwightdhutto@gmail.com> - 2014-02-08 17:45 -0500
Re: Finding size of Variable Rustom Mody <rustompmody@gmail.com> - 2014-02-08 17:25 -0800
Re: Finding size of Variable David Hutto <dwightdhutto@gmail.com> - 2014-02-08 21:56 -0500
Re: Finding size of Variable Chris Angelico <rosuav@gmail.com> - 2014-02-09 13:59 +1100
Re: Finding size of Variable David Hutto <dwightdhutto@gmail.com> - 2014-02-08 22:07 -0500
Re: Finding size of Variable Ned Batchelder <ned@nedbatchelder.com> - 2014-02-08 22:09 -0500
Re: Finding size of Variable David Hutto <dwightdhutto@gmail.com> - 2014-02-08 22:09 -0500
Re: Finding size of Variable Ned Batchelder <ned@nedbatchelder.com> - 2014-02-08 22:16 -0500
Re: Finding size of Variable Rustom Mody <rustompmody@gmail.com> - 2014-02-08 19:30 -0800
Re: Finding size of Variable wxjmfauth@gmail.com - 2014-02-10 06:07 -0800
Re: Finding size of Variable Asaf Las <roegltd@gmail.com> - 2014-02-10 06:25 -0800
Re: Finding size of Variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-10 14:39 +0000
Re: Finding size of Variable Tim Chase <python.list@tim.thechases.com> - 2014-02-10 08:43 -0600
Re: Finding size of Variable wxjmfauth@gmail.com - 2014-02-11 10:53 -0800
Re: Finding size of Variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-11 19:04 +0000
Re: Finding size of Variable wxjmfauth@gmail.com - 2014-02-11 23:49 -0800
Re: Finding size of Variable Chris Angelico <rosuav@gmail.com> - 2014-02-12 19:06 +1100
Re: Finding size of Variable Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2014-02-12 10:57 +0200
Re: Finding size of Variable Chris Angelico <rosuav@gmail.com> - 2014-02-12 20:24 +1100
Re: Finding size of Variable Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2014-02-12 11:35 +0200
Working with the set of real numbers (was: Finding size of Variable) Ben Finney <ben+python@benfinney.id.au> - 2014-02-12 19:17 +1100
Re: Working with the set of real numbers (was: Finding size of Variable) wxjmfauth@gmail.com - 2014-02-12 00:35 -0800
Re: Working with the set of real numbers (was: Finding size of Variable) wxjmfauth@gmail.com - 2014-02-12 00:46 -0800
Re: Working with the set of real numbers Ben Finney <ben+python@benfinney.id.au> - 2014-02-12 19:52 +1100
Re: Working with the set of real numbers (was: Finding size of Variable) Grant Edwards <invalid@invalid.invalid> - 2014-02-12 15:24 +0000
Re: Working with the set of real numbers (was: Finding size of Variable) "Gisle Vanem" <gvanem@yahoo.no> - 2014-02-12 17:23 +0100
Re: Working with the set of real numbers (was: Finding size of Variable) Chris Angelico <rosuav@gmail.com> - 2014-02-12 19:47 +1100
Re: Working with the set of real numbers (was: Finding size of Variable) Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2014-02-12 11:23 +0200
Re: Working with the set of real numbers (was: Finding size of Variable) albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-03-04 02:45 +0000
Re: Working with the set of real numbers (was: Finding size of Variable) Chris Angelico <rosuav@gmail.com> - 2014-03-04 14:02 +1100
Re: Working with the set of real numbers (was: Finding size of Variable) Rustom Mody <rustompmody@gmail.com> - 2014-03-03 19:13 -0800
Re: Working with the set of real numbers (was: Finding size of Variable) Chris Angelico <rosuav@gmail.com> - 2014-03-04 14:46 +1100
Re: Working with the set of real numbers (was: Finding size of Variable) Rustom Mody <rustompmody@gmail.com> - 2014-03-03 21:19 -0800
Re: Working with the set of real numbers (was: Finding size of Variable) Steven D'Aprano <steve@pearwood.info> - 2014-03-04 05:53 +0000
Re: Working with the set of real numbers (was: Finding size of Variable) Chris Angelico <rosuav@gmail.com> - 2014-03-04 17:35 +1100
Re: Working with the set of real numbers Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-05 00:05 +1300
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-03-04 23:43 +1100
Re: Working with the set of real numbers Marko Rauhamaa <marko@pacujo.net> - 2014-03-04 21:49 +0200
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-03-05 06:58 +1100
Re: Working with the set of real numbers Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2014-03-04 20:55 +0000
Re: Working with the set of real numbers Marko Rauhamaa <marko@pacujo.net> - 2014-03-04 23:05 +0200
Re: Working with the set of real numbers Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2014-03-04 22:08 +0000
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-03-05 08:18 +1100
Re: Working with the set of real numbers Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2014-03-04 22:02 +0000
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-03-05 09:18 +1100
Re: Working with the set of real numbers Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2014-03-04 22:54 +0000
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-03-05 10:01 +1100
Re: Working with the set of real numbers Dave Angel <davea@davea.name> - 2014-03-04 18:20 -0500
Re: Working with the set of real numbers (was: Finding size of Variable) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-04 04:19 -0700
Re: Working with the set of real numbers (was: Finding size of Variable) albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-03-05 02:27 +0000
Re: Working with the set of real numbers (was: Finding size of Variable) Ian Kelly <ian.g.kelly@gmail.com> - 2014-03-04 04:23 -0700
Re: Working with the set of real numbers (was: Finding size of Variable) albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-03-05 02:15 +0000
Re: Working with the set of real numbers (was: Finding size of Variable) Steven D'Aprano <steve@pearwood.info> - 2014-03-05 03:41 +0000
Re: Working with the set of real numbers (was: Finding size of Variable) Rustom Mody <rustompmody@gmail.com> - 2014-03-04 20:15 -0800
Re: Working with the set of real numbers (was: Finding size of Variable) Roy Smith <roy@panix.com> - 2014-03-04 23:25 -0500
Re: Working with the set of real numbers Ben Finney <ben+python@benfinney.id.au> - 2014-03-05 15:37 +1100
Re: Working with the set of real numbers Rustom Mody <rustompmody@gmail.com> - 2014-03-04 20:57 -0800
Re: Working with the set of real numbers Roy Smith <roy@panix.com> - 2014-03-05 00:29 -0500
Re: Working with the set of real numbers Ben Finney <ben+python@benfinney.id.au> - 2014-02-12 19:56 +1100
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-02-12 20:16 +1100
Re: Working with the set of real numbers Ben Finney <ben+python@benfinney.id.au> - 2014-02-12 21:07 +1100
Re: Working with the set of real numbers Rustom Mody <rustompmody@gmail.com> - 2014-02-12 06:11 -0800
Re: Working with the set of real numbers Ian Kelly <ian.g.kelly@gmail.com> - 2014-02-12 13:45 -0700
Re: Working with the set of real numbers Rustom Mody <rustompmody@gmail.com> - 2014-02-12 17:47 -0800
Re: Working with the set of real numbers Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-02-13 11:09 +1300
Re: Working with the set of real numbers Steven D'Aprano <steve@pearwood.info> - 2014-02-13 03:31 +0000
Re: Working with the set of real numbers Ben Finney <ben+python@benfinney.id.au> - 2014-02-13 14:45 +1100
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-02-13 15:17 +1100
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-02-12 21:20 +1100
Re: Working with the set of real numbers wxjmfauth@gmail.com - 2014-02-12 02:55 -0800
Re: Working with the set of real numbers Ned Batchelder <ned@nedbatchelder.com> - 2014-02-12 06:55 -0500
Re: Working with the set of real numbers Marko Rauhamaa <marko@pacujo.net> - 2014-02-12 14:48 +0200
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-02-13 00:20 +1100
Re: Working with the set of real numbers Marko Rauhamaa <marko@pacujo.net> - 2014-02-12 16:13 +0200
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-02-13 04:52 +1100
Re: Working with the set of real numbers Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-02-13 11:24 +1300
Re: Working with the set of real numbers Dave Angel <davea@davea.name> - 2014-02-12 17:56 -0500
Re: Working with the set of real numbers Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-02-14 18:26 +1300
Re: Working with the set of real numbers Ben Finney <ben+python@benfinney.id.au> - 2014-02-12 22:44 +1100
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-02-12 22:58 +1100
Re: Working with the set of real numbers Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-02-13 11:32 +1300
Re: Working with the set of real numbers Grant Edwards <invalid@invalid.invalid> - 2014-02-12 23:23 +0000
Re: Finding size of Variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-12 14:04 +0000
Re: Finding size of Variable Rustom Mody <rustompmody@gmail.com> - 2014-02-12 06:14 -0800
Re: Finding size of Variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-12 14:25 +0000
Re: Finding size of Variable Rustom Mody <rustompmody@gmail.com> - 2014-02-12 06:32 -0800
Re: Working with the set of real numbers Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2014-02-13 12:48 +0000
Re: Working with the set of real numbers Marko Rauhamaa <marko@pacujo.net> - 2014-02-13 16:00 +0200
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-02-14 06:25 +1100
Re: Working with the set of real numbers Marko Rauhamaa <marko@pacujo.net> - 2014-02-13 21:47 +0200
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-02-14 07:08 +1100
Re: Working with the set of real numbers Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-02-13 22:05 -0800
Re: Working with the set of real numbers Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-02-15 00:30 +1300
Re: Working with the set of real numbers Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-02-14 16:26 -0800
Re: Working with the set of real numbers albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-03-05 02:38 +0000
Re: Working with the set of real numbers Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-02-14 19:37 +1300
Re: Working with the set of real numbers Chris Angelico <rosuav@gmail.com> - 2014-02-14 17:44 +1100
Re: Working with the set of real numbers Rustom Mody <rustompmody@gmail.com> - 2014-02-14 07:13 -0800
Re: Working with the set of real numbers Dave Angel <davea@davea.name> - 2014-02-14 07:30 -0500
Re: Working with the set of real numbers Grant Edwards <invalid@invalid.invalid> - 2014-02-14 15:09 +0000
Re: Working with the set of real numbers Rotwang <sg552@hotmail.co.uk> - 2014-02-13 21:29 +0000
Re: Working with the set of real numbers Marko Rauhamaa <marko@pacujo.net> - 2014-02-14 00:00 +0200
Re: Working with the set of real numbers Rotwang <sg552@hotmail.co.uk> - 2014-02-13 22:21 +0000
Re: Working with the set of real numbers Marko Rauhamaa <marko@pacujo.net> - 2014-02-14 01:16 +0200
Re: Working with the set of real numbers Ben Finney <ben+python@benfinney.id.au> - 2014-02-14 03:57 +1100
Re: Finding size of Variable Ned Batchelder <ned@nedbatchelder.com> - 2014-02-10 10:02 -0500
Re: Finding size of Variable Neil Cerutti <neilc@norwich.edu> - 2014-02-11 14:29 +0000
Re: Finding size of Variable Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-02-05 22:14 -0500
Re: Finding size of Variable Dave Angel <davea@davea.name> - 2014-02-05 08:43 -0500
Re: Finding size of Variable Ayushi Dalmia <ayushidalmia2604@gmail.com> - 2014-02-05 06:33 -0800
Re: Finding size of Variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-05 15:22 +0000
Page 6 of 7 — ← Prev page 1 2 3 4 5 [6] 7 Next page →
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-02-13 04:52 +1100 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <mailman.6770.1392227560.18130.python-list@python.org> |
| In reply to | #66038 |
On Thu, Feb 13, 2014 at 1:13 AM, Marko Rauhamaa <marko@pacujo.net> wrote: > Text files suffer from the same caveat as integers: there's a limit to > how much you can store on the physical computer. Sure, but nobody said the text file had to be _stored_ anywhere :) Computers are quite capable of working with streams of incoming data that are potentially infinite in size. But again, this is the same caveat as the Turing machine. If you wrote a Python interpreter for a Turing machine, it would be - without any changes to Python - capable of handling any integer and any text file. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| Date | 2014-02-13 11:24 +1300 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <bm2almF4ogvU1@mid.individual.net> |
| In reply to | #66063 |
Chris Angelico wrote: > Sure, but nobody said the text file had to be _stored_ anywhere :) > Computers are quite capable of working with streams of incoming data > that are potentially infinite in size. However, they *can't* work with arbitrary real numbers in an exact way, even if they are represented by infinitely long digit streams, and you're willing to run the program for an infinitely long time to get the result. Consider adding two of these numbers, for example. You have to do it starting at the big end, because the small end is infinitely far away. And you only have a limited amount of buffer space, so you need to start writing out result digits before you've seen all the input digits. But you can't do that, because it's possible that some pair of input digits you haven't seen yet will cause a carry-over that ripples back and affects something you've already written out. This is where schemes such as computable reals get into trouble. Doing arithmetic with them gets extremely messy. -- Greg
[toc] | [prev] | [next] | [standalone]
| From | Dave Angel <davea@davea.name> |
|---|---|
| Date | 2014-02-12 17:56 -0500 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <mailman.6801.1392245611.18130.python-list@python.org> |
| In reply to | #66107 |
Gregory Ewing <greg.ewing@canterbury.ac.nz> Wrote in message: > Chris Angelico wrote: >> Sure, but nobody said the text file had to be _stored_ anywhere :) >> Computers are quite capable of working with streams of incoming data >> that are potentially infinite in size. > > However, they *can't* work with arbitrary real numbers in an > exact way, even if they are represented by infinitely long > digit streams, and you're willing to run the program for > an infinitely long time to get the result. > > Consider adding two of these numbers, for example. You have > to do it starting at the big end, because the small end is > infinitely far away. And you only have a limited amount of > buffer space, so you need to start writing out result > digits before you've seen all the input digits. > > But you can't do that, because it's possible that some > pair of input digits you haven't seen yet will cause a > carry-over that ripples back and affects something you've > already written out. > > Actually, the particular example you use can be done. When printing the infinite sum of two infinite decimal streams, you can simply hold back whenever you get one or more nines. Instead keep a count of how many nines you're holding, and emit them all only when you get something other than 9. I've done something analogous doing run length encoding of an rs232 stream. But you're right in general. -- DaveA
[toc] | [prev] | [next] | [standalone]
| From | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| Date | 2014-02-14 18:26 +1300 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <bm5nndFqfluU1@mid.individual.net> |
| In reply to | #66110 |
Dave Angel wrote: > Actually, the particular example you use can be done. When > printing the infinite sum of two infinite decimal streams, you > can simply hold back whenever you get one or more nines. But you only have a finite amount of space for keeping track of how many nines you've seen, so there will be some inputs with more nines than you can handle. (Infinitely many such inputs, in fact!) -- Greg
[toc] | [prev] | [next] | [standalone]
| From | Ben Finney <ben+python@benfinney.id.au> |
|---|---|
| Date | 2014-02-12 22:44 +1100 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <mailman.6752.1392205467.18130.python-list@python.org> |
| In reply to | #66004 |
Chris Angelico <rosuav@gmail.com> writes: > On Wed, Feb 12, 2014 at 9:07 PM, Ben Finney <ben+python@benfinney.id.au> wrote: > > That's why I think you need to be clear that your point isn't > > “computers don't work with real numbers”, but rather “computers work > > only with a limited subset of real numbers”. > > Hmm, I'm not sure that my statement is false. If a computer can work > with "real numbers", then I would expect it to be able to work with > any real number. Likewise, if you claim that a computer *does not* work with real numbers, then I would expect that for any real number, the computer would fail to work with that number. Which is why neither of those is a good statement of your position, IMO, and you're better off saying the *limitations* you're describing. -- \ “An expert is a man who has made all the mistakes which can be | `\ made in a very narrow field.” —Niels Bohr | _o__) | Ben Finney
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-02-12 22:58 +1100 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <mailman.6754.1392206334.18130.python-list@python.org> |
| In reply to | #66004 |
On Wed, Feb 12, 2014 at 10:44 PM, Ben Finney <ben+python@benfinney.id.au> wrote: > Chris Angelico <rosuav@gmail.com> writes: > >> On Wed, Feb 12, 2014 at 9:07 PM, Ben Finney <ben+python@benfinney.id.au> wrote: >> > That's why I think you need to be clear that your point isn't >> > “computers don't work with real numbers”, but rather “computers work >> > only with a limited subset of real numbers”. >> >> Hmm, I'm not sure that my statement is false. If a computer can work >> with "real numbers", then I would expect it to be able to work with >> any real number. > > Likewise, if you claim that a computer *does not* work with real > numbers, then I would expect that for any real number, the computer > would fail to work with that number. > > Which is why neither of those is a good statement of your position, IMO, > and you're better off saying the *limitations* you're describing. I think we're using different words to say the same thing here :) What I mean is that one cannot accurately say that a computer works with real numbers, because it cannot work with them all. Of course a computer can work with _some_ real numbers; but only some. (An awful lot of them, of course. A ridiculously huge number of numbers. More numbers than you could read in a lifetime! While the number is extremely large, it still falls pitifully short of infinity.[1]) And so we do have optimizations for some subset of reals: in approximate order of performance, an arbitrary-precision integer type, a limited precision floating point type, and two types that handle fractions (vulgar and decimal). They're all, in a sense, optimizations. In pure theory, we could have a single "real number" type and do everything with that; all the other types are approximations to that. [1] http://tools.ietf.org/search/rfc2795
[toc] | [prev] | [next] | [standalone]
| From | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| Date | 2014-02-13 11:32 +1300 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <bm2b49F4s04U1@mid.individual.net> |
| In reply to | #66030 |
Chris Angelico wrote: > Of course a > computer can work with _some_ real numbers; but only some. (An awful > lot of them, of course. A ridiculously huge number of numbers. More > numbers than you could read in a lifetime! While the number is > extremely large, it still falls pitifully short of infinity.[1]) The number of integers it can work with is also vanishingly small compared to the total number of integers. However, the number of reals is vastly greater than the number of integers, so the proportion of reals it can work with is even *more* vanishingly small. In some sense. -- Greg
[toc] | [prev] | [next] | [standalone]
| From | Grant Edwards <invalid@invalid.invalid> |
|---|---|
| Date | 2014-02-12 23:23 +0000 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <ldgvp9$5ff$1@reader1.panix.com> |
| In reply to | #66109 |
On 2014-02-12, Gregory Ewing <greg.ewing@canterbury.ac.nz> wrote:
> Chris Angelico wrote:
>
>> Of course a computer can work with _some_ real numbers; but only
>> some. (An awful lot of them, of course. A ridiculously huge number of
>> numbers. More numbers than you could read in a lifetime! While the
>> number is extremely large, it still falls pitifully short of
>> infinity.[1])
>
> The number of integers it can work with is also vanishingly small
> compared to the total number of integers.
>
> However, the number of reals is vastly greater than the number of
> integers, so the proportion of reals it can work with is even *more*
> vanishingly small. In some sense.
More importantly, Computers can generally work with a subset of
integers consisting of all integers between a min value and a max
value. The min and max may be known and fixed at compile time (e.g. C
"int" on a 32-bit machine), or it may depend on how much memory and
time you have. But knowing that you can represent all values in some
range makes life pretty easy.
OTOH, no matter how small the magnitude of the range of real numbers
you pick, computer FP can only represent a very tiny subset of the
rational numbers which are an even tinier subset of the real numbers
within whatever range you care to pick. If you pick your range and
representation intelligently, you can still do some pretty useful
stuff. But, if you pretend you're actually working with real numbers
you will come a cropper.
--
Grant Edwards grant.b.edwards Yow! Why is it that when
at you DIE, you can't take
gmail.com your HOME ENTERTAINMENT
CENTER with you??
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2014-02-12 14:04 +0000 |
| Message-ID | <mailman.6758.1392213901.18130.python-list@python.org> |
| In reply to | #66004 |
On 12/02/2014 07:49, wxjmfauth@gmail.com wrote:
> Le mardi 11 février 2014 20:04:02 UTC+1, Mark Lawrence a écrit :
>> On 11/02/2014 18:53, wxjmfauth@gmail.com wrote:
>>
>>> Le lundi 10 février 2014 15:43:08 UTC+1, Tim Chase a écrit :
>>
>>>> On 2014-02-10 06:07, wxjmfauth@gmail.com wrote:
>>
>>>>
>>
>>>>> Python does not save memory at all. A str (unicode string)
>>
>>>>
>>
>>>>> uses less memory only - and only - because and when one uses
>>
>>>>
>>
>>>>> explicitly characters which are consuming less memory.
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>> Not only the memory gain is zero, Python falls back to the
>>
>>>>
>>
>>>>> worse case.
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>>>>> sys.getsizeof('a' * 1000000)
>>
>>>>
>>
>>>>> 1000025
>>
>>>>
>>
>>>>>>>> sys.getsizeof('a' * 1000000 + 'oe')
>>
>>>>
>>
>>>>> 2000040
>>
>>>>
>>
>>>>>>>> sys.getsizeof('a' * 1000000 + 'oe' + '\U00010000')
>>
>>>>
>>
>>>>> 4000048
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>> If Python used UTF-32 for EVERYTHING, then all three of those cases
>>
>>>>
>>
>>>> would be 4000048, so it clearly disproves your claim that "python
>>
>>>>
>>
>>>> does not save memory at all".
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>>> The opposite of what the utf8/utf16 do!
>>
>>>>
>>
>>>>>
>>
>>>>
>>
>>>>>>>> sys.getsizeof(('a' * 1000000 + 'oe' +
>>
>>>>
>>
>>>>>>>> '\U00010000').encode('utf-8'))
>>
>>>>
>>
>>>>> 1000023
>>
>>>>
>>
>>>>>>>> sys.getsizeof(('a' * 1000000 + 'oe' +
>>
>>>>
>>
>>>>>>>> '\U00010000').encode('utf-16'))
>>
>>>>
>>
>>>>> 2000025
>>
>>>>
>>
>>>>
>>
>>>>
>>
>>>> However, as pointed out repeatedly, string-indexing in fixed-width
>>
>>>>
>>
>>>> encodings are O(1) while indexing into variable-width encodings (e.g.
>>
>>>>
>>
>>>> UTF8/UTF16) are O(N). The FSR gives the benefits of O(1) indexing
>>
>>>>
>>
>>>> while saving space when a string doesn't need to use a full 32-bit
>>
>>>>
>>
>>>> width.
>>
>>>>
>>
>>>>
>>
>>>
>>
>>> A utf optimizes the memory and the performance at the same time.
>>
>>> It behaves like a mathematical operator, a unique operator for
>>
>>> a unique set of elements. Unbeatable.
>>
>>>
>>
>>> The FSR is an exclusive or mechanism. I you wish to
>>
>>> same memory, you have to encode, and if you are encoding,
>>
>>> maybe because you have to, one loses performance. Paradoxal.
>>
>>>
>>
>>> Your O(1) indexing works only and only because and
>>
>>> when you are working explicitly with a "static" unicode
>>
>>> string you never touch.
>>
>>> It's a little bit the the "corresponding" performance
>>
>>> case of the memory case.
>>
>>>
>>
>>> jmf
>>
>>>
>>
>>
>>
>> Why are you so rude as to continually post your nonsense here that not a
>>
>> single person believes, and at the same time still quite deliberately
>>
>> use gg to post it with double line spacing. If you lack the courtesy to
>>
>> stop the former, please have the courtesy to stop the latter.
>>
>>
>>
>> --
>>
>> My fellow Pythonistas, ask not what our language can do for you, ask
>>
>> what you can do for our language.
>>
>>
>
> Nonsense?
>
>>>> sys.getsizeof('') - sys.getsizeof('a')
> -1
>
>
> The day you find an operator working on the set of
> reals (R) and it is somehow "optimized" for N
> (the subset of natural numbers), let me know.
>
> A conflict is quickly appearing. Either the operator is
> not correctly defined or the choice of the set is wrong.
>
> You can replace the "operator" with an "encoding" and
> the "set" with a "repertoire of characters".
>
> It's the main reason, why we have to live today with
> all these coding schemes. Even in more sophisticated
> cases like, CID-fonts or "char boxes" in a pdf (with the
> hope you understand how it works).
>
> jmf
>
I ask you, members of the jury, to find the accused, jmf, guilty of
writing nonsense and deliberately using google groups to double line
space. The evidence is directly above and quite clearly prooves, beyond
a resonable doubt, that no verdict other than guilty can be recorded. I
rest my case, m'lud.
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com
[toc] | [prev] | [next] | [standalone]
| From | Rustom Mody <rustompmody@gmail.com> |
|---|---|
| Date | 2014-02-12 06:14 -0800 |
| Message-ID | <2ac510a9-69d3-49f5-afb9-8ef6a2463a01@googlegroups.com> |
| In reply to | #66036 |
On Wednesday, February 12, 2014 7:34:42 PM UTC+5:30, Mark Lawrence wrote: > I ask you, members of the jury, to find the accused, jmf, guilty of > writing nonsense and deliberately using google groups to double line > space. The evidence is directly above and quite clearly prooves, beyond > a resonable doubt, that no verdict other than guilty can be recorded. I > rest my case, m'lud. Is a proof more fool-proof because prove is spelt proove <wink>?
[toc] | [prev] | [next] | [standalone]
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Date | 2014-02-12 14:25 +0000 |
| Message-ID | <mailman.6759.1392215151.18130.python-list@python.org> |
| In reply to | #66040 |
On 12/02/2014 14:14, Rustom Mody wrote: > On Wednesday, February 12, 2014 7:34:42 PM UTC+5:30, Mark Lawrence wrote: > >> I ask you, members of the jury, to find the accused, jmf, guilty of >> writing nonsense and deliberately using google groups to double line >> space. The evidence is directly above and quite clearly prooves, beyond >> a resonable doubt, that no verdict other than guilty can be recorded. I >> rest my case, m'lud. > > Is a proof more fool-proof because prove is spelt proove <wink>? > Fauultee keebored :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com
[toc] | [prev] | [next] | [standalone]
| From | Rustom Mody <rustompmody@gmail.com> |
|---|---|
| Date | 2014-02-12 06:32 -0800 |
| Message-ID | <2bf8fc43-8555-4710-8273-e545ce115ac5@googlegroups.com> |
| In reply to | #66041 |
On Wednesday, February 12, 2014 7:55:32 PM UTC+5:30, Mark Lawrence wrote: > On 12/02/2014 14:14, Rustom Mody wrote: > > On Wednesday, February 12, 2014 7:34:42 PM UTC+5:30, Mark Lawrence wrote: > >> I ask you, members of the jury, to find the accused, jmf, guilty of > >> writing nonsense and deliberately using google groups to double line > >> space. The evidence is directly above and quite clearly prooves, beyond > >> a resonable doubt, that no verdict other than guilty can be recorded. I > >> rest my case, m'lud. > > Is a proof more fool-proof because prove is spelt proove <wink>? > Fauultee keebored :) Very O(n)T considering the relation between Fawlty towers and Monty python :-)
[toc] | [prev] | [next] | [standalone]
| From | Oscar Benjamin <oscar.j.benjamin@gmail.com> |
|---|---|
| Date | 2014-02-13 12:48 +0000 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <mailman.6840.1392295705.18130.python-list@python.org> |
| In reply to | #66004 |
On 12 February 2014 10:07, Ben Finney <ben+python@benfinney.id.au> wrote: > Chris Angelico <rosuav@gmail.com> writes: > >> On Wed, Feb 12, 2014 at 7:56 PM, Ben Finney <ben+python@benfinney.id.au> wrote: >> > So, if I understand you right, you want to say that you've not found >> > a computer that works with the *complete* set of real numbers. Yes? >> >> Correct. [...] My point is that computers *do not* work with real >> numbers, but only ever with some subset thereof [...] > > You've done it again: by saying that "computers *do not* work with real > numbers", that if I find a real number - e.g. the number 4 - your > position is that, since it's a real number, computers don't work with > that number. > > That's why I think you need to be clear that your point isn't "computers > don't work with real numbers", but rather "computers work only with a > limited subset of real numbers". I think Chris' statement above is pretty clear. Also I didn't find the original statement confusing and it is a reasonable point to make. While computers can (with some limitations) do a pretty good job of integers and rational numbers they cannot truly represent real computation. Other people have mentioned that there are computer algebra systems that can handle surds and other algebraic numbers or some transcendental numbers but none of these comes close to the set of reals. This isn't even a question of resource constraints: a digital computer with infinite memory and computing power would still be limited to working with countable sets, and the real numbers are just not countable. The fundamentally discrete nature of digital computers prevents them from being able to truly handle real numbers and real computation. A hypothetical idealised analogue computer would be able to truly do real arithmetic (but I think in practice the errors would be worse than single precision floating point). Oscar
[toc] | [prev] | [next] | [standalone]
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Date | 2014-02-13 16:00 +0200 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <871tz7864a.fsf@elektro.pacujo.net> |
| In reply to | #66176 |
Oscar Benjamin <oscar.j.benjamin@gmail.com>:
> This isn't even a question of resource constraints: a digital computer
> with infinite memory and computing power would still be limited to
> working with countable sets, and the real numbers are just not
> countable. The fundamentally discrete nature of digital computers
> prevents them from being able to truly handle real numbers and real
> computation.
Well, if your idealized, infinite, digital computer had ℵ₁ bytes of RAM
and ran at ℵ₁ hertz and Python supported transfinite iteration, you
could easily do reals:
def real_sqrt(y):
for x in continuum(0, max(1, y)):
# Note: x is not traversed in the < order but some other
# well-ordering, which has been proved to exist.
if x * x == y:
return x
assert False
The function could well return in finite time with a precise result for
any given nonnegative real argument.
Marko
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-02-14 06:25 +1100 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <mailman.6861.1392319546.18130.python-list@python.org> |
| In reply to | #66178 |
On Fri, Feb 14, 2014 at 1:00 AM, Marko Rauhamaa <marko@pacujo.net> wrote: > Well, if your idealized, infinite, digital computer had ℵ₁ bytes of RAM > and ran at ℵ₁ hertz and Python supported transfinite iteration, you > could easily do reals: > > def real_sqrt(y): > for x in continuum(0, max(1, y)): > # Note: x is not traversed in the < order but some other > # well-ordering, which has been proved to exist. > if x * x == y: > return x > assert False How exactly do you iterate over a continuum, with a digital computer? Even adding to your requirements that it have an ℵ₁ Hz bus (which, by the way, I *totally* want - the uses are endless), it would take a finite amount of time to assign to x the "next number", ergo your algorithm can't guarantee to finish in finite time. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Date | 2014-02-13 21:47 +0200 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <87fvnm7q1n.fsf@elektro.pacujo.net> |
| In reply to | #66213 |
Chris Angelico <rosuav@gmail.com>: > On Fri, Feb 14, 2014 at 1:00 AM, Marko Rauhamaa <marko@pacujo.net> wrote: >> Well, if your idealized, infinite, digital computer had ℵ₁ bytes of RAM >> and ran at ℵ₁ hertz and Python supported transfinite iteration, you >> could easily do reals: >> >> for x in continuum(0, max(1, y)): > > How exactly do you iterate over a continuum, with a digital computer? How "digital" our idealized computers are is a matter for a debate. However, iterating over the continuum is provably "possible:" http://en.wikipedia.org/wiki/Transfinite_induction > it would take a finite amount of time to assign to x the "next > number", ergo your algorithm can't guarantee to finish in finite time. My assumption was you could execute ℵ₁ statements per second. That doesn't guarantee a finite finish time but would make it possible. That is because ℵ₁ * ℵ₁ = ℵ₁ = ℵ₁ * 1 This computer is definitely more powerful than a Turing machine, which only has ℵ₀ bytes of RAM and thus can't even store an arbitrary real value in memory. Marko
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2014-02-14 07:08 +1100 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <mailman.6872.1392322105.18130.python-list@python.org> |
| In reply to | #66220 |
On Fri, Feb 14, 2014 at 6:47 AM, Marko Rauhamaa <marko@pacujo.net> wrote: > My assumption was you could execute ℵ₁ statements per second. That > doesn't guarantee a finite finish time but would make it possible. That > is because > > ℵ₁ * ℵ₁ = ℵ₁ = ℵ₁ * 1 Hmm. I never actually covered this stuff in grade school - the construction of infinite computing power didn't exactly come up. But as I understand it, just calculating the "next number" requires ℵ₁ RAM operations, and you have to do that ℵ₁ times per second. So what you're saying is that it's possible to do that? You can execute ℵ₁ operations where each operation has to wait for ℵ₁ bus actions before continuing? This would do my head in if I hadn't already thoroughly broken my brain on other insanities. ChrisA
[toc] | [prev] | [next] | [standalone]
| From | Devin Jeanpierre <jeanpierreda@gmail.com> |
|---|---|
| Date | 2014-02-13 22:05 -0800 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <mailman.6908.1392357961.18130.python-list@python.org> |
| In reply to | #66220 |
On Thu, Feb 13, 2014 at 11:47 AM, Marko Rauhamaa <marko@pacujo.net> wrote: > Chris Angelico <rosuav@gmail.com>: > >> On Fri, Feb 14, 2014 at 1:00 AM, Marko Rauhamaa <marko@pacujo.net> wrote: >>> Well, if your idealized, infinite, digital computer had ℵ₁ bytes of RAM >>> and ran at ℵ₁ hertz and Python supported transfinite iteration, you >>> could easily do reals: >>> >>> for x in continuum(0, max(1, y)): >> >> How exactly do you iterate over a continuum, with a digital computer? > > How "digital" our idealized computers are is a matter for a debate. > However, iterating over the continuum is provably "possible:" > > http://en.wikipedia.org/wiki/Transfinite_induction You missed the most important point on that page, which is the "limit case". There is no way to iterate over all the reals one at a time, no matter how fast you execute instructions. If you could, it would be trivial to show that the reals have the same cardinality as the positive integers: correspond n with the whatever is returned by the nth call to it.next. It doesn't matter if you call your magical iterator "transfinite", that doesn't make it so. -- Devin
[toc] | [prev] | [next] | [standalone]
| From | Gregory Ewing <greg.ewing@canterbury.ac.nz> |
|---|---|
| Date | 2014-02-15 00:30 +1300 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <bm6d29F924U1@mid.individual.net> |
| In reply to | #66284 |
Devin Jeanpierre wrote: > There is no way to iterate over all the reals one at a time, no matter > how fast you execute instructions. If you could, it would be trivial > to show that the reals have the same cardinality as the positive > integers: correspond n with the whatever is returned by the nth call > to it.next. You're assuming that the calls to it.next are discrete events separated by some nonzero time interval. A decent transfinite processor would make a continuum of calls, and execute uncountably many of them in any finite period of time. -- Greg
[toc] | [prev] | [next] | [standalone]
| From | Devin Jeanpierre <jeanpierreda@gmail.com> |
|---|---|
| Date | 2014-02-14 16:26 -0800 |
| Subject | Re: Working with the set of real numbers |
| Message-ID | <mailman.6946.1392424026.18130.python-list@python.org> |
| In reply to | #66291 |
On Fri, Feb 14, 2014 at 3:30 AM, Gregory Ewing <greg.ewing@canterbury.ac.nz> wrote: > Devin Jeanpierre wrote: >> There is no way to iterate over all the reals one at a time, no matter >> how fast you execute instructions. If you could, it would be trivial >> to show that the reals have the same cardinality as the positive >> integers: correspond n with the whatever is returned by the nth call >> to it.next. > > > You're assuming that the calls to it.next are discrete > events separated by some nonzero time interval. I'm not. If you want to imagine infinitely fast computers, you must allow for things to "precede" each other in the program's execution, or else you can't execute any program at all. In such an infinitely fast computer, if iteration works by calling a .next() method repeatedly, it can't iterate uncountably many times, by construction. If you're executing uncountably many instructions per second, the loop would terminate immediately, having executed countably infinitely many iterations. > A decent transfinite processor would make a continuum > of calls, and execute uncountably many of them in any > finite period of time. Yes, you could imagine a computer that does a thing for every real. My issue is that the cited thing is transfinite induction, for which the induction covers countably many values; handling of the rest of the values is a second step. This is also the implication of such a word as "iteration". I suppose this was accidental on the part of the poster, and I shouldn't have disagreed so strongly. I suspect they meant what you are getting at, instead, which is that there is no successor to any iteration, and between any two iterations there are uncountably many iterations that happened. Operations occur in an order, but not sequentially. (Of course, such a machine would be alien and absurd.) -- Devin
[toc] | [prev] | [next] | [standalone]
Page 6 of 7 — ← Prev page 1 2 3 4 5 [6] 7 Next page →
Back to top | Article view | comp.lang.python
csiph-web