Dr. Dobb's Python-URL! - weekly Python news and links (Mar 17)

Steven Taschuk staschuk at telusplanet.net
Thu Mar 20 15:06:09 EST 2003


Quoth mcherm at mcherm.com:
  [...]
> Indeed... that's part of what I find interesting about it. Normality
> seems a sensible thing to define on numbers (and every definition I've
> seen so far has proported to define it as a property of numbers) -- 
> until you encounter this and realize it's REALLY a property of symbol
> sequences, which do NOT have a simple, obvious, one-to-one mapping
> to (all) real numbers.

Don't they?  Provided we're speaking of positional systems with
integer base, of course.  Just choose either infinite zeroes or
infinite (b-1)s.  In either case, integers (and other numbers with
terminating expansions in base b) are not b-normal, so it doesn't
matter which; for purposes of determining normality, positional
systems *do* provide unique representations.

Regardless, I think getting integers to be normal in base 2
requires more work than simply counting both representations.  If
I understand the concept correctly, normality requires not merely
equal distribution of each digit, but also equal distribution of
all 2-sequences of digits, 3-sequences of digits, etc..  *That* is
not achieved by simply counting both representations; instead you
need to mix them somehow, and the result of such a mixing would
not in general actually be a representation of the original
integer, as far as I can see.

  [...]
> class IrrationalNumber:
>     """Actual irrational numbers should subclass this and implement
>     the iterDigits() method."""

I particularly like this line:

>                 if count != digitCount[0]///Infinity:

I look forward to reading in the documentation of Python 4000 the
definition of this '///'.

(Incidentally, iterable numbers make good sense if you're using
Gosper's algorithms for continued (fraction|logarithm) arithmetic.)

-- 
Steven Taschuk                                     staschuk at telusplanet.net
Receive them ignorant; dispatch them confused.  (Weschler's Teaching Motto)





More information about the Python-list mailing list