Category: Blog

Infinite Ape Simulator

I’ve been thinking about the Infinite Monkey Theorem, which postulates that an infinite amount of monkeys banging away on keyboards randomly forever would eventually produce the works of Shakespeare. You can read about this in detail here.

I thought to myself, rather than use dirty monkeys to reproduce Shakespeare (which has been attempted), why not use a machine brain? So I turned to an actual honest-to-goodness computer and wrote a simulation.

My machine was the Commodore 64, and I wrote a simple piece of code to randomly generate three letters in order and test to see if they spelled ‘act’, the first word of Hamlet. I was testing the water, so to speak, instead of diving right into a full reproduction of the entire play.

Now it’s fairly simple statistics to calculate that of the 17576 possible three letter words, only one is ‘act’. But I started by looking for words that started with ‘a’ (ie. of the form a–) of which there are 676, and then words starting with ac-, of which there are 26. I timed my result to see if – as expected – each successively correct letter took approximately 26 times as long to generate as the previous.

Here’s my code alongside one example output looking specifically for ‘act’:

The time is in seconds, and I ran 12 searches each for a– and ac- and 5 (due to the time required) for act. Here are the average times to generate each type of result:

A–: 3 seconds
AC-: 84 seconds
ACT: 2027 seconds

These numbers are close to 26x multiples of each other as expected, and I imagine were I to do enough tests they would converge to that value. From these results we can speculate how long it may take for my C64 to recreate Hamlet…

But first some facts: Hamlet has 132680 letters and 199749 characters in total including spaces and seven punctuation signs. Including these but ignoring case, there are 34 potential candidates for each character and 199749 characters need to be generated. My predictions that follow are based on times equal to 34/26 of those listed above.

The expected (ie. 50% chance) time it would take my C64 to randomly generate Hamlet would be 34^199746 times 1908 seconds which is (approximately) 34^199739 million years. The minimum time is about 1.7 hours ( if it got it right on the first go) and the maximum is of course infinity.

But – given our universe is only less than 14,000 million years old – this means I’m confident in saying my C64 would never randomly generate Hamlet. In fact were I to expand the sim to look for the sequence ‘Act 1’ I would expect the average successful attempt to take about one month. If I extended the sim all the way to the first spoken word – over 100 characters in – I’d expect the Earth would be consumed by the sun before my C64 did it.

Some of you say “that’s just a C64!”, which is primitive compared to the device you’re reading this on. But even if your fancy phone or laptop is a trillion times more powerful, this is nothing compared to a factor of ~10^200k.

It’s pleasant to think of infinite typing apes (or computers) randomly spewing out a work of art, but it would never happen 🙂

(Incidentally and somewhat related; the world is still awaiting the results of B’s testing of this!)

Inktober 2019

I did ‘Inktober’ again! This is where artists – such as myself – create and share a new piece every day in October. I used the same app as last year and once again followed no theme, making each piece up as I went along. You’ve already seen one example in the previous post; here I’ll show more.

They started off rather simple. The above was inspired by a dream in which I was tending a strange plant just like the one drawn. I was still getting refamiliarizing myself with the app at this point.

That was drawn after listening to Bela Lugosi’s Dead over and over again (“The virginal brides file past his tomb…“). I wanted to superimpose a window over it with Dracula looking out but lacked the skill.

This one was inspired after watching a YouTube video about the days of airships flying over NYC. It also features silhouettes, which were a common motif this year.

One day, when I was very tired after my 11.5 hours at work, SMC sent a dazzling photo of an ocean sunset in Vanuatu. I used it as inspiration for the above. To be honest I could have put more detail in but I was simply too exhausted!

Around halfway through the month I developed a few new tricks that allowed me to squeeze a bit more detail out of what is a very limited drawing app. This simple sketch of a tower was an early example, but things progressed in time to pieces like this:

And eventually this:

The above is my favorite drawing of not just this years group, but last year as well. I feel I – finally – achieved what I wanted with the starfield and the lighting of the silhouette and enjoyed reusing the tower from earlier. I wonder who lives there?

Another Inktober is now over, and my talents will – at least for the next 11 months – remain exclusive to cards and postcards. But I’m sure I’ll be back for Inktober 2020!

The Early Days

In the last year I’ve added a few interesting games to my collection. They’ve come from various sources, but they’ve all been ‘rebuys’ of games I used to own back in my youth.

Even though I can’t actually run any of this software, the nostalgia value for me is high. I’ll cover them in reverse historical order…

The above two were purchased at a local comic show about a year ago, and I paid a mere $2 each for them. The seller had even more, including the second Xeen game and some early Heroes of Might and Magic titles, but none in as good condition as the above.

I bought Might and Magic 3 back in 1991 when it was first released, and it was amongst the first boxed PC games I ever bought. I recall loving it at the time and (probably) testing Bernards patience by how much time I spent using his computer! I’d been a fan of the series beforehand, and had played the first two in pirated form, and was pleased to own the latest iteration. I continued playing the series well into the Heroes offshoots, and once arriving in the US had a great time replying MM2 on an Apple and then the Genesis, as well as the NES and SNES versions. A great and important RPG series.

The SSI ‘gold box’ series of AD&D computer games were amongst the more important and influential RPG games of the late 1980s and early 1990s. Tabletop RPG fans had been dreaming of computer versions of their favorite game for years and SSI delivered in spades. Starting with Pool Of Radiance in 1988 there were many games (and spinoffs) in the series and I played them all! I recall particularly enjoying the Krynn titles, including the two above, the Amiga versions of which were given to me with an Amiga 500 by a colleague.

In fact the gold box was one game series that spanned the shift to the USA, since I even purchased Unlimited Adventures for Macintosh after moving here and wrote – and somehow put online in those very early days – my own ‘module’ called Dead Swamp Destiny (for which I even designed the enemy sprites!). Ah I wish I could load that up and post screenshots to this blog today 🙂

The gold box series is now long dead, but the basic game design lives on in countless tactical games still going strong today (such as the Fire Emblem series). But I’ll always remember the series as one of my favorite of all time.

And speaking of favorites, the above is the 1987 USC64/128 release of the original Wizardry (which first came out in 1981). I bought this copy earlier this year for $40.

As you can see it’s complete and in amazing condition. Does the disc work? I’ll likely never know, but I couldn’t resist this piece of history. Wizardry isn’t just an important game to my personal gaming history, it’s one of the most important games ever released, and has gone on to directly influence the design of many other juggernaut game series including Final Fantasy and Dragon Quest.

I’ve got a collection of many Wizardry titles for seven or eight systems and many spinoff games (the series and its variants is still going strong in Japan) and the ‘dungeon crawl’ is to this day one of my favorite game styles. Over my decades many a long hour has been lost in the labyrinthine mazes of the Wizardry series, and I hope many are still yet to be lost in my future…