Paws step. Pets swap!

Once we got onto the subject of words, I started thinking about how words can be distinguished not by their meaning, but by their lexical form.

For example, suppose we consider every word in the English language that, when its letter order is reversed, forms a different word. This evening I did a quick computer analysis, starting from a rather comprehensive word list.

To my surprise, I found only 155 such pairs of words altogether (see below).

Somehow I’d thought there would have been more.

8 thoughts on “Paws step. Pets swap!”

1. Sharon says:

Interesting. What happens if you extend your analysis to general anagram pairs, rather than just reversing the letters?

Incidentally, try a Google search for “anagram”. I never saw that one before ðŸ™‚

I’m sure it’s a vastly greater number. After all, the number of different words you get by reversing a word can only be either zero (in the case where the word is a palindrome) or one.

The number of different words you might get by permutation is far larger. Consider a word as a string of letters:

AiBjCk

where each superscript denotes the number of times that letter is repeated.

The number of unique permutations of that string of letters is:

(i+j+k…)! / (i! j! k! …)

That factorial in the numerator is going to grow a lot faster than anything happening in the denominator. For most words the number of letter combinations to include in the search is going to be a really large number.

3. Sharon says:

Given that you have the word list, I’m thinking that you could find the anagrams by sorting the letters in each word and then sorting the list. E.g., if your list of words is

pots
pits
spot
stop
tips
tops

prepend each word with the string you get from sorting its letters and then sort the list by the first column to get:

ipst pits
ipst tips
opst pots
opst spot
opst stop
opst tops

The groups of repeated lines (by first column) will give you the words that are anagrams of one another. That works, doesn’t it?

Sure, absolutely!

By the way, apres, reaps, rapes, spear, pears, pares, spare, parse, and prase are all anagrams of each other, so there are a few interesting cases out there.

5. ThePig says:

Which word list did you use?

Using /usr/share/dict/web2 on my macbook, I get 465 pairs.

Some pairs are quite obscure, e.g. diorama/amaroid. On the other hand, leveler/relevel seems proper.

Ah, that’s great. You clearly are using a better wordlist than the one I had. I just used one I had lying around from some years ago, and I couldn’t even say now where it originally came from.

465 word pairs might allow the construction of a much more interesting set of word-bounded palindromic sentences!!

I wonder whether we can assign fractional values to pairs that use iffy words. Perhaps an algorithm can be derived from the results of a Google search to assign a reasonable fractional value of properness to any word.

7. ThePig says:

The most interesting pair I’ve seen so far is daraf/farad. Someone very clever named the daraf.