Home > Mathematica > Word Play

Word Play

I used Mathematica to work a word puzzle:

From the alphabet (“a” to “z”), select 5 letters without replacement (i.e. distinct letters). What selection of letters leads to the most five letter English words?

Initially, approaching this as a brute force exercise has an inordinate computation time. After some thought, the effort can be reduced

There are 65780 five letter subsets of the the alphabet. There are 39446 words that contain at least one vowel or letter “y”. There are 149191 entries in the Mathematica WordData[] There are 9204 four or five letter words (excludes numbers, more than one word and takes into account plurals with “s”, which I could not find a way of counting). Using Intersection I was able to select permutations that were in the dictionary and then examine top cases and deal with the plurals.

The top three words:

Letters Words Count
a,e,l,s,t lates,least,slate,stale,steal,stela,tesla,taels,tales,teals 10
a,e,p,r,s apers,asper,pares,parse,pears,rapes,reaps,spare,spear 9
a,c,e,r,t caret,carte,cater,crate,react,trace 6
Advertisements
Categories: Mathematica
  1. May 27, 2012 at 8:52 pm
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: