while (a=b()) ... infinite sets digression

Chad Netzer chad at vision.arc.nasa.gov
Wed May 19 15:11:24 EDT 1999


Greg Ewing wrote:

> Chad Netzer wrote:
> >
> >  So, there are infinitely more strings which start with underscores than do not,
>
> Hmmm... this would seem to imply that there are
> infinitely many more strings starting with any
> given character than any other character.

Well, I am not a Set Theorist, but here are some more thoughts on this matter:

Assuming a character set of size N, the number of possible strings that start with
a particular character (assuming unbounded string length) is:

1 + N + N**2 + N**3 + N**4 + ... + N**infinity

while the number of strings that do not start with a particular character is:

(N - 1) + (N - 1)(N) + (N - 1)N**2 + ... + (N-1)N**infinity

This would seem to indicate the opposite, that there are MORE strings starting
without a given character than with a given character (since, for N > 1, each term
in the second expression is at least as big as the the term in the first)

Hmmm, I guess this just goes to show that the concept of "more" is somewhat
non-intuitive when dealing with infinite sets.  My understanding is that both
sets have the same cardinality, and are thus both are the same size (in the
formal sense, despite being infinitely large).  In fact, both are probably Aleph-1
sets which means they are larger than the set of integers...  I'm out of my area,
here, so I'll let it go at that. ;)

>
>
> Which seems absurd. Although where infinities
> are involved, that doesn't necessarily mean it's
> not true...

   Yes, it is remarkable how these seeming absurdities can be explained by the
theories of infinite sets.  It is even more remarkable that any of it makes even
a lick of sense to me...

>
>
> Tricky and dangerous beasts, these infinities!

And let's not even bring up infinitesimals...






More information about the Python-list mailing list