Monday, February 12, 2024

Movie stars and the movies they star in

I have a little time on my hands lately so let's solve some puzzles!

*Update: For the solution to this puzzle, scroll to the bottom of this post.

This week's Sunday Puzzle from NPR:

This week's challenge: Is from our puzzler friend A.J. Jacobs. Start with the name of a blockbuster movie star. Remove the first letter of the first name and last two letters of the last name to get the types of movies he almost never stars in. Who is this?

This is a classic puzzle form: Apply the given transformation to one thing to get another thing. More formally, we could say that there exists a movie star (m) for which the function z returns a type (t).

Better yet, I think we could express this as:

mM, ∃ tT : z(m) = t

Roughly:

There exists some m which is a member of M,

AND there exists some t which is a member of T

Such that the function z applied to m results in t.

Of course z is already defined for us: Remove the first letter of the first name and last two letters of the last name.

M is our set of blockbuster movie star names, and "he" in the clue tells us this is a list of men.

T is our set of "types of movies".

How would you approach this puzzle?

As a computational linguist and veteran puzzler, here's my approach:

  • Get a cleaned up list of the top male movie actors (M)
    • Note that this is not a closed class, like "state capitals" or "Best Actor Oscar Winners", so we'll never be certain that our list is comprehensive and includes the correct candidate. In a case like this, I'll aim for a list of at least 100 candidates.
    • We could ask our favorite chatbot, but I found a list here we can copy and clean:
  • Get a cleaned up list of types of movies (T)
    • We could ask a chatbot or scrape this from Wikipedia.
  • Create a python script:
    • create string transformation function
    • iterate through M
      • apply transformation function
      • compare resulting string with T for a match
And that's essentially what I've done in this python script I've shared on GitHub. I've hard coded both lists (M and T) into the script, which you may want to copy and paste into your own python approach to the puzzle. Good luck, and let's check in after the Thursday submission deadline with the solution.


Update: Now that the deadline for submissions has passed, it's fair to post my solution here: 

Did you get the same solution?

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