Questions about random number generation and the properties of numbers so generated.
16
votes
6answers
995 views
Efficient way to generate random points with a predefined lower bound on their pairwise Euclidean distance
Using Mathematica what is an efficient way to generate a list of $n$ random two dimensional points $\{x_i,y_i\}$ where $i=1,...,n$ so that no two points $p_1$ and $p_2$ in the list has an Euclidean ...
27
votes
5answers
995 views
Distribution of random points in 3D space to simulate the Crab Nebula
I'm generating some 3D models of planetary nebulae and supernova remnants for Celestia, a free OpenGL astronomy software.
Currently, I know how to do it with random points inside a spherical shell. ...
14
votes
4answers
879 views
Efficiently generating n-D Gaussian random fields
I am interested in an efficient code to generate an $n$-D Gaussian random field (sometimes called processes in other fields of research), which has applications in cosmology. I wrote the following ...
14
votes
1answer
254 views
Simulating Theatre puzzle
I have been trying to simulate the process of the theatre puzzle from the Joy of X (Strogatz).
The puzzle, and some relevant material are here.
My simplistic coding for this process follows:
...
2
votes
5answers
268 views
Assigning a particular value to array elements
I have an array of 10000 elements. I want to randomly assign energy to these 10000 elements using Gaussian or Exponential distribution, such that each time a particular element is selected its energy ...
28
votes
4answers
780 views
Quality of random numbers
Mathematica has several ways of generating random numbers: Congruential, ExtendedCA, Legacy, MersenneTwister, MKL, ParallelGenerator, ParallelMersenneTwister, Rule30CA.
For ...
20
votes
1answer
721 views
RandomVariate from 2-dimensional probability distribution
A probability distribution can be created in Mathematica (I am using 8.0.1) with e.g.
...
23
votes
1answer
372 views
Finding the likeliest path in a Markov process
With Mathematica 9, we have the addition of various processes, among which the discrete Markov process. Given a transition probability matrix m, such a process is ...
11
votes
1answer
289 views
Which Distributions can be Compiled using RandomVariate
Recently, Oleksandr kindly showed a list of Mathematica commands that can be compiled.
RandomVariate was part of that list. However, whether this can be compiled depends upon the distribution that is ...
11
votes
1answer
225 views
Are there rules of thumb for knowing when RandomVariate is more efficient than RandomReal?
Please consider the following:
From a fresh Mathematica kernel, RandomVariate is more efficient for NormalDistribution but ...
10
votes
3answers
377 views
1D Random Walk variant
I am making a notebook that is a variation to the traditional 1d random walk problem.
The normal 1D random walk can be simulated easily by
...
5
votes
4answers
493 views
3D Random Walk with Periodic Boundary Conditions
I am working on a 3D random walk with periodic boundary conditions and have written a program that will do this for me but it is extremely slow. Does anyone have any suggestions on how I could speed ...
9
votes
2answers
265 views
Fast Simulations with Compile
this post relates to another post that I didn't follow up propely. If I wanted to simulate
a system of stochastic proesses like the following, and loop over this run many many times
would writing the ...
4
votes
5answers
446 views
Vectors with a certain magnitude in Mathematica
For a user specified magnitude, is there a way to have Mathematica produce any 3D vector that fits that magnitude?
8
votes
3answers
632 views
How to generate a RandomVariate of a custom distribution?
I'm trying to generate a pseudorandom variate out of a custom distribution. Suppose I want define a custom distribution, and for the sake of simplicity I define a Poisson distribution (the ...
15
votes
4answers
741 views
Random data generator
Inspired by Quality of random numbers I would like to set up a true random data generator in Mathematica.
My idea is to use the static from an open microphone. I recall reading about extracting the ...
9
votes
1answer
310 views
Functional programming and Do loops
I'm writing a Monte Carlo simulation. I'm using a Do loop to create the different simulations, iterating over different ...
9
votes
2answers
390 views
Creating randomly oriented planes
I would like to create randomly oriented planes.
This is how I'm attempting to do that:
I create a 2 random unit vectors, $\mathbf{v}_1$, and $\mathbf{v}_2$, in the $x$-$y$ plane
I assume that if I ...
8
votes
2answers
319 views
Most efficient way to obtain samples from high-dimensional multivariate distributions?
Is MultinormalDistribution[] efficient and easy to use for high dimensions?
I have a variable $n$ representing the dimension of a Monte Carlo integration I do on a ...

