Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

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

0 views
Skip to first unread message

Mike Meyer

unread,
Mar 17, 2003, 8:08:57 AM3/17/03
to
QOTW: "We will perhaps eventually be writing only small modules which are
identified by name as they are used to build larger ones, so that devices
like indentation, rather than delimiters, might become feasible for
expressing local structure in the source language." --Donald E. Knuth,
"Structured Programming with goto Statements", Computing Surveys, Vol 6
No 4, Dec. 1974

"I never got beyond starting the data-structures in C++, I never got
beyond seeing how it would work in Scheme. I finished it in one
Python-filled afternoon, and discovered the idea sucked big time. I was
glad I did it in Python, because it only cost me one afternoon to discover
the idea sucks." -- Moshe Zadka,


Discussion:
It seems several people are working on animated debuggers for Python.
http://groups.google.com/groups?selm=9s7ba.2698%244q6....@news20.bellglobal.com

A comment by Guido on the dev list sparks a discussion on the
distinction between lists and tuples, and the proper uses for
same.
http://groups.google.com/groups?selm=mailman.104743802...@python.org

The question of how to move large data through a non-blocking
socket efficiently is asked, and answered.
http://groups.google.com/groups?selm=b4sc7c%24nel%2...@localhost.localdomain

The standard question about floating point accuracy wanders into
which bases are best for representing fractions.
http://groups.google.com/groups?selm=4378fa6f.0303...@posting.google.com

A comparison of single-user databases results from a question of
the same.
http://groups.google.com/groups?selm=3E737FA3...@easystreet.com


Announcements:
wxPython 2.4.0.5 is a cross platform GUI toolkit.
http://wxPython.org/

twander 3.134 is a macro-programmable file system browser.
http://www.tundraware.com/Software/twander

Eric 3.1 is a Python IDE.
http://www.die-offenbachs.de/detlev/eric3.html

omniORB 4.0.1 and omniORBpy 2.1 are high performance CORBA ORBs and
a python interface to the same.
http://omniorb.sourceforge.net/


========================================================================

Everything you want is probably one or two clicks away in these pages:

Python.org's Python Language Website is the traditional
center of Pythonia
http://www.python.org
Notice especially the master FAQ
http://www.python.org/doc/FAQ.html

PythonWare complements the digest you're reading with the
daily python url
http://www.pythonware.com/daily
Mygale is a news-gathering webcrawler that specializes in (new)
World-Wide Web articles related to Python.
http://www.awaretek.com/nowak/mygale.html
While cosmetically similar, Mygale and the Daily Python-URL
are utterly different in their technologies and generally in
their results.

comp.lang.python.announce announces new Python software. Be
sure to scan this newly-revitalized newsgroup at least weekly.
http://groups.google.com/groups?oi=djq&as_ugroup=comp.lang.python.announce

Brett Cannon continues the marvelous tradition established by
Andrew Kuchling and Michael Hudson of summarizing action on the
python-dev mailing list once every other week.
http://www.python.org/dev/summary/

The Python Package Index catalogues packages.
http://www.python.org/pypi/

The somewhat older Vaults of Parnassus ambitiously collects references
to all sorts of Python resources.
http://www.vex.net/~x/parnassus/

Much of Python's real work takes place on Special-Interest Group
mailing lists
http://www.python.org/sigs/

The Python Business Forum "further[s] the interests of companies
that base their business on ... Python."
http://www.python-in-business.org

The Python Software Foundation has replaced the Python Consortium
as an independent nexus of activity
http://www.python.org/psf/

Cetus does much of the same
http://www.cetus-links.org/oo_python.html

Python FAQTS
http://python.faqts.com/

The old Python "To-Do List" now lives principally in a
SourceForge reincarnation.
http://sourceforge.net/tracker/?atid=355470&group_id=5470&func=browse
http://python.sourceforge.net/peps/pep-0042.html

The online Python Journal is posted at pythonjournal.cognizor.com.
edi...@pythonjournal.com and edi...@pythonjournal.cognizor.com
welcome submission of material that helps people's understanding
of Python use, and offer Web presentation of your work.

*Py: the Journal of the Python Language*
http://www.pyzine.com

Tenth International Python Conference
http://www.python10.org

Archive probing tricks of the trade:
http://groups.google.com/groups?oi=djq&as_ugroup=comp.lang.python&num=100
http://groups.google.com/groups?meta=site%3Dgroups%26group%3Dcomp.lang.python.*

Previous - (U)se the (R)esource, (L)uke! - messages are listed here:
http://www.ddj.com/topics/pythonurl/
http://purl.org/thecliff/python/url.html (dormant)
or
http://groups.google.com/groups?oi=djq&as_q=+Python-URL!&as_ugroup=comp.lang.python


Suggestions/corrections for next week's posting are always welcome.
E-mail to <Pytho...@phaseit.net> should get through.

To receive a new issue of this posting in e-mail each Monday morning
(approximately), ask <cla...@phaseit.net> to subscribe. Mention
"Python-URL!".


-- The Python-URL! Team--

Dr. Dobb's Journal (http://www.ddj.com) is pleased to participate in and
sponsor the "Python-URL!" project.

Peter Hansen

unread,
Mar 17, 2003, 9:02:28 AM3/17/03
to
Mike Meyer wrote:
>
> QOTW: "We will perhaps eventually be writing only small modules which are
> identified by name as they are used to build larger ones, so that devices
> like indentation, rather than delimiters, might become feasible for
> expressing local structure in the source language." --Donald E. Knuth,
> "Structured Programming with goto Statements", Computing Surveys, Vol 6
> No 4, Dec. 1974

Wait a sec... think about that for a minute. Is he saying that one
will be able just to list a simple series of commands which draw on
functionality defined in specialized, application-specific modules?

That the resulting language will be so high level that, for the most
part, control flow and complicated nested structures will be unnecessary?

That you might even get by without squiggly brackets and semicolons and
all that jazz because your command set has become so simple, allowing a
convention as simple as *indentation* to be used to define structure?

Wow... sounds almost like...

Autocoding!

-this-post-brought-to-you-by-the-ruebot's-absence-ly y'rs, Peter

Michael Hudson

unread,
Mar 17, 2003, 9:26:13 AM3/17/03
to
Peter Hansen <pe...@engcorp.com> writes:

> Mike Meyer wrote:
> >
> > QOTW: "We will perhaps eventually be writing only small modules which are
> > identified by name as they are used to build larger ones, so that devices
> > like indentation, rather than delimiters, might become feasible for
> > expressing local structure in the source language." --Donald E. Knuth,
> > "Structured Programming with goto Statements", Computing Surveys, Vol 6
> > No 4, Dec. 1974
>
> Wait a sec... think about that for a minute. Is he saying that one
> will be able just to list a simple series of commands which draw on
> functionality defined in specialized, application-specific modules?
>
> That the resulting language will be so high level that, for the most
> part, control flow and complicated nested structures will be unnecessary?

93. When someone says "I want a programming language in which I
need only say what I wish done," give him a lollipop.
-- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html

Cheers,
M.

--
C++ is a siren song. It *looks* like a HLL in which you ought to
be able to write an application, but it really isn't.
-- Alain Picard, comp.lang.lisp

Robin Becker

unread,
Mar 17, 2003, 9:54:44 AM3/17/03
to
In article <7h31y16...@pc150.maths.bris.ac.uk>, Michael Hudson
<m...@python.net> writes
..
.....

>ll be unnecessary?
>
>93. When someone says "I want a programming language in which I
> need only say what I wish done," give him a lollipop.
> -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html
>
>Cheers,
>M.
>
well I guess we could say everything is encoded in pi so we should just
say pi (or e or any other transcendental ..........zzzzz)
--
Robin Becker

Peter Hansen

unread,
Mar 17, 2003, 12:11:14 PM3/17/03
to

Ah, you've been reading Contact again, haven't you? :-)

Erik Max Francis

unread,
Mar 17, 2003, 6:30:58 PM3/17/03
to
Robin Becker wrote:

> well I guess we could say everything is encoded in pi so we should
> just
> say pi (or e or any other transcendental ..........zzzzz)

Only if pi is normal, which hasn't yet been proved (although it is
strongly suspected).

--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ It is human nature to think wisely and act foolishly.
\__/ Anatole France
Church / http://www.alcyone.com/pyos/church/
A lambda calculus explorer in Python.

Erik Max Francis

unread,
Mar 17, 2003, 6:33:24 PM3/17/03
to
Peter Hansen wrote:

> Ah, you've been reading Contact again, haven't you? :-)

Probably just that pi is normal:

http://mathworld.wolfram.com/NormalNumber.html

It has not been proven that pi is normal, but it is strongly suspected.
If it's normal, then every finite sequence of digits in any base _does_
appear with the expected frequency.

Greg Ewing (using news.cis.dfn.de)

unread,
Mar 17, 2003, 10:49:59 PM3/17/03
to
Erik Max Francis wrote:
> It has not been proven that pi is normal, but it is strongly suspected.
> If it's normal, then every finite sequence of digits in any base _does_
> appear with the expected frequency.

Okay, for my next program I'll just use
pi[479832797692707213:479832797692783208].

Beats-me-what-it'll-do-though,

--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg

Peter Hansen

unread,
Mar 17, 2003, 10:57:21 PM3/17/03
to
Erik Max Francis wrote:
>
> Peter Hansen wrote:
>
> > Ah, you've been reading Contact again, haven't you? :-)
>
> Probably just that pi is normal:
>
> http://mathworld.wolfram.com/NormalNumber.html
>
> It has not been proven that pi is normal, but it is strongly suspected.
> If it's normal, then every finite sequence of digits in any base _does_
> appear with the expected frequency.

But it's irrational, right? So irrationality is now defined as normal?
Great... makes my life easier. ;-)

-around-here-rhubarb-pi-is-unusual-but-still-welcome-ly y'rs,
Peter

Erik Max Francis

unread,
Mar 17, 2003, 11:07:40 PM3/17/03
to
Peter Hansen wrote:

> But it's irrational, right? So irrationality is now defined as
> normal?

No. Irrational does not necessarily imply normal. Take for instance
the irrational number (decimal expansion):

0.1010010001000010000010000001...

This number does not terminate and does not repeat, so therefore it is
irrational. However, it clearly does not have a normal distribution for
all digits (or indeed even for the only two decimal digits which
appear). Thus it is irrational, but not normal.

--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE

/ \ In wildness is the preservation of the world.
\__/ Henry David Thoreau
Kepler's laws / http://www.alcyone.com/max/physics/kepler/
A proof of Kepler's laws.

Erik Max Francis

unread,
Mar 17, 2003, 11:10:36 PM3/17/03
to
"Greg Ewing (using news.cis.dfn.de)" wrote:

> Okay, for my next program I'll just use
> pi[479832797692707213:479832797692783208].

Normal doesn't quite mean random; the Champernowne constant
(0.123456789101112...) is proven to be normal, for instance, but it is
hardly what one would consider random. I don't know if choosing very
large indexes into the Champernowne's decimal expansion would be
considered sufficiently random; I suppose it would.

But, as I said, in any case, pi is _suspected_ of being normal, but it
is not yet known to be.

--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE

/ \ Sometimes there's no point in giving up.
\__/ Louis Wu
Blackgirl International / http://www.blackgirl.org/
The Internet resource for black women.

Peter Hansen

unread,
Mar 17, 2003, 11:21:39 PM3/17/03
to
Erik Max Francis wrote:
>
> Peter Hansen wrote:
>
> > But it's irrational, right? So irrationality is now defined as
> > normal?
>
> No. Irrational does not necessarily imply normal. Take for instance
> the irrational number (decimal expansion):
[snip]

Sorry, I missed a smiley. Also probably should have said something
closer to "so irrationality can be normal in some cases?"... I was
trying, poorly, to make a joke. :-) (I.e. I understand about
irrational/normal etc...)

Cheers,
-Peter

Greg Ewing (using news.cis.dfn.de)

unread,
Mar 18, 2003, 7:43:40 PM3/18/03
to
Erik Max Francis wrote:
> But, as I said, in any case, pi is _suspected_ of being normal, but it
> is not yet known to be.

Just out of curiosity, has any other irrational
number (other than ones specially constructed to
be so) been proved normal?

And what are the grounds for suspecting pi to
be normal? Is it just "we don't have any particular
reason to think it isn't", or is there more to
it?

Cheerfully-getting-further-and-further-off-topic-ly,

Erik Max Francis

unread,
Mar 18, 2003, 8:14:50 PM3/18/03
to
"Greg Ewing (using news.cis.dfn.de)" wrote:

> Just out of curiosity, has any other irrational
> number (other than ones specially constructed to
> be so) been proved normal?

Nope, the only numbers known to be absolutely normal are the
artificially constructed ones like Champernowne or the Copeland-Erdos
constant (which is constructed similarly to the Champernowne constant,
except by concatenating primes instead of the positive numbers). There
are non-artificial classes of numbers which are known to be b-normal
(where b is some number), e.g., normal in one particular base, but
absolute normality implies that it is b-normal for all b (e.g., absolute
normality means normality in all bases). Some qualifications on
b-normality are known, like if a number is b^k-normal, then it's
b^m-normal also (for k, m integers); if x is b-normal, then so is q x +
r (q and r rational with q != 0), etc. But general tests for normality
are an unsolved problem in mathematics.

> And what are the grounds for suspecting pi to
> be normal? Is it just "we don't have any particular
> reason to think it isn't", or is there more to
> it?

It's suspected that "most" irrational numbers are normal (in a
measure-theoretic sense, of course, since there are an uncountably
infinite number of irrationals). Furthermore, actual tests of the
distribution of pi to however many billions of digits they're up to now
show no statistical deviation from normality. As I pointed out earlier,
that isn't a proof, of course.

For more information, check out MathWorld:

http://mathworld.wolfram.com/NormalNumber.html

--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE

/ \ We are victims of our circumstance.
\__/ Sade Adu
Polly Wanna Cracka? / http://www.pollywannacracka.com/
The Internet resource for interracial relationships.

Tim Peters

unread,
Mar 18, 2003, 8:05:01 PM3/18/03
to
[Greg Ewing]

> Just out of curiosity, has any other irrational
> number (other than ones specially constructed to
> be so) been proved normal?

Last I heard (a few years ago), no. Note two meanings for "normal": the
original definition required normality in all bases simultaneously, and
that's usually called "absolutely normal" now. Also, AFAIK, no absolutely
normal number is known (constructed or not). This is curious because the
set of non-normal reals has measure 0 ("almost all" reals are absolutely
normal).

> And what are the grounds for suspecting pi to
> be normal? Is it just "we don't have any particular
> reason to think it isn't", or is there more to
> it?

Billions of digits of pi have been computed, and this tiny string of digits
has passed extensive statistical tests for equidistribution (of single
digits, pairs, triples, ..., up to something like 16-tuples). By induction,
it must be normal <wink>.


Erik Max Francis

unread,
Mar 18, 2003, 9:25:41 PM3/18/03
to
Tim Peters wrote:

> Last I heard (a few years ago), no. Note two meanings for "normal":
> the
> original definition required normality in all bases simultaneously,
> and
> that's usually called "absolutely normal" now.

True, although if mentioned without reference to a base, "normal" often
means "absolutely normal." (i.e., "It's normal in base b" obviously
doesn't mean absolutely normal, but "pi is thought to be normal"
probably does.)

> Also, AFAIK, no absolutely
> normal number is known (constructed or not).

Ah, it appears you are right. Champernowne and Copeland-Erdos are known
to be 10-normal, but not known to be absolutely normal.

--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE

/ \ Nine worlds I remember.
\__/ Icelandic Edda of Snorri Sturluson
Maths reference / http://www.alcyone.com/max/reference/maths/
A mathematics reference.

Michael Hudson

unread,
Mar 19, 2003, 8:43:39 AM3/19/03
to
Tim Peters <tim...@comcast.net> writes:

> Also, AFAIK, no absolutely normal number is known (constructed or
> not). This is curious because the set of non-normal reals has
> measure 0 ("almost all" reals are absolutely normal).

<hand-waving>
But for a number to be "known", it must be comptuable in some sense
and there are only countable many Turing machines...
</hand-waving>

Why does anyone care about normality, anyway?

Cheers,
M.

--
Or here's an even simpler indicator of how much C++ sucks: Print
out the C++ Public Review Document. Have someone hold it about
three feet above your head and then drop it. Thus you will be
enlightened. -- Thant Tessman

Tim Peters

unread,
Mar 19, 2003, 12:14:50 PM3/19/03
to
[Tim]

> Also, AFAIK, no absolutely normal number is known (constructed or
> not). This is curious because the set of non-normal reals has
> measure 0 ("almost all" reals are absolutely normal).

[Michael Hudson]


> <hand-waving>
> But for a number to be "known", it must be comptuable in some sense
> and there are only countable many Turing machines...
> </hand-waving>

That's an excellent argument for why we can't show an example of an
uncomputable real, but really no more convincing wrt normality than wrt
irrationality. After all, we do have examples of numbers normal wrt
specific bases, and there's no obvious way in which absolute normality
"should be" intractable.

> Why does anyone care about normality, anyway?

I think because attempts to define what random means lead naturally to
normality. If, e.g., pi is shown *not* to be normal, then it would be very
hard to believe it's random in any reasonable sense. If it is shown to be
absolutely normal, I expect reasonable people would disagree about whether
that's strong enough to conclude it's random, though.


Chermside, Michael

unread,
Mar 19, 2003, 12:41:54 PM3/19/03
to
Peter Hansen writes:
> But it's irrational, right? So irrationality is now defined as
> normal?

Erik Max Francis replies:


> No. Irrational does not necessarily imply normal. Take for instance
> the irrational number (decimal expansion):
>

> 0.1010010001000010000010000001...
>
> This number does not terminate and does not repeat, so therefore it is
> irrational. However, it clearly does not have a normal distribution for
> all digits (or indeed even for the only two decimal digits which
> appear). Thus it is irrational, but not normal.

But we CAN conclude that being rational implies you're not normal.

I-better-not-forget-the-<wink>-on-this-one

-- Michael Chermside

Robin Becker

unread,
Mar 19, 2003, 2:10:51 PM3/19/03
to
In article <mailman.1048094954...@python.org>, Tim Peters
<tim...@comcast.net> writes
.....

>I think because attempts to define what random means lead naturally to
>normality. If, e.g., pi is shown *not* to be normal, then it would be very
>hard to believe it's random in any reasonable sense. If it is shown to be
>absolutely normal, I expect reasonable people would disagree about whether
>that's strong enough to conclude it's random, though.
>
>
I assume absolute normality excludes the case where one expresses the
number in itself as a base or am I being more than usually stupid.

Also I suppose that being non-random implies finiteness (in some sense)
so are we just talking 'symbol' count or information. After all there
are very small symbolic representations of pi, but are they smaller in
information content etc etc.
--
Robin Becker

Tim Peters

unread,
Mar 19, 2003, 3:26:56 PM3/19/03
to
[Robin Becker]

> I assume absolute normality excludes the case where one expresses the
> number in itself as a base or am I being more than usually stupid.

It has to do with digit distribution in conventional positional notation in
positive integer bases (>= 2). Google will lead you to a precise definition
faster than I can regurgitate one.

> Also I suppose that being non-random implies finiteness (in some sense)
> so are we just talking 'symbol' count or information.

Sorry, I couldn't parse that -- but digits is digits, and the requirement
that all k-digit subsequences appear equally often, for each k >= 1, is
intuitively simple. See Knuth (Volume 2) for an entertaining argument that
piles on more intuitive requirements, until he ends up with a definition for
randomness that (it turns out) no number can meet! Intuition isn't always
enough -- or maybe it is, and randomness doesn't exist.


Chermside, Michael

unread,
Mar 19, 2003, 3:51:06 PM3/19/03
to
Robin Becker writes:
> I assume absolute normality excludes the case where one expresses the
> number in itself as a base or am I being more than usually stupid.

As far as I know, we're only talking about integer bases ( >= 2),
and non-integer numbers (the integer ones are CLEARLY not normal
since "x.000000..." has a lot more 0's than 1's, 2's, or 3's [1]),
so it doesn't come up.

> Also I suppose that being non-random implies finiteness (in some sense)

> so are we just talking 'symbol' count or information. After all there
> are very small symbolic representations of pi, but are they smaller in
> information content etc etc.

"Finite" in what sense? We're probably talking about numbers which
are finite in the sense that there's some integer larger than the
number (ie, no infinite quantities), but not finite in the sense
that they've got a finite number of digits. Since all we're really
interested in is the decimal expansion, we might as well presume the
number in question is in the range [0..1]. But that decimal goes on
infinitely, so you can pack lots of information into it (an "infinite"
amount if you like).

I don't think that the choice of symbols makes ANY difference in the
information content. I would say that "The ratio between a circle's
circumference and diameter", and "Pi", and the (infinite) string that
I would get if I finished writing this out: "3.141592653589793..."
all have the same information content, despite being 55, 2, and an
infinite number of characters long (respectively).

But-one-sure-uses-a-lot-more-paper

-- Michael Chermside

[1] A really interesting argument can be made that it's got just as
many 9's as 0's, since "x.00000..." = "(x-1).99999..." by most useful
definitions. Does this mean that integers are normal in base 2?


Erik Max Francis

unread,
Mar 19, 2003, 4:21:30 PM3/19/03
to
Robin Becker wrote:

> I assume absolute normality excludes the case where one expresses the
> number in itself as a base or am I being more than usually stupid.

When one talks about a number being b-normal, b is an integer. It's
true that pi written in base pi is 10, but that's "cheating" in the
sense that integral bases are usually what is intended when one is
talking about writing numbers in different bases.

> Also I suppose that being non-random implies finiteness (in some
> sense)
> so are we just talking 'symbol' count or information. After all there
> are very small symbolic representations of pi, but are they smaller in
> information content etc etc.

No, non-random (in terms of non-normality) simply means that a number
does not terminate or repeat (thus it is irrational), but that the
distribution of digits (in whatever base(s) are being discussed) are not
uniform.

Digit expansions (in any base) have nothing to do with a number's
symbolic representation; there are probably an infinite number of
different symbolic representations for any number you can name, but the
digit expansion in base b is unique (or, well, at least mostly unique,
for cases like 0.999... = 1).

--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE

/ \ Of all the perversions, chastity is the strangest.
\__/ Anatole France
Bosskey.net: Counter-Strike / http://www.bosskey.net/cs/
A personal guide to Counter-Strike.

Erik Max Francis

unread,
Mar 19, 2003, 4:25:04 PM3/19/03
to
"Chermside, Michael" wrote:

> [1] A really interesting argument can be made that it's got just as
> many 9's as 0's, since "x.00000..." = "(x-1).99999..." by most
> useful
> definitions. Does this mean that integers are normal in base 2?

No, because either it's got an infinite number of zeroes or an infinite
number of ones. Neither expansion is normal (they contain exactly none
of the other digit), and you can't include both simultaneously.
Furthermore, normality or non-normality can only be properties of normal
numbers, and both of these expansions terminate or repeat, meaning that
they are rational, not irrational. So therefore the normal/non-normal
qualification can't apply at all.

Steven Taschuk

unread,
Mar 19, 2003, 5:38:23 PM3/19/03
to
Quoth Chermside, Michael:
[...]

> [1] A really interesting argument can be made that it's got just as
> many 9's as 0's, since "x.00000..." = "(x-1).99999..." by most useful
> definitions. Does this mean that integers are normal in base 2?

Imho, the argument is not so interesting. The equiprobable
distribution property is a property of the symbol sequence, not
strictly speaking of the number. Thus the notion of normality of
a number requires some function from numbers to symbol sequences,
or a set of such functions. That is, unique representations are
required.

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

mch...@mcherm.com

unread,
Mar 19, 2003, 4:47:22 PM3/19/03
to
Michael Chermside writes:
> [1] A really interesting argument can be made that it's got just as
> many 9's as 0's, since "x.00000..." = "(x-1).99999..." by most
> useful
> definitions. Does this mean that integers are normal in base 2?

Erik Max Francis writes:
> No, because either it's got an infinite number of zeroes or an infinite
> number of ones.

Right.


> Neither expansion is normal (they contain exactly none
> of the other digit)

Right


> and you can't include both simultaneously.

Why not?


> Furthermore, normality or non-normality can only be properties of normal
> numbers, and both of these expansions terminate or repeat, meaning that
> they are rational, not irrational. So therefore the normal/non-normal
> qualification can't apply at all.

I agree that normality is usually considered a property of irrational
numbers (which I think the original poster may NOT have realized) but
if we DO extend it to the rational realm, then I had assumed that all
rationals would be non-normal in all bases. But it turns out that it's
not quite so easy, since some rational numbers have multiple valid
decimal expansions. If you define normality by including all the digits
of all the valid decimal expansions, then integers are normal in base
2. I doubt that's a USEFUL result, but it's certainly a curious one.

-- Michael Chermside


Erik Max Francis

unread,
Mar 19, 2003, 5:17:17 PM3/19/03
to
Steven Taschuk wrote:

> Imho, the argument is not so interesting. The equiprobable
> distribution property is a property of the symbol sequence, not
> strictly speaking of the number. Thus the notion of normality of
> a number requires some function from numbers to symbol sequences,
> or a set of such functions. That is, unique representations are
> required.

And while it's true that terminating and some repeating expansions in a
given base can have other representations (e.g., 0.999... = 1, 0.3759836
= 0.3759835999..., etc.), I'm pretty sure that all irrational expansions
in a given base are unique.

Since normality only concerns irrational numbers, the question of
non-unique expansions doesn't seem to come into play.

--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE

/ \ Patriotism is the virtue of the vicious.
\__/ Oscar Wilde

Erik Max Francis

unread,
Mar 19, 2003, 5:23:29 PM3/19/03
to
mch...@mcherm.com wrote:

> I agree that normality is usually considered a property of irrational
> numbers (which I think the original poster may NOT have realized) but
> if we DO extend it to the rational realm, then I had assumed that all
> rationals would be non-normal in all bases. But it turns out that it's
> not quite so easy, since some rational numbers have multiple valid
> decimal expansions.

But I think it's safe to say that when that happens, none of those valid
base-b expansions will be normal. They'll still be terminating or
repeating, which by definition means they can't be normal. It seems
like I'm just being anal, but normality is intimately tied with the
notion of irrationality. The definition of b-normality states that for
a decimal expansion in base b, every b-digit sequence of length k will
appear with the expected frequency. This can't possibly be the case for
an expansion which terminates or repeats, because even if the repeating
portion is very long, there must be some (in fact, an infinite number)
of sequences that don't appear anywhere at all in the expansion.

This can be seen by trying to construct such a number; the logical
result is to create Champernowne's constant in base b (C_b), which is
irrational. If it repeats, then some sequences _must_ be left out.
(Furthermore, there is some K such that no sequences of length k >= K
appear _anywhere_ in the expansion.)

> If you define normality by including all the
> digits
> of all the valid decimal expansions, then integers are normal in base
> 2. I doubt that's a USEFUL result, but it's certainly a curious one.

But in mathematics, when you're talking about something, even if it's
not unique, you don't consider all the different non-unique forms
simultaneously; you don't treat them as a superposition of states, you
treat each state individually.

Robin Becker

unread,
Mar 19, 2003, 7:15:48 PM3/19/03
to
In article <mailman.1048105833...@python.org>, Tim Peters
<tim...@comcast.net> writes

>[Robin Becker]
>> I assume absolute normality excludes the case where one expresses the
>> number in itself as a base or am I being more than usually stupid.
>
>It has to do with digit distribution in conventional positional notation in
>positive integer bases (>= 2). Google will lead you to a precise definition
>faster than I can regurgitate one.

well in base pi, pi has a a value which isn't exactly random.


>
>> Also I suppose that being non-random implies finiteness (in some sense)
>> so are we just talking 'symbol' count or information.
>
>Sorry, I couldn't parse that -- but digits is digits, and the requirement
>that all k-digit subsequences appear equally often, for each k >= 1, is
>intuitively simple. See Knuth (Volume 2) for an entertaining argument that
>piles on more intuitive requirements, until he ends up with a definition for
>randomness that (it turns out) no number can meet! Intuition isn't always
>enough -- or maybe it is, and randomness doesn't exist.
>
>

Well lets use sin.

sin pi/2 = 1

so in math speak

pi = 2 * sin^-1(1)

ie pi is a very small number of symbols. Digits are also symbols. Can
you parse this? I guess what I am getting at is that randomness/entropy
is an observational opinion. How much information is actually in pi?
Does it really encode the universe or is it just an anthropomorphically
distinguished symbol?
--
Robin Becker

Erik Max Francis

unread,
Mar 19, 2003, 7:42:25 PM3/19/03
to
Robin Becker wrote:

> well in base pi, pi has a a value which isn't exactly random.

Hence why he said "positive integer bases (>= 2)" :-). Non-integral
bases have meaning, but aren't usually used.

--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE

/ \ The only completely consistent people are the dead.
\__/ Aldous Huxley
Alcyone Systems / http://www.alcyone.com/
Alcyone Systems, San Jose, California.

Jp Calderone

unread,
Mar 19, 2003, 7:20:55 PM3/19/03
to
On Thu, Mar 20, 2003 at 12:15:48AM +0000, Robin Becker wrote:
> In article <mailman.1048105833...@python.org>, Tim Peters
> <tim...@comcast.net> writes
> >[Robin Becker]
> >> I assume absolute normality excludes the case where one expresses the
> >> number in itself as a base or am I being more than usually stupid.
> >
> >It has to do with digit distribution in conventional positional notation in
> >positive integer bases (>= 2). Google will lead you to a precise definition
^^^^^^^^^^^^^^^^^^^^^^

> >faster than I can regurgitate one.
>
> well in base pi, pi has a a value which isn't exactly random.
> [snip]

Jp

--
http://catandgirl.com/view.cgi?90
--
up 16 days, 16:00, 8 users, load average: 2.10, 2.04, 1.54

Robin Becker

unread,
Mar 19, 2003, 8:05:15 PM3/19/03
to
In article <3E790E71...@alcyone.com>, Erik Max Francis
<m...@alcyone.com> writes

>Robin Becker wrote:
>
>> well in base pi, pi has a a value which isn't exactly random.
>
>Hence why he said "positive integer bases (>= 2)" :-). Non-integral
>bases have meaning, but aren't usually used.
>
well I choose to be slightly more general. Is that forbidden?
--
Robin Becker

Erik Max Francis

unread,
Mar 19, 2003, 8:06:33 PM3/19/03
to
Robin Becker wrote:

> well I choose to be slightly more general. Is that forbidden?

It might not be in some other case, but in a case where positive
integral bases are stipulated in the definition of normality, talking
about non-integral (and irrational!) bases would be a case of breaking
the playground equipment.

Michael Hudson

unread,
Mar 20, 2003, 6:09:48 AM3/20/03
to
Tim Peters <tim...@comcast.net> writes:

> [Tim]
> > Also, AFAIK, no absolutely normal number is known (constructed or
> > not). This is curious because the set of non-normal reals has
> > measure 0 ("almost all" reals are absolutely normal).
>
> [Michael Hudson]
> > <hand-waving>
> > But for a number to be "known", it must be comptuable in some sense
> > and there are only countable many Turing machines...
> > </hand-waving>
>
> That's an excellent argument for why we can't show an example of an
> uncomputable real, but really no more convincing wrt normality than wrt
> irrationality.

Well, I guess. But rationality seems a much more tractable notion
than normality -- it seems "finite" in some sense. I'm not sure
rationality is that good an example, as having irrationals is somehow
the point of the reals... Transcendence would be a better example,
but I'm an algebraist -- what's a transcendent number, again? <wink>.

> After all, we do have examples of numbers normal wrt specific bases,
> and there's no obvious way in which absolute normality "should be"
> intractable.

> > Why does anyone care about normality, anyway?
>
> I think because attempts to define what random means lead naturally
> to normality. If, e.g., pi is shown *not* to be normal, then it
> would be very hard to believe it's random in any reasonable sense.
> If it is shown to be absolutely normal, I expect reasonable people
> would disagree about whether that's strong enough to conclude it's
> random, though.

Except that pi clearly *isn't* random... but this leads very quickly
into the "the smallest integer than can't be described in less than
100 characters" type paradox, and I don't care about them, either :-)

Cheers,
M.

--
Well, you pretty much need Microsoft stuff to get misbehaviours
bad enough to actually tear the time-space continuum. Luckily
for you, MS Internet Explorer is available for Solaris.
-- Calle Dybedahl, alt.sysadmin.recovery

mch...@mcherm.com

unread,
Mar 20, 2003, 8:43:42 AM3/20/03
to
Michael Chermside:

> [1] A really interesting argument can be made that it's got just as
> many 9's as 0's, since "x.00000..." = "(x-1).99999..." by most useful
> definitions. Does this mean that integers are normal in base 2?

Steven Taschuk:


> Imho, the argument is not so interesting. The equiprobable
> distribution property is a property of the symbol sequence, not
> strictly speaking of the number. Thus the notion of normality of
> a number requires some function from numbers to symbol sequences,
> or a set of such functions. That is, unique representations are
> required.

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.

Perhaps Python 4000 will run on a quantum computer[1]:

import sys
assert sys.version_info[0] >= 4 #
class IrrationalNumber:
"""Actual irrational numbers should subclass this and implement
the iterDigits() method."""

def iterDigits(base):
"""Returns an iterator of the digits of the sequence.
subclasses should implement."""
raise NotImplementedError

def __iter__(self):
return self.iterDigits(base=10)

def isNormal(self, base=None):
if base is None:
for b in range(2, Infinity):
if not isNormal(self,b):
return False
return True
else:
digitCounts = dict( [(d,0) for d in range(base)] )
for digit in iter(self):
digitCounts[ digit ] += 1
for count in digitCounts[1:]:
if count != digitCount[0]///Infinity:
return False
return True

I-started-testing-this-code-but-it-hasn't-finished-running-yet

-- Michael Chermside


[1] From http://www.newsfactor.com/perl/story/19601.html:
"Our quantum algorithm could, in fact, be regarded as an
infinite search through the integers in a finite amount of
time". I don't know enough to evaluate this independently.
But I can dream!


Steven Taschuk

unread,
Mar 20, 2003, 3:06:09 PM3/20/03
to
Quoth mch...@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.)

Erik Max Francis

unread,
Mar 20, 2003, 6:58:02 PM3/20/03
to
Michael Hudson wrote:

> Well, I guess. But rationality seems a much more tractable notion
> than normality -- it seems "finite" in some sense. I'm not sure
> rationality is that good an example, as having irrationals is somehow
> the point of the reals... Transcendence would be a better example,
> but I'm an algebraist -- what's a transcendent number, again? <wink>.

Real numbers are divided into two types: algebraic and transcendental.
Algebraic numbers are those which are the root of any polynomial
equation with integral coefficients; transcendental numbers are those
which cannot. The square root of two is algebraic, for instance, but e
and pi are transcendental. All rational numbers are algebraic, and all
transcendental numbers are irrational, but not all irrational numbers
are transcendental.

--
Erik Max Francis / m...@alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE

/ \ Morality is a weakness of the mind.
\__/ Arthur Rimbaud
Blackgirl International / http://www.blackgirl.org/
The Internet resource for black women.

Tim Peters

unread,
Mar 21, 2003, 1:28:09 AM3/21/03
to
[Michael Hudson]
>>> <hand-waving>
>>> But for a number to be "known", it must be comptuable in some sense
>>> and there are only countable many Turing machines...
>>> </hand-waving>

[Tim]


>> That's an excellent argument for why we can't show an example of an
>> uncomputable real, but really no more convincing wrt normality than
>> wrt irrationality.

[Michael]


> Well, I guess. But rationality seems a much more tractable notion
> than normality -- it seems "finite" in some sense. I'm not sure
> rationality is that good an example, as having irrationals is somehow
> the point of the reals... Transcendence would be a better example,
> but I'm an algebraist -- what's a transcendent number, again? <wink>.

I don't care about irrationality -- it was just an example of a property
other than uncomputability. No matter what property P you have in mind, the
"but there are only countably many reals that can be 'known'" caveat
applies, and I don't see a reason to believe that sheds light unless P is
related to "unknowability" (in which case that the set of knowable reals is
countable is supremely relevant). David Bailey et al. have gone quite a way
in understanding normality; see papers at his web site:

http://www.nersc.gov/~dhbailey/


>>> Why does anyone care about normality, anyway?

>> I think because attempts to define what random means lead naturally
>> to normality. If, e.g., pi is shown *not* to be normal, then it
>> would be very hard to believe it's random in any reasonable sense.
>> If it is shown to be absolutely normal, I expect reasonable people
>> would disagree about whether that's strong enough to conclude it's
>> random, though.

> Except that pi clearly *isn't* random...

Indeed, my wording there was too sloppy to bear. pi isn't random, but its
decimal digits known so far pass extensive statistical tests for randomness.
That's interesting in itself, and if pi is shown to be absolutely normal
then there are a great many statistical tests for randomness we know its
digits will pass without bothering to apply them. Of course there's at
least one computable statistical test the digits of pi don't pass, namely
the test that compares a sequence of digits against the computed digits of
pi.

> but this leads very quickly into the "the smallest integer than can't
> be described in less than 100 characters" type paradox, and I don't
> care about them, either :-)

The pseudo-random numbers produced by Python 2.3's Mersenne Twister are
provably equidistributed in 624 dimensions. It's of supreme practical
importance if a cheesy little pi algorithm can do better than that <wink>.


Michael Chermside

unread,
Mar 21, 2003, 10:22:10 AM3/21/03
to
Steven Taschuk writes:
> I particularly like this line:
> > if count != digitCount[0]///Infinity:

Thanks for noticing <wink>. I figured that was the obvious way
to expand true_division.

-- Michael Chermside


0 new messages