Problem with algorithm

Paul McGuire ptmcg at austin.rr.com
Fri Apr 13 18:35:02 CEST 2007


On Apr 13, 10:49 am, Carsten Haese <cars... at uniqsys.com> wrote:
> On Fri, 2007-04-13 at 10:22 -0500, Michael Bentley wrote:
> > On Apr 13, 2007, at 9:19 AM, Paul McGuire wrote:
>
> > > If you just expand the length to five million* or so, one of those
> > > strings will contain all the works of Shakespeare.
>
> > Not likely, even with a tiny sampling of the works of Shakespeare:
>
> Actually, the OP seems to be interested in generating *all* strings of
> length N. If you generate the set of *all* strings of 5 million
> characters length, at least one of them will contain all works of
> Shakespeare. That statement is utterly true and utterly impractical,
> which is, of course, the point of Paul's joke.
>
> -Carsten

But even random typing will *eventually* get there (where "eventually"
= several gazillion times the age of the universe) - see
http://en.wikipedia.org/wiki/Infinite_monkey_theorem.

-- Paul
If I see farther, it is because I stand on the shoulders of an
infinite number of monkeys.






More information about the Python-list mailing list