Hi All,
My first post so please be gentle if this is the wrong area. My classical math is also very lacking so sorry if wrong terminology used etc.
Anyway - onto my issue.
So essentially Im mapping the alphabet to incrementing numbers,
a=1
b=2
c=3 etc etc
i have 3 random letters, which are taken as input, i then convert the letters to numbers, add them, and total.
for instance,
aaa= 3 (1+1+1)
abc= 6 (1+2+3)
now my issue is this, i want to give a unique number to any combination(3 digits max) of letters that comes in, however
abc = 6
cab = 6
cba = 6
while unique combinations of letters, they do not result in unique combinations of numbers.
I initially took to adding based on position (adding 1 to first letter, 2 to 2nd letter, 3 to 3rd)
abc = (1+1) (2+2) (3+3)
cab = (3+1) (1+2) (2+3)
however this comes undone with combinations such as;
lsj / rmj 13+21+13 / 19 +15 +13 = 47
Is there any thing / any operation i can do, that will result in a unique integer for each set of numbers?
My first post so please be gentle if this is the wrong area. My classical math is also very lacking so sorry if wrong terminology used etc.
Anyway - onto my issue.
So essentially Im mapping the alphabet to incrementing numbers,
a=1
b=2
c=3 etc etc
i have 3 random letters, which are taken as input, i then convert the letters to numbers, add them, and total.
for instance,
aaa= 3 (1+1+1)
abc= 6 (1+2+3)
now my issue is this, i want to give a unique number to any combination(3 digits max) of letters that comes in, however
abc = 6
cab = 6
cba = 6
while unique combinations of letters, they do not result in unique combinations of numbers.
I initially took to adding based on position (adding 1 to first letter, 2 to 2nd letter, 3 to 3rd)
abc = (1+1) (2+2) (3+3)
cab = (3+1) (1+2) (2+3)
however this comes undone with combinations such as;
lsj / rmj 13+21+13 / 19 +15 +13 = 47
Is there any thing / any operation i can do, that will result in a unique integer for each set of numbers?
Last edited: