Results 1 to 4 of 4

Math Help - Pseudorandom integer sequence having at least 15 adjacent differences > 36

  1. #1
    Newbie
    Joined
    May 2010
    Posts
    3

    Pseudorandom integer sequence having at least 15 adjacent differences > 36

    The requirement is to find an pseudorandom integer sequence i0, i1, i2, i3, ... , i48, i49 so that there are at least 15 adjacent differences which are greater than 36.
    Code:
    Adjacent difference = absolute value of the difference between two adjacent integers
    = |i  - i   |  where j = 0 to 49 
      | j -  j+1|
    and
     i  =  an integer in the range of [1, 2, 3, ..., 50]
      j
    e.g.
    For this integer sequence (very poor in randomness)
    1 39 2 40 3 41 4 42 5 43 6 44 7 45 8 46 9 47 10 48 11 49 12 50 13 26 14 27 15 28 16 29 17 30 18 31 19 32 20 33 21 34 22 35 23 36 24 37 25 38


    i0 = 1
    i1 = 39
    i2 = 2
    i3 = 40
    i4 = 3
    ...
    i47 = 37
    i48 = 25
    i49 = 38

    Adjacent difference
    |i0 - i1| = |1 - 39| = 38
    |i1 - i2| = |39 - 2| = 37
    |i2 - i3| = |2 - 40| = 38
    |i3 - i4| = |40 - 3| = 37
    ...
    |i23 - i24| = |50 - 13| = 37
    |i24 - i25| = |13 - 26| = 13
    ...
    |i46 - i47| = |24 - 37| = 13
    |i47 - i48| = |37 - 25| = 12
    |i48 - i49| = |25 - 38| = 13

    There are 24 adjacent differences which are greater than 36.
    Is there an algorithm to find an pseudorandom integer sequence which meet the requirement?
    One algorithm I can think of is:
    1. Create a not-random integer sequence which has at least 15 adjacent differences which are greater than 36.
    e.g. the above integer sequence alternates between a small and large integer
    2. Randomlly select two odd-indexed integer.
    If swapping them still meet the requirement, then swap them
    3. Randomlly select two even-indexed integer.
    If swapping them still meet the requirement, then swap them
    4. Repeat steps 2 and 3 many times

    I will write a computer program to implement this.
    Please comment or suggest a better algorithm.
    Last edited by tcma; May 29th 2010 at 04:00 PM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by tcma View Post
    The requirement is to find an pseudorandom integer sequence i0, i1, i2, i3, ... , i48, i49 so that there are at least 15 adjacent differences which are greater than 36.
    Code:
    Adjacent difference = absolute value of the difference between two adjacent integers
    = |i  - i   |  where j = 0 to 49 
      | j -  j+1|
    and
     i  =  an integer in the range of [1, 2, 3, ..., 50]
      j
    e.g.
    For this integer sequence (very poor in randomness)
    1 39 2 40 3 41 4 42 5 43 6 44 7 45 8 46 9 47 10 48 11 49 12 50 13 26 14 27 15 28 16 29 17 30 18 31 19 32 20 33 21 34 22 35 23 36 24 37 25 38


    i0 = 1
    i1 = 39
    i2 = 2
    i3 = 40
    i4 = 3
    ...
    i47 = 37
    i48 = 25
    i49 = 38

    Adjacent difference
    |i0 - i1| = |1 - 39| = 38
    |i1 - i2| = |39 - 2| = 37
    |i2 - i3| = |2 - 40| = 38
    |i3 - i4| = |40 - 3| = 37
    ...
    |i23 - i24| = |50 - 13| = 37
    |i24 - i25| = |13 - 26| = 13
    ...
    |i46 - i47| = |24 - 37| = 13
    |i47 - i48| = |37 - 25| = 12
    |i48 - i49| = |25 - 38| = 13

    There are 24 adjacent differences which are greater than 36.
    Is there an algorithm to find an pseudorandom integer sequence which meet the requirement?
    One algorithm I can think of is:
    1. Create a not-random integer sequence which has at least 15 adjacent differences which are greater than 36.
    e.g. the above integer sequence alternates between a small and large integer
    2. Randomlly select two odd-indexed integer.
    If swapping them still meet the requirement, then swap them
    3. Randomlly select two even-indexed integer.
    If swapping them still meet the requirement, then swap them
    4. Repeat steps 2 and 3 many times

    I will write a computer program to implement this.
    Please comment or suggest a better algorithm.
    What is the range that the integers are to take?

    What do you want them for (so we can determine what properties this sequence should really have).

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    May 2010
    Posts
    3
    Quote Originally Posted by CaptainBlack View Post
    What is the range that the integers are to take?

    What do you want them for (so we can determine what properties this sequence should really have).

    CB
    The range of the integers are from 1 to 50 inclusive.
    My original post gives one integer sequence (though not random) which I think of.
    They corresponds to some frequencies (around 920MHz) so that the adjacent difference represent the interference between two adjacent frequencies. The larger the adjacent difference, the smaller the interference will be.
    The goal is to get a large total number of the adjacent differences and a large magnitude of adjacent difference.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    May 2010
    Posts
    3
    Is there a method to calculate the theoretical (mathematical) limit of the criteria for the integer sequence of the range [1, 50]?
    e.g.
    1. If the adjacent difference is set to 24, what is the theoretical minimum number of adjacent differences that can be achieved?
    2. If the minimum number of adjacent difference is set to 32, what is the theoretical adjacent difference that can be achieved?
    I do not want to my software to achieve something that is impossible theoretically.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: May 12th 2010, 07:30 AM
  2. Replies: 1
    Last Post: April 20th 2010, 09:16 AM
  3. Integer Sequence and prove
    Posted in the Discrete Math Forum
    Replies: 4
    Last Post: November 28th 2009, 02:19 PM
  4. Replies: 6
    Last Post: December 18th 2007, 09:20 AM
  5. [SOLVED] Adjacent points
    Posted in the Advanced Math Topics Forum
    Replies: 1
    Last Post: July 4th 2006, 05:26 AM

Search Tags


/mathhelpforum @mathhelpforum