Results 1 to 1 of 1

Math Help - Desigining an algorithm

  1. #1
    Legend
    Guest

    Desigining an algorithm

    I need some help designing a better approach to a problem. The following is the problem I'm working on:

    FIRST STEP:

    The data I have:
    Column A: P1, P2, P3,....., Pn
    Column B: A1, A2, A3,.....,An

    And, P1 corresponds to A1 and P2 corresponds to A2 and so on. In other words, they are linked in some way.

    In Column B, for every consecutive Aa, Ab, if there is a change then the corresponding Pa and Pb belong to the same set Ca.

    So for example, consider the following:

    Column A: 12, 14, 16, 17, 32, 45, 56, 65
    Column B: 1, 1, 1, 2, 2, 2, 3, 3


    In this case, 16, 17 come under the same group, 45 and 56 come under the same group and we write them as {16,17}, {45,56}.


    SECOND STEP:

    Now consider many such columns. For example, Column C and Column D linked up in same way. In similar fashion, consider other columns taking two columns to be linked with each other in the following way:

    Column A: 12, 14, 16, 17, 32, 45, 56, 65
    Column B: 1, 1, 1, 2, 2, 2, 3, 3
    Output from First Step: {16,17}, {45,56}

    Column C: 12, 14, 16, 18, 32, 45, 566, 65
    Column D: 1, 1, 2, 2, 2, 2, 3, 4
    Output from First Step: {14,16}, {45,566}

    Column E: 12, 14, 16, 57, 32, 45, 256, 65
    Column F: 1, 1, 1, 2, 2, 3, 3, 4
    Output from First Step: {16,57}, {32,45}, {256,65}

    Column G: 12, 14, 16, 12, 32, 45, 576, 65
    Column H: 1, 1, 1, 2, 2, 3, 4, 4
    Output from First Step: {16,12}, {32,45},{45,576}

    In the second step, we need to compare the results of each of the above outputs with each other. Take a set {a1,b1} from Columns A & B and {a2,b2} from Columns C & D, then if a1 = a2, the both of these form the same set and should be written as {{a1,b1},{a2,b2}} and similarly others.

    So logically speaking, we need to take each and every element and compare with the rest of the elements and see if they're equal and if a match is found, we need to dump them into a group.

    I want to calculate the total number of steps it requires to sort it in the said manner and the order of complexity of the algorithm and ofcourse, a meaningful approach. Can someone help with get started with this please?

    I've attached an image too...
    Attached Thumbnails Attached Thumbnails Desigining an algorithm-screenshot009.gif  
    Last edited by Legend; October 4th 2007 at 05:01 PM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Set in an algorithm
    Posted in the Discrete Math Forum
    Replies: 6
    Last Post: December 18th 2011, 10:36 AM
  2. Algorithm
    Posted in the Advanced Math Topics Forum
    Replies: 7
    Last Post: November 22nd 2009, 07:11 AM
  3. Algorithm
    Posted in the Discrete Math Forum
    Replies: 3
    Last Post: June 23rd 2009, 10:43 AM
  4. Algorithm help
    Posted in the Advanced Math Topics Forum
    Replies: 9
    Last Post: April 29th 2009, 10:15 PM
  5. algorithm
    Posted in the Discrete Math Forum
    Replies: 1
    Last Post: January 28th 2009, 10:17 PM

Search Tags


/mathhelpforum @mathhelpforum