help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calculation issue with octave (data unexpectedly go to zero at some


From: ghaverla
Subject: Re: Calculation issue with octave (data unexpectedly go to zero at some point)
Date: Fri, 28 Feb 2014 12:15:56 -0700

On Fri, 28 Feb 2014 13:46:57 -0500
Przemek Klosowski <address@hidden> wrote:

> On 02/27/2014 05:57 PM, ghaverla wrote:
> >  From what I read, Octave is supposed to make use of a
> > Mersenne-Twister for its core 0-1 RNG.  And I am guessing you are
> > drawing random numbers from somewhere in your calculations.  If
> > somehow you are getting random numbers from /dev/random instead of
> > the Mersenne-Twister, you could be depleting your system of
> > entropy, and hence every random you generate ends up being
> > 0.  /proc/sys/kernel/random/entropy_avail can help.  My description
> > assumes Linux, I don't know how this might translate to other
> > hardware/OS.
> >
> > But I have seen entirely too many project descriptions, such as a
> > playing card game, where they are drawing random numbers
> > from /dev/random (directly or indirectly).
> That could be a possible explanation, and if so, a simple solution
> would be to use /dev/urandom instead.  /dev/urandom does not exhaust
> the entropy because it just runs a PRNG off the /dev/random seed.

I think what Octave does by default, is what Perl can do optionally,
and that is replace the rand() in libc, with a Mersenne-Twister.

I would disagree with using /dev/urandom.  Switching to a long period
RNG is a better solution.

But, the OP now knows how to query the system for how much entropy it
has stored up.

Gord



reply via email to

[Prev in Thread] Current Thread [Next in Thread]