1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Can the 1296 permutation ever be extended?

  1. May 21, 2013 #1
    Hi everyone,

    I have a problem I'm trying to solve. If anybody can help it would be greatly appreciated. (PS: My understanding of maths is so poor I don't even understand the meaning of half the forum titles so please excuse me if I've posted in the wrong section..!)

    All the possible 2 character permutations using 0 to 9 and A to Z = 1296. ie:

    00, 01, A1, A2, B1 ~ Z0, Z9, ZZ etc, etc..

    There is a system here at work where a User has to enter a 2 character code into a database. Of course, we will eventually run out of codes to use. I am trying to determine if it is possible to continue to use a 2 digit Alpha/Numeric character but extend the 1296 limit in some way?

    I'm wondering if a lateral shift in thinking can break the 1296 limit. Hopefully, someone from a mathematical bacground can throw some ideas into the mix?

    One thought I had was, can 2 characters be used as variables in a calculation to produce a 3rd number? For example, two digits are combined to produce a 3rd number: ie, 23 could be 2 + 3 or 2 * 3 or 2 ^ 3. MZ could be translated as 13 + 26 (ie: 13th and 26th letter of the alphabet)

    Another idea is representation. For example, 3/4 can also be represented as 75 (percent). Is there another way to interpret a set of values?

    I understand that the database can be altered to allow more charcaters but for many reasons, this is a very last resort. I also appreciate it was short-sighted of the database designer to only allow 2 characters in the first place, but we are where we are..

    Any thoughts greatly appreciated, many thanks,

  2. jcsd
  3. May 21, 2013 #2


    User Avatar
    Science Advisor

    Using the 36 symbols, 0, 1, 2, 3, ..., 9, A, B, C, ..., Z, yes, we can have [itex]36^2= 1296[/itex] pairings. To extend it just make up new symbols- if you have n symbols, you will have [itex]n^2[/itex] symbols.
  4. May 21, 2013 #3


    Staff: Mentor

    You can use the punctuation characters to extend the character set but may have to be careful about certain ones like quote and double quote and possibly ` and \ causing problems. Issues you may find in using punctuation includes general code confusion by your database users when they see something like "3," and think its really "3".

    If I were you, I'd seriously consider getting this design limitation fixed. It can only bite you later on when you least afford it.

    Are you using a SQL database? or is this some kind of custom built database?

    For SQL there are tools to backup the database and migrate to a new schema (tables and column descriptions).Depending on the vendor, there are SQL commands to extend a given column to accept more characters. You'd still need to review/change your programs that access the database.

    This reminds me of the Y2K dilemma of a few years ago where people were trying to finagle their old databases to handle larger dates by doing a rolling type of date and essentially kicking the can down the road a bit.
  5. May 21, 2013 #4


    User Avatar
    Homework Helper

    Any mathematical operations would just change the values, but you'd still be stuck with 1296 unique values. Could you make this case sensitive so that lower case letters are different than upper case letters? This would extend the number of values to (10+26+26)^2 = 62^2 = 3844.

    The other option as mentioned above is to change the database so that the keys have more characters, such as 4, resulting in 36^4 = 1679616 unique keys.
  6. May 21, 2013 #5


    Staff: Mentor

    if the database allotted only two characters then with the proper input conversion, the enduser cuold use hexidecimal code instead of a two character code. this would eliminate the danger of adding the punctuation into the mix.

    If the characters are stored as ASCII (ie 8-bits per character) then that would allow for a 4 digit hexidecimal code: 0000 ... FFFF -or- over 32000 possible choices.

    However the existing code scheme would have to be revamped or remapped to hexidecimal input format ie You could no longer have a code containing the letters G-Z or g-z.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook