Thread: random numbers adding up..

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    Wouldn't that yield the same or similar series' ?..and not ones in which every number is greater than its predecessor ?
    You are, for some reason, seeing two things that exhibit similar behavior and screaming "These are caused by different things!".

    The default assumption should be that things having similar symptoms are caused by the same underlying condition until further evidence is obtained.

    If he were printing out longer runs of random samples the series itself would be similar or slightly showing a mutation related to the underlying implementation.

    He is only printing out a single random sample.

    The only value he prints is obviously going to fall victim to the same underlying condition that causes a series to exhibit repeated sameness or slight mutation.

    You may look at it like this to confirm the problem for yourself because you seem to understand the seed related to time: he is printing a series that has exactly one element.

    [Edit]
    None of this, by the way, suggests anything about the quality of the underlying implementation.

    If a "PRNG" didn't produce the same sequence with the same seed it would be all but useless as a "PRNG".

    Using the current time as a seed without allowing time for the seed to change is the problem. It naturally depends on the implementation of the "PRNG" and how time is handled on the host system but the problem is generally related to how many samples must be processed before the least significant changes to a seed propagates from the "avalanche" effect.

    As a matter of interest, if you sample one value of random data from a known seed (say 12345) and thoroughly mix the seed obtained from the time you can generally make the least significant bits, the parts of time that are most likely to change, more significant causing faster "avalanche" effects.
    [/Edit]

    Soma

    random numbers adding up..-silly-png
    Last edited by phantomotap; 05-05-2012 at 07:20 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Adding numbers to a random number
    By Euan_R in forum C++ Programming
    Replies: 5
    Last Post: 01-24-2012, 12:11 PM
  2. Adding Random Numbers help
    By mastern200 in forum C++ Programming
    Replies: 6
    Last Post: 01-15-2007, 02:51 PM
  3. Numbers adding together = bad
    By Zyk0tiK in forum C Programming
    Replies: 5
    Last Post: 12-04-2005, 04:37 PM
  4. Replies: 4
    Last Post: 11-16-2004, 07:29 AM
  5. Replies: 3
    Last Post: 07-24-2002, 08:46 AM