Questions about random number generation and the properties of numbers so generated.

learn more… | top users | synonyms (1)

2
votes
2answers
170 views

Illustrating half life

I'm teaching some lessons on negative exponents and one application listed was half life since the rate of decay can be written as 2^-1 every __ years. I found this nice animation on the net. ...
3
votes
2answers
265 views

Colors associated to parts of a 3D distribution of points

Suppose we have a long list of random points (cartesian coordinates) in 3D space. coords := ...; Until now, I was associating colors in a radial way, from the ...
2
votes
1answer
344 views

Radial Random Walk

I'm trying to generate a spherical distribution of radial random walk points in 3D space. The following code works, but the random walk lines aren't radial. Why ? Where is my mistake ? ...
1
vote
1answer
310 views

Gauss Markov Process

I am trying to model a 1st order Gauss Markov Process (gyroscope drift). I know the Allan Variance characteristics of the process (bias instability, random walk characteristics). I know the model ...
-1
votes
3answers
202 views

MixtureDistribution in Mathematica 7

Is it possible to use a mixture of several distributions in Mathematica 7.0? Consider for example the following code : ...
-4
votes
1answer
381 views

Distribution of random points in 3D space to simulate an Orion-like Nebula [closed]

I'm creating 3D nebulae models for Celestia, a free OpenGL astronomy software. The following question is in part related to another one I already asked on this forum (see this question, for which I ...
11
votes
3answers
510 views

Efficient implementation of a linear complexity measure of binary sequences

For a implementation of testing the quality of random number generators I implemented the NIST test suite in Mathematica based on the nice workbook by Ilja Gerhardt. However I took up the challenge ...
1
vote
1answer
272 views

How to reject or repulse some points in a 3D cloud of particles?

I'm having an issue with a 3D distribution of points. The distribution is really nicely looking in Mathematica, but it is used in an OpenGL astronomy program (Celestia) to generate a nebula, with ...
33
votes
5answers
2k 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. ...
6
votes
3answers
379 views

A deterministic function to generate a random number

Using Mathematica, I need to define a function of one integer variable that generates the same real number in the range 0 to 1, if it is called with the same argument, but gives a different real ...
19
votes
2answers
698 views

Efficient Generation of Random Variates from a Copula Distribution

I have a 7-asset portfolio for which I want to simulate daily log-deltas using a Student T copula. The marginal distributions are all either Stable or TsallisQGaussian. Using NMaximize, I have ...
14
votes
1answer
2k views

Compare C++ Standard Library's Mersenne Twister with Mathematica's Mersenne Twister

The C++ standard library does contain a set of random distribution classes, among other things a Mersenne Twister engine. What I'd like to do is to generate the same random number distribution, using ...
25
votes
1answer
873 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 ...
3
votes
3answers
510 views

Generating a random walk with defined step size

By the following I'm trying to generate a list of random coordinates (ex. 4) each within unit distance from previous one, starting from origin. What am I doing wrong? ...
7
votes
1answer
266 views

1D Random Walk with Excluded Sites and Variable Time-Step

Here is the physical problem I would like to simulate: Consider the following variations to the 1d random walk: allow for certain, random sites to be excluded with probability 1/2. allow for the ...
14
votes
3answers
593 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
1answer
301 views

Random number generation with specific distribution

I am writing a program for solving the shortest path in travelling salesman problem, with a twist that there are multiple salesmen who partition the cities among themselves, thus creating two part ...
1
vote
1answer
546 views

Add noise (random values) to data

I have a data set(x,y,z) corresponding to a hemisphere, to which I want to add some controlled noise (random values) to make the x,y,z values diverge. data = Flatten[ Table[{i, j, i^2 + j^2}, {i, ...
1
vote
1answer
313 views

Why does the mean in my coin tossing simulation not approach 1/2?

I simulate a simple experiment, a coin flip. What I do is accumulate the mean of the results up to the i-th experiment. What I can't figure out is why the computed means do not asymptotically approach ...
1
vote
1answer
152 views

Random sample with gap sizes

Lets say I have 101 instances of data with multiple attributes. In particular case, one attribute has 7 unique values. I want to get ...
8
votes
1answer
537 views

Recommended book on random processes to understand new functionality in Mathematica 9?

I am interested in exploring the new functionality on random processes available in Mathematica 9, but I am not familiar with all of the underlying mathematics. Could you recommend a book that ...
13
votes
1answer
335 views

RandomVariate returns values outside the support of a PDF

Let $X$ be a random variable with pdf: dist = ProbabilityDistribution[1/(Abs[x]*Log[Abs[x]]^2), {x, -E^-2, E^-2}] Here are some pseudo-random drawings from it: ...
16
votes
1answer
410 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: ...
1
vote
1answer
100 views

Draw from HistogramDistribution with ParallelTable

I wanted to check something, but ran into troubles using HistogramDistribution in combination with ParallelTable. The code does the following: Compute a HistogramDistribution of some sample and use ...
1
vote
3answers
400 views

Small random disturbance of a flat surface

I am trying to create an initial condition which is: 1 + 0.05 rand(x,y) Here rand is a pseudorandom function distributed in the interval (-1,1). This surface ...
15
votes
3answers
570 views

Plotting the solution of a vector stochastic differential equation

I have a vector stochastic differential equation, $$\mathrm dq = p\,\mathrm dt\qquad q(0)=0$$ $$\mathrm dp = (-q -p)\mathrm dt+\mathrm dW\qquad p(0)=10$$ This can be entered to give me the process ...
2
votes
2answers
255 views

Generating a range of numbers according to some rules

I'm pretty new to Mathematica, and I'm mainly a programmer so I don't have a lot of knowledge about maths. I want to generate a set of UNIQUE incremental numbers (series) according to the following ...
1
vote
1answer
137 views

How to generate new random numbers in a Manipulate only on demand?

I was playing with a Manipulateto visually compare calculating the mean of Normal and Cauchy random data. ...
11
votes
2answers
429 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 ...
8
votes
2answers
538 views

Fluorescence Correlation Spectroscopy Simulation

I am simulating Fluorescence Correlation Spectroscopy which basically involves tracking the random motion of particles in a box with periodic boundary conditions and then calculating their intensity ...
9
votes
3answers
2k 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 ...
2
votes
1answer
137 views

Randomizing a lab

I teach a class where students do a weekly lab in Mathematica. They do it in a computer lab, and because there are many of them, and only one of me, I encourage them to help one another. ...
9
votes
1answer
197 views

RandomReal closed on left & open on right?

I have a number of algorithms that depend on uniform random reals in half-open intervals such as $[0,1)$. In particular, I need a (pseudo) random-number generator that produces machine-precision ...
6
votes
4answers
969 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 ...
5
votes
4answers
2k views

How to generate random directed connected graph?

How to generate random directed connected graph? I need to create graph which will pass: ConnectedGraphQ[^]
8
votes
3answers
1k views

Randomly packing spheres of fixed radius within a cube

How can I have Mathematica randomly place spheres in a cube so they won't overlap? The cube is $20 \times 20 \times 20$, and the spheres have a radius of $0.7$.
6
votes
5answers
1k 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?
14
votes
1answer
507 views

Simulating Stochastic Processes the MMA way

This question is really a specific problem and a methodological one concerning MMA best practices. I want to simulate a system of stochastic processes. If this were a geometric Brownian motion or ...
9
votes
1answer
633 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 ...
2
votes
1answer
1k views

Creating a random normal matrix

I would like to create a random matrix with the constraint that the matrix must be normal, i.e. the matrix and its Hermitian conjugate must commute. I would create a random matrix "without ...
27
votes
2answers
2k views

Efficient Langevin Equation Solver

This question is not about good algorithms for solving stochastic differential equations. It is about how to implement simple codes in Mathematica efficiently exploiting Mathematica's programming ...
1
vote
1answer
167 views

Using different random values at each recursion step

I have the following code: ϕ[0] := π/4 ϕ[n_] := Exp[-n] ϕ[n - 1] + Sqrt[1 - Exp[-2 n]] M M = RandomVariate[NormalDistribution[0, 1]] For this recursion relation, ...
3
votes
1answer
379 views

Randomly selecting elements without repetition

I assigned energy values to each element in the array as per the program of Verbeia. The program looks like this ...
2
votes
5answers
577 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 ...
6
votes
3answers
1k views

Generating unique random number lists

I am new in programming. I have an array containing, let's say 20 elements and first I want to randomly select two elements from it and record them. Then I will select two elements from the array of ...
3
votes
2answers
122 views

Why do I keep getting 0.06 with WorkingPrecision->1?

I'm trying to generate a list of 1000 random numbers with WorkingPrecision->1. Is there any particular reason that I'm getting some entries as 0.06? I have tested the following lines: ...
2
votes
3answers
536 views

Some questions about random numbers

How can I get non-repeating random numbers from Mathematica 8? How can I know which distribution the numbers I get are? Can I choose the distribution I want together with the non-repeating random ...
7
votes
1answer
812 views

Wald–Wolfowitz Runs Test

Does Mathematica 8 implement Wald–Wolfowitz runs test for randomness? I can't find it in the documentation. I would like to test some fit residuals.
16
votes
4answers
2k 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
5answers
786 views

Picking random items out of a list only once

I'm trying to create a function that randomly returns a value from a list but remembers the values that have been given before. At the end when the list is empty it should return an empty list. ...