Re: [julia-users] Re: MersenneTwister, srand

2016-10-28 Thread Isaiah Norton
>
> So what is the difference between srand and merseentwister?


Per doc link, srand uses MT by default.

and also how do I get my random numbers


rand() for floats less than 1 by default, or specify a set to choose from:

help?> rand
search: rand randn rand! randn! randexp randperm randjump randexp!
randcycle randsubseq randstring randsubseq! RandomDevice srand sprand
sprandn sprandbool bitrand transcode

  rand([rng=GLOBAL_RNG], [S], [dims...])

  Pick a random element or array of random elements from the set of values
specified by S; S can be

•an indexable collection (for example 1:n or ['x','y','z']), or

•a type: the set of values to pick from is then equivalent to
typemin(S):typemax(S) for integers (this is not applicable to BigInt), and
to [0, 1) for floating point numbers;

what do the different fields mean?


The fields aren't intended to be accessed, but you can see each element
name with:

julia> fieldnames(MersenneTwister)
4-element Array{Symbol,1}:
 :seed
 :state
 :vals
 :idx


How do I acutally set the seed
>

srand


> srand(0) and rand() would actually be a mersennetwister I'd expect zeros
> everywhere...
>

Why?


On Fri, Oct 28, 2016 at 2:11 PM, digxx  wrote:

> Sorry but that doesn't answer my question. That's where I have the calling
> from but it does not explain the output and what it means...
>


Re: [julia-users] Re: MersenneTwister, srand

2016-10-28 Thread digxx
Sorry but that doesn't answer my question. That's where I have the calling 
from but it does not explain the output and what it means...


Re: [julia-users] Re: MersenneTwister, srand

2016-10-28 Thread Isaiah Norton
http://docs.julialang.org/en/latest/stdlib/numbers/?highlight=global_rng#random-numbers

On Fri, Oct 28, 2016 at 1:23 PM, digxx  wrote:

> With number in my head I meant, that I expected to see random number
> arrays of size 624 since as far as I know they are created
> simultaneously,right?
>


[julia-users] Re: MersenneTwister, srand

2016-10-28 Thread digxx
With number in my head I meant, that I expected to see random number arrays 
of size 624 since as far as I know they are created simultaneously,right?