How random is "RANDOM"?


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default TMR0 or TMR1 is NO guarantee of a random seed

    Simply reading TMR0 or TMR1 is NO guarantee of a random seed.

    In some systems where the code runs for days and takes innumerable branches and folds it might be pretty good but in other systems the code trajectory is the same every time the code is run. In that case TMR0 and TMR1 will always yield the same values.

    You MUST introduce something truly indeterminate, such as a noise source or an unpredictable delay such as a human operator where response times will vary every time the operator pushes the button.

    BrianT

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by BrianT View Post
    Simply reading TMR0 or TMR1 is NO guarantee of a random seed.
    Agreed 100%...but...if running on an internal oscillator, it could vary with temperature, perhaps far enough to mess with the seed enough. After all, theoretically, it only takes a single bit difference to change the order of things completely...theoretically that is
    And exact temperature, therefore precise oscillator speed, is truly indeterminate, if, as you say, you have an external event trigger that is nonperiodic (aperiodic? anti-periodic? periodic-less?)

Similar Threads

  1. Random Numbers
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 18th December 2008, 09:47
  2. 6 random numbers limiting to 49 ?????
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th June 2005, 00:27
  3. Random number results
    By bartman in forum mel PIC BASIC
    Replies: 3
    Last Post: - 9th March 2005, 18:39
  4. Random function - How to limit it ??
    By martarse in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 30th November 2004, 15:05
  5. more random number questions
    By bartman in forum mel PIC BASIC
    Replies: 1
    Last Post: - 14th November 2004, 18:55

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts