> 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*.
If RootApproximant@RandomReal[] succeeds, that random number is algebraic,
according to Mathematica... yes or no?
RootApproximant@RandomReal[]
Root[3 - #1 - #1^3 - #1^4 - 4 #1^5 + 4 #1^6 - 2 #1^7 +
2 #1^8 + #1^9 + #1^10 - 2 #1^11 - 2 #1^12 + #1^14 &, 1]
(It succeeds every time, as far as I can tell.)
Does that constitute behaving like an algebraic number?
Bobby
On Wed, 06 Jan 2010 04:59:52 -0600, Noqsi <jpd at noqsi.com> wrote:
> On Jan 4, 11:46 pm, DrMajorBob <btre... at 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@First@digitForm
>> rationalForm = FromDigits@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.
>
--
DrMajorBob at yahoo.com