Prev: FindInstance Problem
Next: Persistent assumption
From: Noqsi on 6 Jan 2010 05:59 On Jan 4, 11:46 pm, DrMajorBob <btre...(a)austin.rr.com> wrote: > Computer reals are precisely equal to, No. Computer reals are imprecise. That's the source of their utility. And their difficulties. > and in one-to-one correspondence > with, a miniscule subset of the rationals. Every one of them has a finite > binary expansion. This proves only that they are contained within a finite set. But it makes much more sense to consider the correspondence as one-to- uncountably-many: each individual machine real represents every real number within an interval determined by its precision. Except for those that don't represent numbers at all. > > x = RandomReal[] > digitForm = RealDigits@x; > Length(a)First@digitForm > rationalForm = FromDigits(a)digitForm > {n, d} = Through[{Numerator, Denominator}@rationalForm] > d x == n > > 0.217694 > > 16 > > 1088471616079187/5000000000000000 > > {1088471616079187, 5000000000000000} > > True Proves nothing. 0.1 == 1/10 True Now, 1/10 is *not* a member of the "miniscule subset of rationals" you referred to above, and the machine number 0.1 does not precisely represent it: RealDigits[0.1,2] {{1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,1,0},-3} Note that the representation is finite and the last two bits reflect rounding. Nevertheless, the machine manages to create a representation of 0.1, and even reports it to be equal to 1/10. Now, if machine reals behaved as if they were "precisely equal to ... a miniscule subset of rationals" neither of these achievements would be possible. Their imprecision makes this possible. > > A number can't get more rational or algebraic (solving a FIRST degree > polynomial with integer coefficients) than that. All you've done is to find a number with that property equal to x within machine precision. But since there is, in fact, an infinite set of such numbers, finding one isn't remarkable. > > If computer reals are THE reals, I never said they were. Go back and read what I wrote. > why is it that RandomReal[{3,4}] can > never return Pi, Sqrt[11], or ANY irrational? Well, I'm not patient enough for RandomReal[{3,4}]. But, Map[Pi==#&,RandomReal[{3.14159265358970,3.14159265358980},10]] {False,True,False,False,False,True,False,True,False,False} Seems we can easily get Pi from RandomReal. And no, I'm not cheating: the numbers that yielded True here are equal to Pi in the only sense that matters with an imprecise number: they are equal to Pi within their precision. Bobby, you're looking at how machine reals are *encoded*, and a *subset* of them is encoded as if they were precise rationals, as you say. But what matters is how they *behave*. They do not generally behave like precise rationals: they behave imprecisely. And what rational number does a NaN encode? Rational addition and multiplication are associative, but machine real arithmetic isn't. Rational arithmetic is distributive, but machine real arithmetic isn't. etc. Machine reals are not the reals or the rationals: they are themselves, with their own special properties. Those who reason as if machine reals are either real or rational often suffer adverse consequences. Much of the art of numerical analysis depends upon understanding these special properties and their consequences.
From: Andrzej Kozlowski on 6 Jan 2010 06:01 Just one more comment, I hope my last one on this subject. Obviously RandomReal make it choices out of a countable set of entities. One would have to be insane to claim otherwise and I am not that yet. But, Mathematica does not regard these entities as rational numbers and so they are not that. If you call them rationals the it does not make *mathematical* sense (because rationals have measure 0). So, if Mathemaitca does not regard them as rationals they are not rationals. How could they be that ? Until they are interpreted by Mathematica, they are not numbers at all but just some data stored in computer memory - which are not numbers of any kind. Mathematica interprets them as non-computable irrationals in order to make mathematical sense when returning them while simulation a real distribution, because all other numbers have measure 0. This is all about "simulating mathematics" - numbers do not live in any sense inside computers. To say that "all computer numbers are rational" is weird - there is no such things as "computer numbers". Numbers exist only and (probably) exclusively in the human mind. To say that 1.2 is rational in Mathematica even if Mathematica says Element[1.2, Rationals] False does not make any sense at all. Andrzej Kozlowski On 6 Jan 2010, at 07:04, Andrzej Kozlowski wrote: > Well, you are obviously misunderstanding what I am trying to explain but I have no desire to spend any more time on it. I give up. > > Perhaps you should try to explain yourself why Mathematica gives > > In[1]:= Element[1.2, Rationals] > > Out[1]= False > > In[2]:= Element[1.2, Reals] > > Out[2]= True > > and you might also read > > http://en.wikipedia.org/wiki/Computable_number > > (but that's the last time I posting anything to do with any logic or mathematics here.) > > Andrzej Kozlowski > > > > > > On 5 Jan 2010, at 22:31, DrMajorBob wrote: > >> RandomReal[] returns numbers from a countable set of rationals. >> >> Or call them reals, if you must; it still selects from a countable set of possibilities... not from the uncountable unit interval in the reals. >> >> The range of RandomReal[] is a set of measure zero, just like the algebraic numbers. >> >> Bobby >> >> On Tue, 05 Jan 2010 02:08:24 -0600, Andrzej Kozlowski <akoz(a)mimuw.edu.pl> wrote: >> >>> >>> On 5 Jan 2010, at 15:47, DrMajorBob wrote: >>> >>>> If computer reals are THE reals, why is it that RandomReal[{3,4}] can >>>> never return Pi, Sqrt[11], or ANY irrational? >>> >>> It can't possibly do that because these are computable real numbers the set of computable real numbers if countable and has measure 0. Computable numbers can never be the outcome of any distribution that selects numbers randomly from a real interval. >>> >>> The most common mistake people make about real numbers is to think that numbers such as Sqrt[2] or Pi as being in some sense typical examples of an irrational number or a transcendental number but they are not. They are very untypical because they are computable: that is, there exists a formula for computing as many of their digits as you like. But we can prove that the set of all reals with this property is countable and of measure 0. So Sqrt[2] is a very untypical irrational and Pi a very untypical transcendental. So what do typical real look like? Well, I think since a "typical" real is not computable we cannot know all of its digits and we cannot know any formula for computing them. But we can know a finite number of these digits. So this looks to me very much like the Mathematica concept of Real - you know a specified number of significant digits and you know that there are infinitely many more than you do not know. It seems to me the most natural way to think about non-computable reals. >>> >>> Roger Penrose, by the way, is famous for arguing that our brain is somehow able to work with non-computable quantities, although of course not by using digital expansions. But this involves quantum physics and has been the object of a heated dispute since the appearance of "The emperor's New Mind". >>> >> >> >> -- >> DrMajorBob(a)yahoo.com >
From: Andrzej Kozlowski on 6 Jan 2010 06:02 On 6 Jan 2010, at 07:39, Andrzej Kozlowski wrote: > Just one more comment, I hope my last one on this subject. Obviously RandomReal make it choices out of a countable set of entities. One would have to be insane to claim otherwise and I am not that yet. > In fact, of course, not even countable but finite. But this is all beside the point for the important thing is not what these things *are* but what Mathematica interpret them as. Even finite state automata can simulate distributions defined on real intervals where "essentially everything" consists of non-comptable reals.
From: DrMajorBob on 6 Jan 2010 06:02 I've always told people, "I test smarter than I really am," and now I see... I was right! But not because I worked hard or my parents got involved in my schoolwork, as the New Yorker article suggests. At least, I didn't think so, until I thought about it some more and came up with some factoids: a) My grandmother bought me comic books... and I READ them. b) I participated in summer reading programs at the local library (voluntarily). c) My mother coached me for spelling bees, twice. d) She took dictation for my history notebook one summer when I (voluntarily) went to summer school. e) Nobody told me math was hard, that I can remember. f) Comics led me to science fiction, which I read like a house on fire. So the article makes more sense than I originally thought. Highly recommended. Thanks for the link! Bobby On Tue, 05 Jan 2010 00:44:27 -0600, Noqsi <jpd(a)noqsi.com> wrote: > On Jan 4, 4:00 am, DrMajorBob <btre...(a)austin.rr.com> wrote: >> > The issue here is >> > whether the student has enough common culture with the test writer to >> > find the same answer. And that's *always* an issue. >> >> So those are cultural conformity questions?!? > > One might not need to conform, but one must at least understand the > culture. Mathematics is a human cultural artifact, and students are > going to need to understand some things about that artifact and its > expression to be successful in college. > > Specifically in this case series are often presented as specific terms > and ellipsis, judged to be easier to comprehend in some ways than a > formula, so the student should be able to comprehend that form. > > And this continues into professional life. Today I'm looking over the > specs of a megapixel image sensor. The drawings that document its > structure contain "..." in a number of places: it's not practical to > show every pixel! I can, of course, think of all kinds of perverse and > stupid ways to misunderstand what's omitted, but that wouldn't be > helpful in any way. > >> >> That's even worse than I thought! > > It's still worse. The intentions behind the widespread adoption of the > SAT didn't really address the need to establish that the student could > comprehend the academic cultural context: instead, they were > consciously bigoted. > > http://www.newyorker.com/archive/2001/12/17/011217crat_atlarge > >> >> Bobby >> >> >> >> On Sun, 03 Jan 2010 02:40:36 -0600, Noqsi <j...(a)noqsi.com> wrote: >> > On Jan 2, 3:05 am, DrMajorBob <btre...(a)austin.rr.com> wrote: >> >> When I clicked on the link below, the search field was already >> filled = > >> >> with >> >> the sequence >> >> >> target = {1, 2, 3, 6, 11, 23, 47, 106, 235}; >> >> >> Searching yielded "A000055 Number of trees with n unla= > beled >> >> nodes." >> >> >> I tried a few Mathematica functions on it: >> >> >> FindLinearRecurrence(a)target >> >> >> FindLinearRecurrence[{1, 2, 3, 6, 11, 23, 47, 106, 235}] >> >> >> (fail) >> >> >> FindSequenceFunction(a)target >> >> >> FindSequenceFunction[{1, 2, 3, 6, 11, 23, 47, 106, 235}] >> >> >> (fail) >> >> >> f[x_] = InterpolatingPolynomial[target, x] >> >> >> 1 + (1 + (1/ >> >> 3 + (-(1/ >> >> 12) + (7/ >> >> 120 + (-(1/ >> >> 60) + (1/144 - (41 (-8 + x))/20160= > ) (-7 + x)) (-6 + >> >> x)) (-5 + x)) (-4 + x)) (-3 + x) (-= > 2 + x)) (-1 + x) >> >> >> and now the next term: >> >> >> Array[f, 1 + Length(a)target] >> >> >> {1, 2, 3, 6, 11, 23, 47, 106, 235, 322} >> >> >> But, unsurprisingly, the next term in A000055 is 551, not 322. >> >> >> A000055 actually starts with another three 1s, but that doesn't >> change >> >> things much: >> >> >> target = {1, 1, 1, 1, 2, 3, 6, 11, 23, 47, 106, 235}; >> >> >> FindLinearRecurrence(a)target >> >> >> FindLinearRecurrence[{1, 1, 1, 1, 2, 3, 6, 11, 23, 47, 106, 235}] >> >> >> (fail) >> >> >> FindSequenceFunction(a)target >> >> >> FindSequenceFunction[{1, 1, 1, 1, 2, 3, 6, 11, 23, 47, 106, 235}] >> >> >> (fail) >> >> >> f[x_] = InterpolatingPolynomial[target, x] >> >> >> 1 + (1/24 + (-(1/ >> >> 40) + (1/ >> >> 90 + (-(1/ >> >> 280) + (1/ >> >> 1008 + (-(43/ >> >> 181440) + (191/3628800 - (4= > 37 (-11 + x))/ >> >> 39916800) (-10 + x)) (-9 + = > x)) (-8 + x)) (-7 + >> >> x)) (-6 + x)) (-5 + x)) (-4 + x) (-3 + x) = > (-2 + x) (-1 + >> >> x) >> >> >> Array[f, 1 + Length(a)target] >> >> >> {1, 1, 1, 1, 2, 3, 6, 11, 23, 47, 106, 235, -502} >> >> >> So I ask you, from the data alone: what's the next term? >> >> > It's the sort of question where one might expect a specialist to >> > recognize a familiar sequence. It's all context. >> >> > Consider that in a narrow mathematical sense, spectroscopy is an >> > utterly ambiguous, "ill conditioned" problem. But show me a gigagauss >> > cyclotron spectrum, and I'll recognize it as such (see the >> > acknowledgment at the end of arxiv.org/pdf/astro-ph/0306189: the >> > authors were struggling to contrive an interpretation from atomic >> > physics before one of them showed the spectrum to me). But I expect >> > very few could do this, since few have the background. >> >> >> If one had the Encyclopedia of Integer Sequences handy, those SAT >> >> questions could be interesting. But they'd still be nonsense. >> >> > No they are not. Remember that the SAT isn't about the ability of a >> > student to function in some ideal abstract world of infinite >> > possibility. In the real world of academia, every single question they >> > will encounter will be ambiguous in some sense. The issue here is >> > whether the student has enough common culture with the test writer to >> > find the same answer. And that's *always* an issue. >> >> >> Bobby >> >> >> On Fri, 01 Jan 2010 04:32:58 -0600, Noqsi <j...(a)noqsi.com> wrote: >> >> > On Dec 31, 1:16 am, DrMajorBob <btre...(a)austin.rr.com> wrote: >> >> >> >> This is a little like those idiotic SAT and GRE questions that ask >> >> >> "What's >> >> >> the next number in the following series?"... where any number >> will = > >> >> do. >> >> >> Test writers don't seem to know there's an interpolating >> polynomial= > >> >> (for >> >> >> instance) to fit the given series with ANY next element. >> >> >> > Explanations in terms of epicycles may be mathematically adequate >> in= > a >> >> > narrow sense, but an explanation in terms of a single principle >> >> > applied repeatedly is to be preferred in science. The ability to >> >> > recognize such a principle is important. >> >> >> > And my mathematical logician son (who's looking over my shoulder) >> >> > directed me tohttp://www.research.att.com/~njas/sequences/for >> >> > research on this topic. When he encounters such a sequence in his >> >> > research, he finds that knowledge of a simple genesis for the >> sequen= > ce >> >> > can lead to further insight. >> >> >> -- >> >> DrMajor...(a)yahoo.com >> >> -- >> DrMajor...(a)yahoo.com > > -- DrMajorBob(a)yahoo.com
From: DrMajorBob on 6 Jan 2010 06:02
I completely understand that Mathematica considers 1.2 Real, not Rational... but that's a software design decision, not an objective fact. If we consider something that's not representable in binary, it even makes a kind of sense: RealDigits[1/3.] {{3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}, 0} But 1.2 _is_ representable in binary, that's the way it is represented in the computer, and there's no doubt about the digits, whatsoever: RealDigits[1.2] {{1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 1} Even 1/3. and Sqrt[2.] are stored as members of a countable set of rationals... and representations of that sort are countable themselves (since they're all algebraic). But... I agree there's no point debating it. Bobby On Tue, 05 Jan 2010 16:04:20 -0600, Andrzej Kozlowski <akoz(a)mimuw.edu.pl> wrote: > Well, you are obviously misunderstanding what I am trying to explain > but I have no desire to spend any more time on it. I give up. > > Perhaps you should try to explain yourself why Mathematica gives > > In[1]:= Element[1.2, Rationals] > > Out[1]= False > > In[2]:= Element[1.2, Reals] > > Out[2]= True > > and you might also read > > http://en.wikipedia.org/wiki/Computable_number > > (but that's the last time I posting anything to do with any logic or > mathematics here.) > > Andrzej Kozlowski > > > > > > On 5 Jan 2010, at 22:31, DrMajorBob wrote: > >> RandomReal[] returns numbers from a countable set of rationals. >> >> Or call them reals, if you must; it still selects from a countable set >> of possibilities... not from the uncountable unit interval in the reals. >> >> The range of RandomReal[] is a set of measure zero, just like the >> algebraic numbers. >> >> Bobby >> >> On Tue, 05 Jan 2010 02:08:24 -0600, Andrzej Kozlowski >> <akoz(a)mimuw.edu.pl> wrote: >> >>> >>> On 5 Jan 2010, at 15:47, DrMajorBob wrote: >>> >>>> If computer reals are THE reals, why is it that RandomReal[{3,4}] can >>>> never return Pi, Sqrt[11], or ANY irrational? >>> >>> It can't possibly do that because these are computable real numbers >>> the set of computable real numbers if countable and has measure 0. >>> Computable numbers can never be the outcome of any distribution that >>> selects numbers randomly from a real interval. >>> >>> The most common mistake people make about real numbers is to think >>> that numbers such as Sqrt[2] or Pi as being in some sense typical >>> examples of an irrational number or a transcendental number but they >>> are not. They are very untypical because they are computable: that is, >>> there exists a formula for computing as many of their digits as you >>> like. But we can prove that the set of all reals with this property is >>> countable and of measure 0. So Sqrt[2] is a very untypical irrational >>> and Pi a very untypical transcendental. So what do typical real look >>> like? Well, I think since a "typical" real is not computable we cannot >>> know all of its digits and we cannot know any formula for computing >>> them. But we can know a finite number of these digits. So this looks >>> to me very much like the Mathematica concept of Real - you know a >>> specified number of significant digits and you know that there are >>> infinitely many more than you do not know. It seems to me the most >>> natural way to think about non-computable reals. >>> >>> Roger Penrose, by the way, is famous for arguing that our brain is >>> somehow able to work with non-computable quantities, although of >>> course not by using digital expansions. But this involves quantum >>> physics and has been the object of a heated dispute since the >>> appearance of "The emperor's New Mind". >>> >> >> >> -- >> DrMajorBob(a)yahoo.com > -- DrMajorBob(a)yahoo.com |