Maybe "solve" isn't quite the right word, but it still got me 90% of the way there...
My 7-year-old has one of those "word" locks for his bicycle a cable lock whose combination has four dials, each with 10 different letters on it. Unfortunately, he didn't use the lock for several months, and when he tried to open it this morning he realized he had forgotten his combination.
We tried the obvious candidates: "poop," "burp," and so on. But nothing worked. I tried a few different physical hacks, but likewise without any success. But then I had an idea: we knew he had chosen a real word for his combination, and not just a random combination of 4 letters... so if I could generate a list of all the possible words you could make with the lock, maybe he'd spot something that would jar his memory.
I started out by typing the letters on each dial into a note on my phone, and emailed it to myself. Then I pasted that into Mathematica and assigned it to a variable:
In[10]:= letters = "B F r m d t s w p l
E l o I a u y r w h
K s n t m r e l a o
L y p e t s m k g d ";
Then a little string processing:
In[11]:= dials = (ToLowerCase /@ StringSplit[#]) & /@
StringSplit[letters, "\n"]
Out[11]= {{"b", "f", "r", "m", "d", "t", "s", "w", "p", "l"}, {"e",
"l", "o", "i", "a", "u", "y", "r", "w", "h"}, {"k", "s", "n", "t",
"m", "r", "e", "l", "a", "o"}, {"l", "y", "p", "e", "t", "s", "m",
"k", "g", "d"}}
Then get all the possible combinations of letters, taking one letter from each dial, and join them into strings:
In[12]:= tup = Tuples[dials];
In[13]:= strings = StringJoin /@ tup;
And last, select all the words recognized by the internal spelling dictionary:
In[14]:= words = Select[strings, DictionaryWordQ];
So I ended up with a list of 843 words that we could easily scan through together... and amazingly enough, the forgotten combination happened to be within the first few dozen words of the resulting list.
In[17]:= Shallow[words]
Out[17]//Shallow= {"best", "bent", "bend", "bets", "berm", "berk", \
"berg", "beep", "beet", "bees", <<833>>}