Alright, Puzzlers, let's get back on track with this week's Sunday Puzzle from NPR:
This week's challenge comes from Michael Shteyman of Freeland, Md. Think of a popular tourist attraction in two words. The second, fourth, and sixth letters of the second word, in order, spell the first name of a famous author. The last four letters of the first word spell the author's last name. Who is the author, and what is the tourist attraction?
Well this certainly looks do-able; it's a lot like this one we solved back in July. Let's break it down a little.
This puzzle, like probably 90% of the Sunday Puzzles we've looked at, follows the form:
transform(string_a) = string_b
In other words, we apply some transform function to string_a to yield string_b. As usual, we know what the function is; our task is to find string_a and string_b.
What do we need in order to solve this?
- A: a list of candidates for string_a;
- "a popular tourist attraction in two words"
- first word must be 5 or more letters;
- technically, it could be 4 letters, but we typically wouldn't refer to "the last four letters" of a 4 letter word, right?
- second word must be 6 or more letters;
- Eiffel Tower, Grand Canyon, Buckingham Palace, Times Square, etc.
- B: a list of candidates for string_b;
- "a famous author"
- first name has 3 letters;
- last name has 4 letters;
- transform function;
- code this in Python;
- select letters from string_a candidates in A to form string_b candidates and compare against B until we find a match;
So we need
A, a list of popular tourist attractions with 2-word names. We could use a language modeling tool like SBERT or Word2Vec to come up with candidates by providing some seed terms or some sentences with blanks for the model to fill in. We've done this a few times before, like
when we needed candidate words for "something birds do", for example. But "something birds do" can be difficult to list thoroughly off the top of our heads, and it's not something we can easily search the web to find a list for.
A and
B are both pretty straightforward, and
they're things people love to make lists of! We shouldn't need to reinvent the wheel here; let's look for appropriate lists online. I suspect searching for "top 1000 authors" and "best 200 tourist attractions" or the like will turn up some lists we use.
Then we'll filter things out of the lists that don't meet the requirements for letter counts, and the script will be very short; it just needs to iterate through one list, pull out and concatenate the letters and check the resulting string against the list of authors.
OK, so that's the NLP nerd approach, but most people playing the Sunday Puzzle aren't computational lingusts, so how would one solve it without this approach? The NPR hosts always announce how many correct answers they got, and it's usually in the range of 300--2000 people. I suspect this one will be closer to 2000, because it should be fairly easy to simply start visually scanning lists of authors to find one with two names: 3, 4 (letters). There can't be many that would be on "famous" lists for US English speakers. Obviously there could be very many for, for example, Chinese (in pinyin) but those wouldn't be famous to most of our target audience. So if we had a small number of author names, we could reconstruct what we know about the tourist attraction name and try to fill in the rest. For example, let's say we have an author named May Fitz, we know the tourist attraction must look like: (_*)fitz _m_a_y(_*), where---and please pardon my poor regex notation---we can have any number of letters before fitz, and any number of letters after _m_a_y.
Good luck out there this week! I'll be back after Thursday's NPR deadline to share my solution---scout's honor!
Levi