Orion1
- 961
- 3
I am attempting to solve an anagram game puzzle just for fun, however what is difficult is the number of possible combinations for a typical anagram.
For example, in DNA there are 4 bases 'A','C','G','T'.
The equation that I derive for the number of possible combinations is:
N_c = N_b^L
N_b - base unit number
L - base unit length
So, for one base of length L = 1, there are 4 combinations:
N_c = 4^1 = 4
Increasing the length to L = 4, there are 256 combinations:
N_c = 4^4 = 256
However, for English word anagram descrambling there are 26 base unit letters.
So, for one base of length L = 1, there are 26 combinations:
N_c = 26^1 = 26
Increasing the length to L = 4, there are 456976 combinations:
N_c = 26^4 = 456976
I am inquiring if any programmers here can write a simple program in Basic or in Visual Basic, with a better logistical code than I can write that does not require a lot of computational algorithmic cycles for descrambling an input anagram word and output all the possible combinations, for example:
input: edco
N_c = 4^4 = 256 - maximum combination number for input anagram word?
output 1: deco
...
output n: code
...
I am not certain that the number of possible combinations equation that I have stated is accurate for scrambled anagram words, since each anagram letter can only be used once in a sequence. So what would the equation be for a scrambled anagram word?
[/Color]
Reference:
http://en.wikipedia.org/wiki/Anagram"
Last edited by a moderator: