Re: Help for random number generator



On 12 Sep 2005 22:49:33 -0700, "Nishant" <nishantxl@xxxxxxxxxxxxxx>
wrote:

> hello Friends
> Please suggest me regarding the best possible use of
> random number generator.
> I am unable to figure out the reason why it is not working properly.I
> have seen that the random number generator works fine when I use less
> number of iteration in the for loop but it fails to work properly when
> I increase the number of iterations in the for loop.
>
> meaning that the random number generator generates different
> sequence of random no each time if the no of iterations in the for
> loop is less where as it fails to produce a different sequence of
> random no each time if the no of iterations in the for loop in large.

Gee, it *seems* like you are complaining that it
produces the same sequence for a large loop.
But it should *always* produce the same sequence
when it starts with the same seed-value. That makes
me think you starting with very little knowledge of
what you are doing.

So, what are you doing with Seeds?

If you want more concrete help, I expect you will need to
post the code, in whatever programming language it is.


>
>
> please let me know any technique to debug this error in my code
> Awaiting your reply

Be very careful about where you place the statements
that initialize the seed. Read the documentation.

--
Rich Ulrich, wpilib@xxxxxxxx
http://www.pitt.edu/~wpilib/index.html
.



Relevant Pages

  • Re: Iterating Functions
    ... previous iterations will be lost. ... Re-Read the table "ORDER BY" the sequence number ... indicates a loop!! ... nested Recordset objects but one Connection object with success. ...
    (microsoft.public.scripting.vbscript)
  • Re: random number geneator
    ... > If you call rand(), it will also update the seed value. ... > generator to often, this statistical property cannot build up (as with ... >> because the loop has a constant relationship to clock. ... > the randomness of the sequence if you do it. ...
    (comp.lang.cpp)
  • Re: Random number help
    ... > to debug my code. ... > have seen that the random number generator works fine when I use ... > I increase the number of iterations in the for loop. ...
    (comp.soft-sys.matlab)
  • Re: Random number help
    ... to debug my code. ... have seen that the random number generator works fine when I use less ... I increase the number of iterations in the for loop. ...
    (comp.soft-sys.matlab)
  • Generator
    ... the generator is exactly equivalent to ... There is a subtlety when the sequence is being modified by the loop (this ... if the suite inserts an item in the sequence before the current ...
    (comp.lang.python)