Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
random number including 1 - i.e. [0,1]
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Lawrence D'Oliveiro, post: 3880744"] Doesn't seem to be necessary, if I interpret the following correctly <[URL]http://en.wikipedia.org/wiki/Box-Muller_transform#Polar_form[/URL]>: Given u and v, independent and uniformly distributed in the closed interval [−1, +1], set s = R2 = u2 + v2. (Clearly \scriptstyle R = \sqrt{s}.) If s = 0 or s > 1, throw u and v away and try another pair (u, v). Continue until a pair with s in the open interval (0, 1) is found. Since s is supposed to be in an open interval, I don't see how it makes any difference if u and v are chosen from an open or semiopen interval. The probability of hitting the exact endpoints is 0, after all. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
random number including 1 - i.e. [0,1]
Top