Reverse engineering numeric letter combinations

JoshGmara

New member
Joined
Oct 24, 2021
Messages
2
The list of x (say 2, 3, 4...) letter combination taking into account any combination of letters is possible is quite easy - using the English alphabet, which has 26 letters in this case, 26^2, 26^3, 26^4 would give the the amount in numbers of all the possibilities. Now, the problem is having combination of letters (AAG, ZNBA, AXCF or any other combinations) and getting the exact number they would be if we agree on having A as 1, Z as 26, AA as 27; so on and so forth. How can I get the exact number for each combination?

You can use any letter combination as an example, JNHD, PLITS... whatever, how can you get the number associated with the letter sequence?

(I hope this post belongs here, I just guessed, sorry if not)
 
The list of x (say 2, 3, 4...) letter combination taking into account any combination of letters is possible is quite easy - using the English alphabet, which has 26 letters in this case, 26^2, 26^3, 26^4 would give the the amount in numbers of all the possibilities. Now, the problem is having combination of letters (AAG, ZNBA, AXCF or any other combinations) and getting the exact number they would be if we agree on having A as 1, Z as 26, AA as 27; so on and so forth. How can I get the exact number for each combination?

You can use any letter combination as an example, JNHD, PLITS... whatever, how can you get the number associated with the letter sequence?
Are you talking about listing words alphabetically, after grouping by length? That essentially means treating a word as a base-26 number, except that there is no zero.

If so, then I'd think about methods for converting numbers to base ten, and then how to compensate for not having a zero.

I'm not putting any effort into that until the meaning of your question is confirmed. I'd also be interested in knowing why you ask -- do you have an application in mind, or is it for a class, or for curiosity? And what effort have you put into answering your own question?

 
The only application is getting the number associated. I haven't thought how could that be used. It is out of curiosity, because I was messing with numbers today and asked myself how to reverse engineer the numbers associated with letters in consecutive succession. Not class related either, I am an artist, my curiosity in science and math is just a hobby. This is what I have thought, messing around with my brother after posting the question:

A=1, B=2, C=3, etc - until Z=26. AA's value is 27, so AB=28, AC=29... Therefore If there are 26 letters; to get the first A in AA to a Z we did 26^2. After that operation, we simply added +26 to get the second A in AA from A to Z. In other words: ZZ= 26^2+26=702. ZZ being associated with the number 702 means that the next value associated with a letter letter is 703 for AAA.

If we wanted to get the number associated with any other 2 letters combination, say GK. G is the 7th letter and K is the11th. Therefore GK's value: 26*7+11=193. WW, as another example, being W the 23rd letter then: 26*23 + 23=621. So WW's value would be 621.

If we wanted to get the number associated with any number of 3 letters, say for example CBC, and taking into account that A's value is 703 only when accompanied with any other 2 letters (A value is 703 as long as AXX, X being any other letter). Then because C is the third letter, to get the first letter value 703*3 + (26*2 which is the second value of the second letter, B + 3 which is the value of the last C in CBC). Therefore CBC= [(703*3)+(26*2+3)]=2109+55=2164. So The value of CBC is 2164.

Following the same procedure, ZZZ= 703*26+(26^2+26)=18980. So AAAA's value would be 18981.

What I am not entirely sure is if every rotation (Every time any other A apart from the first one on the left reaches Z and goes back to A, adding one more letter on the right) we should add a +1 to the total value. That would make everything much, much more complicated. If that was the case all our operations would be wrong, most likely.
 
Top