Sunday, August 01, 2021

Britishisms and Heroes (Preview)

Hello, Puzzlers! Another Sunday, another Sunday Puzzle from NPR Puzzlemaster Will Shortz:

This week's challenge: This week's challenge comes from listener Chad Graham, of Philadelphia. Think of a common Britishism — a word that the British use that's not common in the U.S. Write it in all capital letters. Turn it upside-down (that is, rotate it 180 degrees). The result is a famous hero of books and movies. Who is it?

Let's begin with our usual breakdown of the puzzle. Note that it's a variation on the most common type of puzzle we see here: transform_fx(string1) = string2. In other words, we are solving for string1 and string2, where applying some transformation to string1 yields string2. In this case, we have some general "class" information about the two strings, as well as a defined transformation function. Note that the "rotate 180 degrees" part of this puzzle also occurred in a puzzle we solved just this June. However, in that case, we were rotating letter by letter, but this time, we're rotating the whole word. When we rotate a whole word, the last letter becomes the first letter (upside-down now), and vice versa. We can account for this in our solver script by reversing the order of the letters, then using our dictionary to rotate each letter in place.

As usual with this kind of puzzle, we'll want to start with a long list of candidates for string1 and a long list of candidates for string2. We'll iterate through the first list, applying the transformation to each string and checking if the resulting string appears in the second list.

So what do we need for this puzzle?

  • B: a list of "Britishisms";
  • H: a list of heroes from books and movies;
  • R180: A dictionary mapping of capital letters that can be rotated 180 degrees to form a new letter, e.g., {'M': 'W', ...};
We have a rotation dictionary (R180) we can start with, in this script. However, that puzzle called only for capital letters. In this case, the puzzle doesn't specify upper or lowercase, so we'll probably need to expand this dictionary to include lowercase. I'm not sure if the solution strings will mix upper and lowercase, but we probably want to allow for the possibility; Will can be tricky.

For B, I suspect our best bet is to spend a few minutes searching the web for such a list. Surely some anglophile has produced one on the web for other purposes already. Otherwise, we could theoretically do something like:
  1. Find/assemble a large corpus of British English;
    1. It could be a challenge to find a corpus for both written (e.g., newspaper) and spoken or vernacular English that contains exclusively British English;
  2. Find/assemble a large corpus of American English;
    1. Same challenge here;
  3. Calculate the relative frequency of each word type in the British corpus;
  4. Calculate the relative frequency of each word type in the American corpus;
  5. For each word type in the British corpus, keep the word if it is significantly more frequent in the British corpus than in the American corpus;
    1. This would take some trial and error to determine just how large the difference in frequency should be;
That certainly could be done, but it might be more than we want to take on for a hobby blog. For that reason, I think searching for an existing list of Britishisms is our best bet.

For H, we can probably find a suitable list around the web somewhere. If not we can probably get a pretty good list just by brainstorming for a few minutes. Crucially, I'm under the assumption that string1 and string2 are each single words, no spaces. So that should narrow it down a bit. We're probably also looking for fairly short strings, simply because the probability that a word will form a legitimate word when we rotate it 180 degrees is going to decrease for longer words. The fact that we're interested in a hero from books and movies may also help limit our list.

Okay, Puzzlers, I'm going to poke at this for a couple days and hopefully I'll have a solution to show for it later this week. Cheers!

--Levi King

No comments:

Post a Comment

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...