[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] srfi-27 - producing pseudo and truly random numbers
From: |
Ivan Raikov |
Subject: |
Re: [Chicken-users] srfi-27 - producing pseudo and truly random numbers over a uniform distribution |
Date: |
Mon, 29 Oct 2007 16:05:10 +0900 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Uniformly-distributed integers can be generated with the
random-mtzig:random! procedure. I do need to make the example
consistent with the API, thanks for pointing that out. Initially, the
procedures in that egg were not reentrant, and the state was global. I
forgot to update the example when I changed the procedures to have a
state variable argument. It looks like your code might work; why don't
you run it and see? Meanwhile, I will update the documentation.
-Ivan
"Terrence Brannon" <address@hidden> writes:
>
> With your mtzig library, I see how to create a uniformly distributed
> real from (0,1)
> but I do not see how to create a uniformly distributed integer from
> [0,n) where n is some number not necessarily the largest on the
> machine.
>
> Also, i do not understand why you did not pass in the created state in
> your example at the end:
>
> csi> (require-extension random-mtzig)
> csi> (random-mtzig:init! 24)
> csi> (random-mtzig:f64vector-randu! 20)
>
> The docs say that N * state (which I assume is a 2-tuple of an integer
> and the previously created state) is passed to that function.
Re: [Chicken-users] srfi-27 - producing pseudo and truly random numbers over a uniform distribution, Terrence Brannon, 2007/10/29