Previously, in Part 1 of my exploration of WordWorld, a cartoon where characters can make anything from combinations of letters they own or find lying around, I discussed the chance that some of the letters would accidentally get together and create a dangerous word. In this part, I am going to see what might happen and how long it would take.
I’m making a few assumptions about the distribution of letters in the world; that they are even. For every A, B, and C, there will be an X, Y, and Z. Also, in my statistical calculation, I did not account for the order of the letters. Still, for our purposes, this should be sufficient.
In order to test this, I’ve created a small Python program that will simulate grabbing random collections of letters out of a pool to see what the random words would be.
import random random.seed() letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' wordnum = 1 while (True): word = '' for v in xrange(1+random.randrange(20)): word += letters[random.randrange(len(letters))] print '%d : %s ' % (wordnum,word) wordnum += 1
As you can see, it doesn’t take many lines of code to do it. Running it reveals a lot of garbage: DNBU, MUILYIOAMEBAX, SRLJTTCQHZ, QOV, BBOSYGQOSJXSOIAHZJS, and various other random non-words. So, how about some limitations?
I added code to only report when a 4-letter word which might be explosive was drawn. Here’s the result, with counts:
141256 : FIRE 212520 : BOOM 329832 : FIRE 356962 : BOOM 379910 : BOMB 530749 : DOOM
So, the 141256th word drawn was FIRE, and it took almost another 100k before BOOM was drawn. If we assume our duck friend takes one second to draw a letter, and does it for 8 hours a day, that means that he can draw about [math](60*60*8)/4 = 7200[/math] words a day. So, it will take [math]141256/7200 \approx 19.6[/math] days… a little less than a month, before his house is consumed by fire.