Results 1 to 2 of 2

Math Help - Create Unique ID

  1. #1
    DeNutza
    Guest

    Create Unique ID

    If I have 3 groups: each holding a distinct # of combinations:

    Group A(1 to 3) B(1 to 2) and C(1 to 3)

    How can I create a unique "sequential" ID for each unique
    possibility? (There are 18 possibilities in this example,
    so I would need an ID from 1 to 18 for each one)

    so from 1 to total # of combinations as the ID.

    Also note if A= 1, B=1, C=2 you cannot simply multiply since
    if A=2, B=1, C=1 it produces the same ID.


    Your help is appreciated.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    hpe
    hpe is offline
    Member hpe's Avatar
    Joined
    Apr 2005
    Posts
    158
    Suppose you have an element with groups A=a, B=b, C=c.

    Use the formula x = (a-1)*6 + (b-1)*3 + (c-1) to make an identifier x between 0 and 17.

    This is unique: To recover (a,b,c) from x, first divide x by 6 with remainder, x = 6z+y. Then a = z+1. Next divide y by 3 with remainder, y = 3t+r. Then b = t+1 and c = r+1.

    Example: A-group = 2, B-group = 1, C-group = 3. Then a = 1, b = 0, c = 2, and x = 6 + 2 = 8. To recover a, b, and c, you can compute

    8 = 1*6 + 2, so a = 1+1 = 2.
    2 = 0*3 + 2, so b = 0+1 = 1 and c = 2+1 = 3.
    Last edited by hpe; June 1st 2005 at 10:31 AM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. create graphs
    Posted in the Math Software Forum
    Replies: 3
    Last Post: April 24th 2011, 08:46 AM
  2. create a field
    Posted in the Advanced Algebra Forum
    Replies: 1
    Last Post: June 18th 2010, 10:51 AM
  3. create function
    Posted in the Discrete Math Forum
    Replies: 2
    Last Post: July 5th 2009, 06:29 PM
  4. How To - Create an Index
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: March 25th 2009, 04:34 PM
  5. create a polynomial...
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: August 30th 2008, 04:18 PM

/mathhelpforum @mathhelpforum