Re: Working with the set of real numbers

2014-03-06 Thread Chris Angelico
On Thu, Mar 6, 2014 at 11:27 PM, Oscar Benjamin wrote: > So my loop > > while x ** 2 - y > x * eps: > x = (x + y/x) / 2 > > and Chris' loop: > > while abs(guess1-guess2) > epsilon: > guess1 = n/guess2 > guess2 = (guess1 + guess2)/2 > > and now your loop > >

Re: Working with the set of real numbers

2014-03-06 Thread Oscar Benjamin
On 5 March 2014 12:57, Dave Angel wrote: > Oscar Benjamin Wrote in message: >> On 4 March 2014 23:20, Dave Angel wrote: >>> >>> On the assumption that division by 2 is very fast, and that a >>> general multiply isn't too bad, you could improve on Newton by >>> observing that the slope is 2.

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Roy Smith
In article <5317e640$0$29985$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > On Wed, 05 Mar 2014 21:31:51 -0500, Roy Smith wrote: > > > In article <53176225$0$29987$c3e8da3$54964...@news.astraweb.com>, > > Steven D'Aprano wrote: > > > >> Physics is the fundamental science, at l

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Grant Edwards
On 2014-03-06, Roy Smith wrote: > In article <53176225$0$29987$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Physics is the fundamental science, at least according to the >> physicists, and Real Soon Now they'll have a Theory Of Everything, >> something small enough to print

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Chris Angelico
On Thu, Mar 6, 2014 at 2:06 PM, Steven D'Aprano wrote: > They ask a computer programmer to adjudicate who is right, so he writes a > program to print out all the primes: > > 1 is prime > 1 is prime > 1 is prime > 1 is prime > 1 is prime And he claimed that he was correct, because he had - as is k

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2014 21:31:51 -0500, Roy Smith wrote: > In article <53176225$0$29987$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> Physics is the fundamental science, at least according to the >> physicists, and Real Soon Now they'll have a Theory Of Everything, >> something

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Roy Smith
In article <53176225$0$29987$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > Physics is the fundamental science, at least according to the physicists, > and Real Soon Now they'll have a Theory Of Everything, something small > enough to print on a tee-shirt, which will explain eve

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Oscar Benjamin
On 5 March 2014 17:43, Steven D'Aprano wrote: > On Wed, 05 Mar 2014 12:21:37 +, Oscar Benjamin wrote: >> >> The argument that the sum of all natural numbers comes to -1/12 is just >> some kind of hoax. I don't think *anyone* seriously believes it. > > You would be wrong. I suggest you read the

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Grant Edwards
On 2014-03-05, Chris Kaynor wrote: > On Wed, Mar 5, 2014 at 9:43 AM, Steven D'Aprano < > steve+comp.lang.pyt...@pearwood.info> wrote: > >> At one time, Euler summed an infinite series and got -1, from which he >> concluded that -1 was (in some sense) larger than infinity. I don't know >> what just

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Chris Kaynor
On Wed, Mar 5, 2014 at 9:43 AM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > At one time, Euler summed an infinite series and got -1, from which he > concluded that -1 was (in some sense) larger than infinity. I don't know > what justification he gave, but the way I think of it

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Chris Angelico
On Thu, Mar 6, 2014 at 4:43 AM, Steven D'Aprano wrote: > Physics is the fundamental science, at least according to the physicists, > and Real Soon Now they'll have a Theory Of Everything, something small > enough to print on a tee-shirt, which will explain everything. At least > in principle. Eve

Re: Working with the set of real numbers

2014-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2014 12:50:06 +, Mark Lawrence wrote: > On 05/03/2014 12:21, Oscar Benjamin wrote: >> >> Why the dig at physicists? I think most physicists would be able to >> tell you that the sum of all natural numbers is not -1/12. In fact most >> people with very little background in mathem

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Steven D'Aprano
On Wed, 05 Mar 2014 12:21:37 +, Oscar Benjamin wrote: > On 5 March 2014 07:52, Steven D'Aprano wrote: >> On Tue, 04 Mar 2014 23:25:37 -0500, Roy Smith wrote: >> >>> I stopped paying attention to mathematicians when they tried to >>> convince me that the sum of all natural numbers is -1/12. >>

Re: Working with the set of real numbers

2014-03-05 Thread Dave Angel
Dave Angel Wrote in message: > Oscar Benjamin Wrote in message: >> On 4 March 2014 23:20, Dave Angel wrote: >>> >>> If anyone is curious, I'll be glad to describe the algorithm; >>> I've never seen it published, before or since. I got my >>> inspiration from a method used in mechanical,

Re: Working with the set of real numbers

2014-03-05 Thread Dave Angel
Oscar Benjamin Wrote in message: > On 4 March 2014 23:20, Dave Angel wrote: >> >> One problem with complexity claims is that it's easy to miss some >> contributing time eaters. I haven't done any measuring on modern >> machines nor in python, but I'd assume that multiplies take >> *much* long

Re: Working with the set of real numbers

2014-03-05 Thread Mark Lawrence
On 05/03/2014 12:21, Oscar Benjamin wrote: Why the dig at physicists? I think most physicists would be able to tell you that the sum of all natural numbers is not -1/12. In fact most people with very little background in mathematics can tell you that. I'll put that one to the test tomorrow mo

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Oscar Benjamin
On 5 March 2014 07:52, Steven D'Aprano wrote: > On Tue, 04 Mar 2014 23:25:37 -0500, Roy Smith wrote: > >> I stopped paying attention to mathematicians when they tried to convince >> me that the sum of all natural numbers is -1/12. > > I'm pretty sure they did not. Possibly a physicist may have tri

Re: Working with the set of real numbers

2014-03-05 Thread Oscar Benjamin
On 4 March 2014 23:20, Dave Angel wrote: > > One problem with complexity claims is that it's easy to miss some > contributing time eaters. I haven't done any measuring on modern > machines nor in python, but I'd assume that multiplies take > *much* longer for large integers, and that divides ar

Re: Working with the set of real numbers

2014-03-05 Thread Ned Batchelder
On 3/5/14 4:00 AM, wxjmfa...@gmail.com wrote: Mathematics? The Flexible String Representation is a very nice example of a mathematical absurdity. jmf PS Do not even think to expect to contradict me. Hint: sheet of paper and pencil. Reminder to everyone: JMF makes no sense when he talks about

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread wxjmfauth
Mathematics? The Flexible String Representation is a very nice example of a mathematical absurdity. jmf PS Do not even think to expect to contradict me. Hint: sheet of paper and pencil. -- https://mail.python.org/mailman/listinfo/python-list

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-05 Thread Steven D'Aprano
Following up on my own post. On Wed, 05 Mar 2014 07:52:01 +, Steven D'Aprano wrote: > On Tue, 04 Mar 2014 23:25:37 -0500, Roy Smith wrote: > >> I stopped paying attention to mathematicians when they tried to >> convince me that the sum of all natural numbers is -1/12. [...] > In effect, the

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-04 Thread Steven D'Aprano
On Tue, 04 Mar 2014 23:25:37 -0500, Roy Smith wrote: > I stopped paying attention to mathematicians when they tried to convince > me that the sum of all natural numbers is -1/12. I'm pretty sure they did not. Possibly a physicist may have tried to tell you that, but most mathematicians conside

Re: Working with the set of real numbers

2014-03-04 Thread Roy Smith
In article , Ben Finney wrote: > Roy Smith writes: > > > I stopped paying attention to mathematicians when they tried to convince > > me that the sum of all natural numbers is -1/12. > > I stopped paying attention to a particular person when they said “I > stopped paying attention to an en

Re: Working with the set of real numbers

2014-03-04 Thread Rustom Mody
On Wednesday, March 5, 2014 10:07:44 AM UTC+5:30, Ben Finney wrote: > Roy Smith writes: > > I stopped paying attention to mathematicians when they tried to convince > > me that the sum of all natural numbers is -1/12. > I stopped paying attention to a particular person when they said "I > stoppe

Re: Working with the set of real numbers

2014-03-04 Thread Ben Finney
Roy Smith writes: > I stopped paying attention to mathematicians when they tried to convince > me that the sum of all natural numbers is -1/12. I stopped paying attention to a particular person when they said “I stopped paying attention to an entire field of study because one position expressed

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-04 Thread Roy Smith
In article , Rustom Mody wrote: > I cannot find the exact quote so from memory Weyl says something to this > effect: > > Cantor's diagonalization PROOF is not in question. > Its CONCLUSION very much is. > The classical/platonic mathematician (subject to wooly thinking) concludes > that > the

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-04 Thread Rustom Mody
On Wednesday, March 5, 2014 9:11:13 AM UTC+5:30, Steven D'Aprano wrote: > On Wed, 05 Mar 2014 02:15:14 +, Albert van der Horst wrote: > > Adding cf's adds all computable numbers in infinite precision. However > > that is not even a drop in the ocean, as the computable numbers have > > measure

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-04 Thread Steven D'Aprano
On Wed, 05 Mar 2014 02:15:14 +, Albert van der Horst wrote: > Adding cf's adds all computable numbers in infinite precision. However > that is not even a drop in the ocean, as the computable numbers have > measure zero. On the other hand, it's not really clear that the non-computable numbers

Re: Working with the set of real numbers

2014-03-04 Thread Albert van der Horst
In article <87fvnm7q1n@elektro.pacujo.net>, Marko Rauhamaa wrote: >Chris Angelico : > >> On Fri, Feb 14, 2014 at 1:00 AM, Marko Rauhamaa wrote: >>> Well, if your idealized, infinite, digital computer had ℵ₁ bytes of RAM >>> and ran at ℵ₁ hertz and Python supported transfinite iterati

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-04 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Tue, Mar 4, 2014 at 1:45 PM, Albert van der Horst > wrote: >>>No, the Python built-in float type works with a subset of real numbers: >> >> To be more precise: a subset of the rational numbers, those with a >> denominator >> that is a power of two. > >And n

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-04 Thread Albert van der Horst
In article , Ian Kelly wrote: >On Mon, Mar 3, 2014 at 11:35 PM, Chris Angelico wrote: >> In constant space, that will produce the sum of two infinite sequences >> of digits. (And it's constant time, too, except when it gets a stream >> of nines. Adding three thirds together will produce an infin

Re: Working with the set of real numbers

2014-03-04 Thread Dave Angel
Oscar Benjamin Wrote in message: > On 4 March 2014 21:18, Chris Angelico wrote: > > > It does not take O(n*n) time. This is Newton iteration and for > well-behaved problems such as this it generates more than n digits > after n iterations. I modified my code to show the error (x**2 - y) at > ea

Re: Working with the set of real numbers

2014-03-04 Thread Chris Angelico
On Wed, Mar 5, 2014 at 9:54 AM, Oscar Benjamin wrote: >> Let's compare two >> versions. In the first, you set the precision (I'm talking in terms of >> REXX's "NUMERIC DIGITS" statement > > I have no idea what that is. > >>- anything beyond this many digits >> will be rounded (and represented expo

Re: Working with the set of real numbers

2014-03-04 Thread Oscar Benjamin
On 4 March 2014 22:18, Chris Angelico wrote: > On Wed, Mar 5, 2014 at 9:02 AM, Oscar Benjamin > wrote: >> On 4 March 2014 21:18, Chris Angelico wrote: >>> On Wed, Mar 5, 2014 at 7:55 AM, Oscar Benjamin >>> wrote: >>> >>> epsilon = 0.0001 >>> def sqrt(n): >>> guess1, guess2 = 1, n >>> wh

Re: Working with the set of real numbers

2014-03-04 Thread Chris Angelico
On Wed, Mar 5, 2014 at 9:02 AM, Oscar Benjamin wrote: > On 4 March 2014 21:18, Chris Angelico wrote: >> On Wed, Mar 5, 2014 at 7:55 AM, Oscar Benjamin >> wrote: >>> I don't quite follow your reasoning here. By "cut-and-try" do you mean >>> bisection? If so it gives the first N decimal digits in

Re: Working with the set of real numbers

2014-03-04 Thread Oscar Benjamin
On 4 March 2014 21:05, Marko Rauhamaa wrote: > Oscar Benjamin : > >> To me the obvious method is Newton iteration which takes O(sqrt(N)) >> iterations to obtain N digits of precision. This brings the above >> complexity below quadratic: >> >> #!/usr/bin/env python >> >> from decimal import Decimal

Re: Working with the set of real numbers

2014-03-04 Thread Oscar Benjamin
On 4 March 2014 21:18, Chris Angelico wrote: > On Wed, Mar 5, 2014 at 7:55 AM, Oscar Benjamin > wrote: >> I don't quite follow your reasoning here. By "cut-and-try" do you mean >> bisection? If so it gives the first N decimal digits in N*log2(10) >> iterations. However each iteration requires a m

Re: Working with the set of real numbers

2014-03-04 Thread Chris Angelico
On Wed, Mar 5, 2014 at 7:55 AM, Oscar Benjamin wrote: > I don't quite follow your reasoning here. By "cut-and-try" do you mean > bisection? If so it gives the first N decimal digits in N*log2(10) > iterations. However each iteration requires a multiply and when the > number of digits N becomes lar

Re: Working with the set of real numbers

2014-03-04 Thread Marko Rauhamaa
Oscar Benjamin : > To me the obvious method is Newton iteration which takes O(sqrt(N)) > iterations to obtain N digits of precision. This brings the above > complexity below quadratic: > > #!/usr/bin/env python > > from decimal import Decimal as D, localcontext > > def sqrt(y, prec=1000): > ''

Re: Working with the set of real numbers

2014-03-04 Thread Oscar Benjamin
On 4 March 2014 19:58, Chris Angelico wrote: > On Wed, Mar 5, 2014 at 6:49 AM, Marko Rauhamaa wrote: >> Chris Angelico : >> >>> As far as I know, there's no simple way, in constant space and/or >>> time, to progressively yield more digits of a number's square root, >>> working in decimal. >> >> I

Re: Working with the set of real numbers

2014-03-04 Thread Chris Angelico
On Wed, Mar 5, 2014 at 6:49 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> As far as I know, there's no simple way, in constant space and/or >> time, to progressively yield more digits of a number's square root, >> working in decimal. > > I don't know why the constant space/time requirement is

Re: Working with the set of real numbers

2014-03-04 Thread Marko Rauhamaa
Chris Angelico : > As far as I know, there's no simple way, in constant space and/or > time, to progressively yield more digits of a number's square root, > working in decimal. I don't know why the constant space/time requirement is crucial. Anyway, producing more digits simple: http://nrich.math

Re: Working with the set of real numbers

2014-03-04 Thread Chris Angelico
On Tue, Mar 4, 2014 at 10:05 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> In constant space, that will produce the sum of two infinite sequences >> of digits. > > > It's not constant space, because the nines counter > can grow infinitely large. Okay, okay, technically yes. But the count

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-04 Thread Ian Kelly
On Tue, Mar 4, 2014 at 4:19 AM, Ian Kelly wrote: > def cf_sqrt(n): > """Yield the terms of the square root of n as a continued fraction.""" >m = 0 > d = 1 > a = a0 = floor_sqrt(n) > while True: > yield a > next_m = d * a - m > next_d = (n - next_m * next

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-04 Thread Ian Kelly
On Mon, Mar 3, 2014 at 11:35 PM, Chris Angelico wrote: > In constant space, that will produce the sum of two infinite sequences > of digits. (And it's constant time, too, except when it gets a stream > of nines. Adding three thirds together will produce an infinite loop > as it waits to see if the

Re: Working with the set of real numbers

2014-03-04 Thread Gregory Ewing
Chris Angelico wrote: In constant space, that will produce the sum of two infinite sequences of digits. It's not constant space, because the nines counter can grow infinitely large. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-03 Thread Chris Angelico
On Tue, Mar 4, 2014 at 4:53 PM, Steven D'Aprano wrote: > On Tue, 04 Mar 2014 14:46:25 +1100, Chris Angelico wrote: > >> That's neat, didn't know that. Is there an efficient way to figure out, >> for any integer N, what its sqrt's CF sequence is? And what about the >> square roots of non-integers -

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-03 Thread Steven D'Aprano
On Tue, 04 Mar 2014 14:46:25 +1100, Chris Angelico wrote: > That's neat, didn't know that. Is there an efficient way to figure out, > for any integer N, what its sqrt's CF sequence is? And what about the > square roots of non-integers - can you represent √π that way? I suspect, > though I can't pr

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-03 Thread Rustom Mody
On Tuesday, March 4, 2014 9:16:25 AM UTC+5:30, Chris Angelico wrote: > On Tue, Mar 4, 2014 at 2:13 PM, Rustom Mody wrote: > >> But it's a far cry from "all real numbers". Even allowing for > >> continued fractions adds only some more; I don't think you can > >> represent surds that way. > > See >

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-03 Thread Chris Angelico
On Tue, Mar 4, 2014 at 2:13 PM, Rustom Mody wrote: >> But it's a far cry from "all real numbers". Even allowing for >> continued fractions adds only some more; I don't think you can >> represent surds that way. > > See > > http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/cfINTRO.html#s

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-03 Thread Rustom Mody
On Tuesday, March 4, 2014 8:32:01 AM UTC+5:30, Chris Angelico wrote: > On Tue, Mar 4, 2014 at 1:45 PM, Albert van der Horst wrote: > >>No, the Python built-in float type works with a subset of real numbers: > > To be more precise: a subset of the rational numbers, those with a > > denominator > >

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-03 Thread Chris Angelico
On Tue, Mar 4, 2014 at 1:45 PM, Albert van der Horst wrote: >>No, the Python built-in float type works with a subset of real numbers: > > To be more precise: a subset of the rational numbers, those with a denominator > that is a power of two. And no more than N bits (53 in a 64-bit float) in the

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-03-03 Thread Albert van der Horst
In article , Chris Angelico wrote: >On Wed, Feb 12, 2014 at 7:17 PM, Ben Finney wrote: >> Chris Angelico writes: >> >>> I have yet to find any computer that works with the set of real >>> numbers in any way. Never mind optimization, they simply cannot work >>> with real numbers. >> >> Not *any*

Re: Working with the set of real numbers

2014-02-14 Thread Devin Jeanpierre
On Fri, Feb 14, 2014 at 3:30 AM, Gregory Ewing 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 >> i

Re: Working with the set of real numbers

2014-02-14 Thread Grant Edwards
On 2014-02-14, Gregory Ewing wrote: > If it's a quantum computer, it may be able to execute > all branches of the iteration in parallel. But it > would only have a probability of returning the right > answer (in other cases it would kill your cat). I know somebody who would claim that _is_ the r

Re: Working with the set of real numbers

2014-02-14 Thread Rustom Mody
On Friday, February 14, 2014 12:14:31 PM UTC+5:30, Chris Angelico wrote: > Oh, that's fine, he's not my cat anyway. Go ahead, build it. Now Now! I figured you were the cat out here! -- https://mail.python.org/mailman/listinfo/python-list

Re: Working with the set of real numbers

2014-02-14 Thread Dave Angel
Chris Angelico Wrote in message: > On Fri, Feb 14, 2014 at 5:37 PM, Gregory Ewing >> >> >> If it's a quantum computer, it may be able to execute >> all branches of the iteration in parallel. But it >> would only have a probability of returning the right >> answer (in other cases it would kill yo

Re: Working with the set of real numbers

2014-02-14 Thread Gregory Ewing
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

Re: Working with the set of real numbers

2014-02-13 Thread Chris Angelico
On Fri, Feb 14, 2014 at 5:37 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> >> 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 >>

Re: Working with the set of real numbers

2014-02-13 Thread Gregory Ewing
Chris Angelico wrote: 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. If it's a quantum

Re: Working with the set of real numbers

2014-02-13 Thread Devin Jeanpierre
On Thu, Feb 13, 2014 at 11:47 AM, Marko Rauhamaa wrote: > Chris Angelico : > >> On Fri, Feb 14, 2014 at 1:00 AM, Marko Rauhamaa wrote: >>> Well, if your idealized, infinite, digital computer had ℵ₁ bytes of RAM >>> and ran at ℵ₁ hertz and Python supported transfinite iteration, you >>> could easi

Re: Working with the set of real numbers

2014-02-13 Thread Gregory Ewing
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

Re: Working with the set of real numbers

2014-02-13 Thread Marko Rauhamaa
Rotwang : > But my point was that it can't carry out those ℵ₁ discrete steps in > finite time (assuming that time is real-valued), because there's no > way to embed them in any time interval without changing their order. I'd have to think so I take your word for it. Marko -- https://mail.pytho

Re: Working with the set of real numbers

2014-02-13 Thread Rotwang
On 13/02/2014 22:00, Marko Rauhamaa wrote: Rotwang : 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 [...]

Re: Working with the set of real numbers

2014-02-13 Thread Marko Rauhamaa
Rotwang : >> 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 > > [...] > > More importantly, though, such

Re: Working with the set of real numbers

2014-02-13 Thread Rotwang
What's this? A discussion about angels dancing on a the head of a pin? Great, I'm in. On 13/02/2014 14:00, Marko Rauhamaa wrote: Oscar Benjamin : This isn't even a question of resource constraints: a digital computer with infinite memory and computing power would still be limited to working w

Re: Working with the set of real numbers

2014-02-13 Thread Chris Angelico
On Fri, Feb 14, 2014 at 6:47 AM, Marko Rauhamaa 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

Re: Working with the set of real numbers

2014-02-13 Thread Marko Rauhamaa
Chris Angelico : > On Fri, Feb 14, 2014 at 1:00 AM, Marko Rauhamaa 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)): > >

Re: Working with the set of real numbers

2014-02-13 Thread Chris Angelico
On Fri, Feb 14, 2014 at 1:00 AM, Marko Rauhamaa 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)): >

Re: Working with the set of real numbers

2014-02-13 Thread Ben Finney
Oscar Benjamin writes: > I think Chris' statement above is pretty clear. I disagree, as explained. > Also I didn't find the original statement confusing I'm happy for you. > and it is a reasonable point to make. Yes, and I was not addressing that. -- \ “It is well to remember tha

Re: Working with the set of real numbers

2014-02-13 Thread Marko Rauhamaa
Oscar Benjamin : > 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 > prev

Re: Working with the set of real numbers

2014-02-13 Thread Oscar Benjamin
On 12 February 2014 10:07, Ben Finney wrote: > Chris Angelico writes: > >> On Wed, Feb 12, 2014 at 7:56 PM, Ben Finney >> 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. [...

Re: Working with the set of real numbers

2014-02-12 Thread Chris Angelico
On Thu, Feb 13, 2014 at 2:31 PM, Steven D'Aprano wrote: > "The former South African apartheid government did not respect the > Universal Human Rights of blacks." > > Under your strict interpretation, we would have to say that even a single > example of the apartheid government respecting even a si

Re: Working with the set of real numbers

2014-02-12 Thread Ben Finney
Steven D'Aprano writes: > On Wed, 12 Feb 2014 21:07:04 +1100, Ben Finney wrote: > > > 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 > > w

Re: Working with the set of real numbers

2014-02-12 Thread Steven D'Aprano
On Wed, 12 Feb 2014 21:07:04 +1100, Ben Finney wrote: > Chris Angelico writes: > >> On Wed, Feb 12, 2014 at 7:56 PM, Ben Finney >> 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? >> >> Corr

Re: Working with the set of real numbers

2014-02-12 Thread Rustom Mody
On Thursday, February 13, 2014 2:15:28 AM UTC+5:30, Ian wrote: > On Wed, Feb 12, 2014 at 7:11 AM, Rustom Mody wrote: > > On Wednesday, February 12, 2014 3:37:04 PM UTC+5:30, Ben Finney wrote: > >> Chris Angelico writes: > >> > On Wed, Feb 12, 2014 at 7:56 PM, Ben Finney wrote: > >> > > So, if I u

Re: Working with the set of real numbers

2014-02-12 Thread Grant Edwards
On 2014-02-12, Gregory Ewing 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 la

Re: Working with the set of real numbers

2014-02-12 Thread Dave Angel
Gregory Ewing 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 numbe

Re: Working with the set of real numbers

2014-02-12 Thread Gregory Ewing
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]

Re: Working with the set of real numbers

2014-02-12 Thread Gregory Ewing
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 represent

Re: Working with the set of real numbers

2014-02-12 Thread Gregory Ewing
Ben Finney 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”. They actually work with a subset of *rational* numbers. All floats representable by a computer are ra

Re: Working with the set of real numbers

2014-02-12 Thread Ian Kelly
On Wed, Feb 12, 2014 at 7:11 AM, Rustom Mody wrote: > On Wednesday, February 12, 2014 3:37:04 PM UTC+5:30, Ben Finney wrote: >> Chris Angelico writes: > >> > On Wed, Feb 12, 2014 at 7:56 PM, Ben Finney wrote: >> > > So, if I understand you right, you want to say that you've not found >> > > a com

Re: Working with the set of real numbers

2014-02-12 Thread Chris Angelico
On Thu, Feb 13, 2014 at 1:13 AM, Marko Rauhamaa 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

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-02-12 Thread Gisle Vanem
"Grant Edwards" wrote: Not *any* computer? Not in *any* way? The Python built-in "float" type "works with the set of real numbers", in a way. The only people who think that are people who don't actualy _use_ floating point types on computers. FPU parsing the IEEE spec, or?. I didn't quite pa

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-02-12 Thread Grant Edwards
On 2014-02-12, Ben Finney wrote: > Chris Angelico writes: > >> I have yet to find any computer that works with the set of real >> numbers in any way. Never mind optimization, they simply cannot work >> with real numbers. > > Not *any* computer? Not in *any* way? The Python built-in "float" > type

Re: Working with the set of real numbers

2014-02-12 Thread Marko Rauhamaa
Chris Angelico : > On Wed, Feb 12, 2014 at 11:48 PM, Marko Rauhamaa wrote: >> According to your definition, there's no computer in the world that can >> work with integers or text files. > > Integers as far as RAM will allow, usually (which is the same caveat > as is used when describing a progra

Re: Working with the set of real numbers

2014-02-12 Thread Rustom Mody
On Wednesday, February 12, 2014 3:37:04 PM UTC+5:30, Ben Finney wrote: > Chris Angelico writes: > > On Wed, Feb 12, 2014 at 7:56 PM, Ben Finney 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. Ye

Re: Working with the set of real numbers

2014-02-12 Thread Chris Angelico
On Wed, Feb 12, 2014 at 11:48 PM, Marko Rauhamaa wrote: > Chris Angelico : > >> 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. In C, I can declare an 'int' variable, which can hold >> t

Re: Working with the set of real numbers

2014-02-12 Thread Marko Rauhamaa
Chris Angelico : > 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. In C, I can declare an 'int' variable, which can hold > the real number 4 - does that mean that that variable stores real

Re: Working with the set of real numbers

2014-02-12 Thread Chris Angelico
On Wed, Feb 12, 2014 at 10:44 PM, Ben Finney wrote: > Chris Angelico writes: > >> On Wed, Feb 12, 2014 at 9:07 PM, Ben Finney >> 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 l

Re: Working with the set of real numbers

2014-02-12 Thread Ned Batchelder
On 2/12/14 5:55 AM, wxjmfa...@gmail.com wrote: The fascinating aspect of this FSR lies in its mathematical absurdity. jmf Stop. -- Ned Batchelder, http://nedbatchelder.com -- https://mail.python.org/mailman/listinfo/python-list

Re: Working with the set of real numbers

2014-02-12 Thread Ben Finney
Chris Angelico writes: > On Wed, Feb 12, 2014 at 9:07 PM, Ben Finney > 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

Re: Working with the set of real numbers

2014-02-12 Thread wxjmfauth
The fascinating aspect of this FSR lies in its mathematical absurdity. jmf -- https://mail.python.org/mailman/listinfo/python-list

Re: Working with the set of real numbers

2014-02-12 Thread Chris Angelico
On Wed, Feb 12, 2014 at 9:07 PM, Ben Finney wrote: > Chris Angelico writes: > >> On Wed, Feb 12, 2014 at 7:56 PM, Ben Finney >> 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

Re: Working with the set of real numbers

2014-02-12 Thread Ben Finney
Chris Angelico writes: > On Wed, Feb 12, 2014 at 7:56 PM, Ben Finney > 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 > nu

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-02-12 Thread Jussi Piitulainen
Chris Angelico writes: > On Wed, Feb 12, 2014 at 7:17 PM, Ben Finney wrote: > > What specific behaviour would, for you, qualify as “works with the > > set of real numbers in any way”? > > Being able to represent surds, pi, e, etc, for a start. It'd > theoretically be possible with an algebraic not

Re: Working with the set of real numbers

2014-02-12 Thread Chris Angelico
On Wed, Feb 12, 2014 at 7:56 PM, Ben Finney 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. When jmf referred to real numbers, he implied that there are no optimizations done for natural n

Re: Working with the set of real numbers

2014-02-12 Thread Ben Finney
Chris Angelico writes: > On Wed, Feb 12, 2014 at 7:17 PM, Ben Finney > wrote: > > Chris Angelico writes: > > > >> I have yet to find any computer that works with the set of real > >> numbers in any way. Never mind optimization, they simply cannot > >> work with real numbers. > > > > Not *any*

Re: Working with the set of real numbers

2014-02-12 Thread Ben Finney
wxjmfa...@gmail.com writes: > (2) is an artificial construct working > with 3 sets (unicode). jmf, you are being exceedingly disruptive: attempting to derail unrelated discussions for your favourite hobby-horse topic. Please stop. Everyone else: Please don't engage these attempts; instead, avoid

Re: Working with the set of real numbers (was: Finding size of Variable)

2014-02-12 Thread wxjmfauth
Le mercredi 12 février 2014 09:35:38 UTC+1, wxjm...@gmail.com a écrit : > Integers are integers. (1) > > Characters are characters. (2) > > > > (1) is a unique "natural" set. > > > > (2) is an artificial construct working > > with 3 sets (unicode). > > > > jmf Addendum: One should not c

  1   2   >