Monday, February 01, 2021

State borders and scrambled spelling (Preview)

 Welcome back, Puzzlers! Let's take a look at the new Sunday Puzzle:

This week's challenge comes from listener Derrick Niederman, of Charleston, S.C. Starting in Montana, you can drive into South Dakota and then into Iowa. Those three states have the postal abbreviations MT, SD, and IA — whose letters can be rearranged to spell AMIDST. The challenge is to do this with four connected states to make an eight-letter word. That is, start in a certain state, drive to another, then another, and then another. Take the postal abbreviations of the four states you visit, mix the letters up, and use them to spell a common eight-letter word. Derrick and I know of only one answer. Can you do this?

On the surface, this looks complicated, but let's break it down and do some brainstorming.

What resources do we need here?

  1. B: a list of state borders (preferably using two-letter postal abbreviations)
  2. E: an English lexicon
That's it, really. This puzzle won't really involve much NLP, just some string manipulation. Assuming we have a list B (for borders) of state borders, we need a bit of scripting to iterate through that list and produce a new list Q (for "quads"?of all the sets of four US states that one can drive through consecutively, as described above.

Next, we can can reduce E to O (for "octo-"?), a list containing only the 8-letter words from the lexicon.

Finally, we iterate through Q, comparing the 8 letters in the state abbreviations to the 8 letters in each word, until we find a match. This is sure to be a lot of computation, but off the top of my head I don't have a guess for the length of Q or O. We may want to think of some ways to prune here. For example, if I recall correctly, there is no letter "q" in any state abbreviation, so we can remove any words with "q" from O. We could also remove from Q any set that does not contain at least 1 vowel. Or maybe 2 vowels?

Where do we find B, our list of borders, by the way? Naturally, I checked Wikipedia, but I didn't quite find what I wanted. Web search turned up this page, however, which lists the states and their bordering states.

And where do we find E, an English lexicon? I found a GitHub repo hosting multiple versions of English lexicons; the documentation there notes that this version contains only words that have only letters, no numbers or symbols, so I'll definitely be using that one.

Good luck this week! I'll see you back here for the solution.

--Levi

 

Director, anagram, film award

Welcome back to Natural Language Puzzling, the blog where we use natural language processing and linguistics to solve the Sunday Puzzle from...