Jumble algorithm: Difference between revisions
JohnCarlo13 (talk | contribs) |
Template cite web |
||
Line 1: | Line 1: | ||
{{about|algorithms to solve and create the word game||Jumble (disambiguation)}} |
{{about|algorithms to solve and create the word game||Jumble (disambiguation)}} |
||
{{ |
{{More references|date=June 2015}} |
||
Each clue in a [[Jumble]] word puzzle is a word that has been “jumbled” by permuting the letters of each word to make an [[anagram]]. A dictionary of such anagrams may be used to solve puzzles or verify that a jumbled word is unique when creating puzzles. |
Each clue in a [[Jumble]] word puzzle is a word that has been “jumbled” by permuting the letters of each word to make an [[anagram]]. A dictionary of such anagrams may be used to solve puzzles or verify that a jumbled word is unique when creating puzzles. |
||
==Computerized solution== |
==Computerized solution== |
||
Algorithms have been designed to solve Jumbles, using a dictionary. Common algorithms work by printing all words that can be formed from a set of letters. The |
Algorithms have been designed to solve Jumbles, using a dictionary. Common algorithms work by printing all words that can be formed from a set of letters. The solver then chooses the right word.<ref name="Jumble Solver">{{cite web|url=https://thejumblesolver.com |title=Jumble Solver |website=thejumblesolver.com |access-date=2021-02-09}}</ref> |
||
First algorithm: |
First algorithm: |
||
Line 78: | Line 78: | ||
The program doesn't rely on a dictionary and doesn't try to find real English words, but rather words that could be English, exploiting a database of plausibilities for various combinations of letters. |
The program doesn't rely on a dictionary and doesn't try to find real English words, but rather words that could be English, exploiting a database of plausibilities for various combinations of letters. |
||
Letters are combined non-deterministically, following a strategy inspired by chemical reactions and free associations. |
Letters are combined non-deterministically, following a strategy inspired by chemical reactions and free associations. |
||
==References== |
|||
{{Reflist}} |
|||
[[Category:Algorithms]] |
[[Category:Algorithms]] |
Revision as of 06:57, 9 February 2021
This article needs additional citations for verification. (June 2015) |
Each clue in a Jumble word puzzle is a word that has been “jumbled” by permuting the letters of each word to make an anagram. A dictionary of such anagrams may be used to solve puzzles or verify that a jumbled word is unique when creating puzzles.
Computerized solution
Algorithms have been designed to solve Jumbles, using a dictionary. Common algorithms work by printing all words that can be formed from a set of letters. The solver then chooses the right word.[1]
First algorithm:
- Begin
- Input: J, all the jumbled letters that form an unknown W word(s)
- Sort the letters of J in alphabetical order, preserving duplicates
- Look up sorted letters in a hash table, initialised with a dictionary, that maps a sorted set of letters to unscrambled words
- Print the set of words, which is W
- End
Second algorithm:
- Begin
- Input: J, all the jumbled letters that form an unknown W word(s)
- Frame a word list Y with all permutations of J
- For each word in Y check if the word is existing in the dictionary
- If a match is found then collect it in word list W
- Print the words in W
- End
Algorithm to find the permutations of J:
- Begin
- Initialize a string with first character of J denoted by J(1)
- Add the second character of J denoted by J(2) on either side of J(1) to get two strings
J(1)J(2)
J(2)J(1)
- Add the third character of J denoted by J(3) on either side and in between the above 2 strings to get 6 strings
J(1)J(2)J(3)
J(1)J(3)J(2)
J(3)J(1)J(2)
J(2)J(1)J(3)
J(2)J(3)J(1)
J(3)J(2)J(1)
- In the same way add J(4) to each of the above strings in either sides and between two characters to get 24 strings
- Continue this until all the characters are completed
Though the algorithm looks complex it is easy to program.
Douglas Hofstadter developed a program called Jumbo that tries to solve Jumble problems as a human mind would. The program doesn't rely on a dictionary and doesn't try to find real English words, but rather words that could be English, exploiting a database of plausibilities for various combinations of letters. Letters are combined non-deterministically, following a strategy inspired by chemical reactions and free associations.
References
- ^ "Jumble Solver". thejumblesolver.com. Retrieved 2021-02-09.