Wolfram Computation Meets Knowledge

Word Play with Mathematica

Here in Champaign-Urbana, where Roger Ebert was raised, I took notice when Disney announced the end of its long relationship with Ebert & Roeper. Disney also announced the replacement critics, Lyons & Mankiewicz. Was there something intentional in that? A quick run on my Mathematica programs returned this anagram:

Lyons + Mankiewicz = Monica Lewinsky + Z

Did Disney do this deliberately?

Words sometimes have hidden meaning. For over 30 years, I’ve been sharing puzzles with Will Shortz. Many of these I’ve found with Mathematica, such as computer user = supreme court, and Will has used them in his weekly NPR puzzle segment. Anagrams have of course been popular for many years. A 1936 tour de force by David Shulman is a sonnet where every line uses the letters of “Washington Crossing the Delaware.” The National Puzzlers League maintains a list of best anagrams. Also, anagrammy.com regularly ranks new anagrams as they are found. Here are some good ones:

Centenarian == Near ancient. (Dan Fortier)
Heel claims == me, Achilles. (Paul Pan)
Remains hot == in a Thermos. (Adrian Hickford)
True friends == endure rifts. (Joe Fathallah)
Homo sapiens == Ape's son, IMHO. (Noam D. Elkies)
Internet spam == It's permanent. (Tom Myers)
Rats and mice == in cat's dream. (Joe Fathallah)
Metamorphosis == Promises a moth. (Andrew Brehaut)
A marble statue == Mute alabaster. (Rosie Perera)
Borderline case == Reconsiderable. (David Bourke)
Slices of bread == describes loaf. (Dean Mayer)
I'd do anything! == Had no dignity. (Tony Crafter)
Valentine amulets == Sentimental value. (Allan Morley)
Designated driver == Danger is diverted. (Mick Tully)
American education == An academic routine. (Jesse Frankovich)
Gone with the Wind? == Then weigh it down! (Toby Gottfried)
One thousand kilos == Oh, sounds like a ton! (Hans-Peter Reich)
Classified document == Found access limited. (Adrian Hickford)
A domestic housecat == Does it catch a mouse? (David Bourke)
An appointment diary != Pop in at any darn time. (Larry Brash)
Spaghetti & meatballs == Best light pasta meal. (Toby Gottfried)

(A quick note on notation: I’m using “==” when the meanings of the two sides of an anagram are roughly equivalent or apposite, “=” when the only relation is the component letters and “!=” when they are opposites.)

Recently, I used Mathematica to find well-mixed transposals among Wikipedia entries. Here are some of the longest transposals.

Patron client relationship = Phil Spector International
Ashland County Courthouse = Odontorhynchus aculeatus
Portuguese Marine Corps = Singapore Supreme Court
Human genetic history = Youth Training Scheme
Bisoprolol fumarate = Super Mario Football
Electron irradiation = Trilinear coordinate
Christmas Tree Lane = Thermal resistance
Operation Slapstick = Top sirloin cap steak
Diarrheic verbosity = Victoria Derbyshire
English literature = Euler straight line
Microwave heating = What More Can I Give
Natural gas price = Triangular space
Artificial organs = Raising factorial
Bravais lattice = Static variable
Arc de Triomphe = Picard theorem

I also had Mathematica look for well-mixed near misses.

National Security Adviser = East Carolina University + D
Presidential Motorcade = Spoiled Rotten America + D
Apartment building = Pandigital number + T
Senator John McCain = Nanomechatronics + J
Contemporary music = Computer acronyms + I
Princess Charlotte = Sharp Electronics + T

How does Mathematica find these? It checks a word list. DictionaryLookup["*"] gives a well-studied list of 92,518 words. There are also puzzler.org word lists, Wikipedia databases, wiktionary indices, crossword lists and Moby words, among others.

First, I read in a word list.

In[1]:= MathematicaWordlist = DictionaryLookup

After that, I can sort the letters in each word, and use that to find words with the same list of letters.

In[2]:= transposals =Sort[Select[Map[Last/@#&,Reverse[Sort[Split[Sort[ With[{letterlist=Select[ToLowerCase[Characters[#]], Not[MemberQ[{

The longest transposals look rather boring, since they are all minor variations:

In[3]:= TableForm[Take[transposals, 10]]

congregationalists congregationalists
congregationalist congregationalist
algorithmically logarithmically
representatives representatives
congregational congregational
establishments establishments
egocentrically geocentrically
certifications rectifications
consolidations disconsolation
conservatoires conservatories

The well-mixed transposals can be found by having Mathematica toss out the transposals that share too many short substrings.

In[4]:= wellmixedtransposals =Select[transposals,1.5Length[Complement[ Union[Partition[ToLowerCase[Characters[#[[1]]]],2,1,1]],Union[Partition[ToLowerCase[Characters[#[[2]]]],2,1,1]]]]> StringLength[#[[1]]]&];

With the above code, we can list the longest of the well-mixed transposals.

antiparticles paternalistic
conservatoire overreactions
aristotelian retaliations
obscurantist subtractions
definability identifiably
arthroscopes crapshooters
colonialists oscillations
enumerations mountaineers
importunates permutations
counterspies persecutions
capillarity piratically
animadverts maidservant
calendering greenlandic
grandnieces reascending
coordinates decorations
peripatetic precipitate
crenelation intolerance
arthroscope crapshooter
peristaltic triplicates
excitations intoxicates

By changing the word list, the longest well-mixed transposal changes.

Patron client relationship = Phil Spector International

Random House Webster’s Unabridged Dictionary, Second Edition:
secondary qualities = quasi-considerately

puzzlers.org allwords.txt:
condensation trails = nondictatorialness

Webster’s Unabridged Dicationary, Second Edition:
basiparachromatin = marsipobranchiata

Moby compound words:
second mortgage = seedcorn maggot

Moby single words:
cinematographer = megachiropteran

Merriam-Webster’s Collegiate Dictionary, Ninth Edition:
cephalometric = petrochemical

antiparticles = paternalistic

Only the Wikipedia list can find such oddities as Britney Spears = presbyterians. But the Wikipedia list has hundreds of thousands of misspelled words and spurious entries. Still, it’s a useful part of my toolbox for finding word oddities.

Download this post as a Wolfram Notebook.


Join the discussion

!Please enter your comment (at least 5 characters).

!Please enter your name.

!Please enter a valid email address.

1 comment