# Infinite monkey theorem

## Recommended Posts

```dim \$word1
while 1
_sr()
\$crlfatend = Random(1,10,1)
_sr()
\$letter = chr(Random(97,122,1))
\$word1 = \$word1 & \$letter
if \$crlfatend = 6 Then
checkifisword(\$word1)
\$word1 = \$word1 & @crlf
FileWrite("o.txt",\$word1)
\$word1 = ""
EndIf
;~  FileWrite("o.txt",\$o)
WEnd
Func _sr()
_sr2()
SRandom(Round((TimerInit()*Random(1234,3335789,1)+TimerInit())/TimerInit()))
EndFunc
Func _sr2()
SRandom(Round((TimerInit()*Random(1234,3335789,1)+TimerInit())/TimerInit()))
EndFunc
Func checkifisword(\$word)
InetGet("http://dictionary.reference.com/browse/" & \$word,"dic.txt")
if StringInStr(\$dic,"dictionary results") <> 0 and StringLen(\$word) > 1 Then
FileWrite("fw.txt",\$word & @crlf)
ConsoleWrite("+>word found: " & \$word & @crlf)
EndIf
EndFunc```

The infinite monkey theorem states that a monkey hitting keys at random on a typewriter keyboard for an infinite amount of time will almost surely type a given text, such as the complete works of William Shakespeare.

I make a monkey generator yay.Post in this thread if you find any words or acronyms.

I've found so far:

fly

jar

to

hi

Sort of words found so far:

Edited by mmavipc

[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

##### Share on other sites

I did something like this one time.

I had a predefined 7 number sequence. I gave it one million tries to generate seven random numbers to see if they matched the sequence. It never worked for seven numbers. It worked a few times for 6, and sometimes worked within the first 100 tries for 5 numbers. I guess it's just random.

I'll see if I can dig up the code.

##### Share on other sites

did u guys try to throw some peanuts to increase efficiency ?

##### Share on other sites

did u guys try to throw some peanuts to increase efficiency ?

You did mean... "Bananas"

8)

##### Share on other sites

You did mean... "Bananas"

8)

lol that made me crack up

Edit: dictionary.com is not very reliable. Anyone know a dictionary website that only outputs words not acronyms?

Edited by mmavipc

[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

##### Share on other sites

I have a 9mb wordlist ;p

I guess you could set up a website at a free host that uses that wordlist and then returns a given word. no more. no less.

would be the easiest.

[right]~What can I say, I'm a Simplistic person[/right]

##### Share on other sites

I have a 9mb wordlist ;p

I guess you could set up a website at a free host that uses that wordlist and then returns a given word. no more. no less.

would be the easiest.

I have a 35 GB wordlist. Pwned.

##### Share on other sites

I have a 35 GB wordlist. Pwned.

(like that but my jaw drops to the floor)

[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

##### Share on other sites

Why not check for the dictionary file at startup and downloading it (If needed) instead of executing the INetGet() every time you want to check for a word?

Your wordlist is 3.5x bigger than my HD.

Edited by KentonBomb

##### Share on other sites

Why not check for the dictionary file at startup and downloading it (If needed) instead of executing the INetGet() every time you want to check for a word?

Your wordlist is 3.5x bigger than my HD.

That would work if i had a wordlist

dictionary.com is soo unreliable that my forund wordlist is this

```ce
tf
kz
krs
on
nyt
jb
hi
xy
fb
ef
mi
dr
cda
vp
ir
wo
ky
ib
wd
sbf
gu
oa
aeq
chq
di
ix
th
dq
lz
at
sx
cn
jg
hy
nyp
ct
gq
dz
pyx
ej
tr
ya
to
xl
ccm
cv
zil
qo
kr
yb
mt
fk
jar
ftt
gk
qh
go
qs
lrd
lt
al
ox
zi
cf
xs
ek
bl
fdd
ot
ck
fn
cl
ahme
npm
mxi
ede
by
jab
ls
cd
gpf
mew
cc
ci
gz
xe
hop
rn
slp
tz
jo
ve
kj
nc
oe
jf
iru
cid
cz
rhbojfamovr
ii
oc
dc
na
rnn
lk
zh
bt
gh
be
xv
xc
nl
rlo
burh
ka
md
bs
pk
bb
yv
lh
dcg
wa
guv
pr
dh
mz
sw
eou
uri
zax
nb
hk
ios
ny
bc
oti
ht
gf
br
ptf
bv
fc
ji
lwv
ss
imla
pd
ed
py
tn
aw
dtn
lm
ki
wm
lpm
ind
cbf
ohd
so
yi
sd
zs
qp
dix
re
off
iv
vg
mo
od
ys
qf
sk
phc
eu
pb
atl
ij
fz
fr
gaa
xf
sp
rl
un
uh
cx
vsf
gp
ddr
pss
dn
ww
lfa
bhc
eoe
ppb
fl
yd
wt
jd
ldb
not
bd
fro
gv
vax
wp
yo
esl
usa
kha
llp
pi
tm
vc
ue
dx
cw
hv
st
mug
kt
kk
mtd
ec
ns
js
vw
ob
we
nfp
ba
ea
su
bpd
iw
eg
hg
lg
gpg
rq
dk
olc
ict
ohc
kuru
cp
hev
dae
xp
lw
cr
gls
fe
tc
ho
rpv
ra
cry
uc
of
pax
wr
sh
reh
ne
nci
iq
mlr
toa
as
nem
msl
hz
dau
cmm
vhs
bfo
pq
ldd
hb
um
er
mbl
gog
dt
lab
zu
kab
pea
aes
nt
ans
efp
pl
fi
si
lst
nz
ag
gt
om
in
uw
wb
dob
mns
wap
af
rph
cj
fy
pes
own
tda
wox
ufw
ch
nh
fs
bn
jr
dhm
qt
av
ng
lf
oo
tk
cbm
crm
ma
lv
mb
fmo
jv
ano
nk
mv
ume
osp
nx
pp
qu
cml
afo
el
gg
ili
ito
cu
en
cno
zl
ft
sn
ip
sr
bp
wl
np
cho
kl
uci
dm
son
fcl
rb
sq
isa
kaw
qe
krp
req
lye
sfdu
uvc
keb
pa
mg
seg
ven
ur
aol
gy
lgk
rg
kg
je
ish
vci
ds
bai
ase
cmg
bz
ccp
que
zz
otr
vi
eha
xt
ah
vcs
bcf
qi
rig
qc
yl
ay
eus
fhs
uuq
kn
up
dy
vv
ge
ps
vmcm
va
ebe
sox
mf
sy
it
ayg
ngo
ep
bwk
mna
cwt
hr
ppr
hj
le
icc
oj
lu
hp
ts
wu
zw
afr
eon
gm
kp
ccu
ez
fsi
mu
bgs
he
crc
xw
edd
bew
jp
qmw
msy
fd
bix
how
zp
nm
put
gwf
eca
mp
nat
gn
bw
eog
dwy
amw
uz
tp
zr
fbi
bo
sj
lacs
ces
jn
bpw
oy
php
hln
nas
qy
rk
era
agn
dg
fmn
ero
sba
oh
ia
pns
pgc
hh
exc
bg
ui
bx
ngi
hoo
cag
dci
vj
edc
fse
hl
nit
lb
vif
suk
etl
vbt
ibf
rwr
vnc
ws
rsh
pin
mhc
rj
ov
dtf
cha
ucx
iwc
czk
rr
ll
fyn
rf
nj
fya
zc
hdl
gee
az
bta
kb
erk
vy
qx
xq
wsu
dlm
px
wh
ok
yr
krw
ie
huk
abt
atk
hds
nsg
xr
xci
gpm
ul
cmd
pir
hdr
pse
aku
ic
iil
mhd
cmo
vpi
lgv
gnof
xui
jc
rdu
ey
pc
ssr
zn
xu
lof
kd
sz
qnb
rmm
ran
ssi
env
nr
zfs
jt
hmf
bdr
ks
mitu
tbh
rv
ei
sm
ko
vt
ccf
fdr
anc
vd
aoo
bq
gjt
usw
dub
pyr
lacy
dmn
ntp
tx
gyri
app
xh
hbd
nev
tg
dw
qlfv
cmtkzdqnn```
Edited by mmavipc

[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

##### Share on other sites

You may be able to create a regular expression that checks if it is a word or not.. It could get complicated, but good.

##### Share on other sites

You may be able to create a regular expression that checks if it is a word or not.. It could get complicated, but good.

I am horrible at Regular Expressions

[size="10"]Pure Au3 crypt funcs(I'm currently also working on making a dll from this)[/size][Y] Be more active in the community[Y] Get 200 posts[N] Get 300 posts[N] Make a Topic in the example scripts forum with at least 50 replies.People who currently hate me:ValikSmOke_N

##### Share on other sites

compile it to CUI, and you can see a nice function going currenttly adding the meaning of the word

EDIT: successfully made it retrieve the meaning of the word. Also added the TimeStamp() function, which will write the date and time at the end of the file every minute. (useful for checking word-finding speeds)

EDIT2: It's coming together quite nicely. It's getting fast too

(Yes It actually found didanosine)

Edited by toonboon

[right]~What can I say, I'm a Simplistic person[/right]

##### Share on other sites

I think the internet has proven the theorem wrong, anyway...see my sig

j/k

Edited by james3mg

"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

##### Share on other sites

Alright, first off the infinite monkey theorem isn't a conjecture, so it needn't been checked via simulations... and if you do want to run some simulations to see what the deal is, you can abstract it away from actual words... since the actual words are not useful to the concept. i.e. Find the expected value of the length of a sequence of randomly generated letters that contains the sequence 'a', 'aa', 'aaa', 'aaaa', and so on. Lastly, any decent simulations will absolutely not involve doing an inetget and will most likely involve a more efficient language. Autoit is great for so many things, but for simulations it is not.

If you run the following cpp code and graph the log of the avg number of letters vs string length and then do an exponential fit (can be done easily in excel) then you find that the function is very similar to 26^str_len (though for a base e exponential it is ~e^(3.25*str_len) ).

```#include<iostream>
#include<cstdlib>
#include<ctime>

using namespace std;

int main(){
srand((unsigned)time(0));
int START_LEN = 2, END_LEN = 6, NUM_TRIALS = 32;
long long sum = 0;
for(int len=START_LEN; len<=END_LEN; sum=0, len++){
for(int trial=0, count=0; trial<NUM_TRIALS; count=0, trial++)
while(++sum && count < len)
count = rand()%26 == 0 ? ++count : 0;
cout << "The avg (n=" << NUM_TRIALS
<< ") # of letter req for a specific string of length "
<< len << " is " << (sum/(long long)NUM_TRIALS) << "." << endl;
}
return 0;
}```

The prog might take a few min to finish, if it won't complete then set NUM_TRIALS to be a smaller number.

Edited by Wus

## Create an account

Register a new account