Why we are using seed function in generating Random Numbers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Velhari
    New Member
    • Sep 2006
    • 46

    Why we are using seed function in generating Random Numbers

    Hi,
    I am a beginner. Please tell me, For generating Random Numbers, Initially why we are going for seed method.
    And another question is that, I want to print unique random number how to print by using rand() method to print unique random number.

    And finally i want to know, If a program generate random numbers and the same program will execute after 100 or some days, it will not to generate the old random number (i.e the random number generated on that day will not occur in future) (Condition is not to store in db and another etc.,)
    Is it Possible means How?

    Please reply me as soon.....
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Originally posted by wikipedia
    A random seed (or seed state) is a number (or vector) used to initialize a pseudorandom number generator.
    See the link for this at Wikipedia

    You can never guarantee that a random number does not come up again, certainly not in another process (the chance at the start that the same numbers are chosen is exactly the same as when you did the routine 100 days ago).

    And even within the same process you can always get a double number. Only by having a big enough range you minimize the chance, but you don't eliminate duplicates.

    Ronald :cool:

    Comment

    Working...