HP3000-L Archives

August 2000, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Gavin Scott <[log in to unmask]>
Reply To:
Gavin Scott <[log in to unmask]>
Date:
Fri, 4 Aug 2000 14:58:25 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (33 lines)
> "SUBBOOKKEEPER is the only word with four pairs of double letters
> in a row.

Let's check in the wordlist available from the URL I posted earlier (with a
little help from Mathematica):

In[1]:= words = ReadList["words.txt", String];

In[2]:= Length[words]

Out[2]= 354984

In[3]:= data = Map[Characters, words];

In[4]:= Cases[data, {___, a_, a_, b_, b_, c_, c_, d_, d_, ___}]//Timing

Out[4]= {10.725 Second, {{"s", "u", "b", "b", "o", "o", "k", "k", "e", "e",
"p", "e", "r"}}}

So out of 345,984 words in this dictionary, "subbookkeeper" is the only one
that matches the criteria of four pairs of letters in a row.  How about the
"pt" question:

In[5]:= Cases[data, {___, "p", "t", ___}];

In[6]:= Length[%]

Out[6]= 4263

So there are 4263 words in the list containing "pt".

G.

ATOM RSS1 RSS2