# Questions tagged [random]

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

646 questions
Filter by
Sorted by
Tagged with
2answers
345 views

### How to convert from C to Mathematica?

I am trying to understand what is explained in this webpage, in the section entitled "Generating noise with different power spectra laws". After reading that section, I thought I could do it in ...
5answers
918 views

### Simple Birth Death Process

I am trying to implement simple birth death process. Why my code does not work? Any suggestion. Thanks. Cross posted http://community.wolfram.com/groups/-/m/t/1205656 ...
1answer
554 views

### Does SeedRandom give the same set of random numbers across operating systems?

If I use SeedRandom RandomReal[{0,1},100] I get the same random numbers on two versions of Mathematica: 10.4.1.0 on Windows 10 and 11.1.1.0 on Windows 7. ...
2answers
189 views

### Generating invertible matrix with lines within a given set

Consider the set options given as below ...
0answers
70 views

### A question about AdaptiveMonteCarlo method in NIntegrate

I’m currently getting to grips with the AdaptiveMonteCarlo method in the NIntegrate function. I’ve been using the sub-method <...
1answer
145 views

### Random number generation of a Multivariate PDF

I want to simulate random data with a multivariate PDF. I see that five years ago this needed to be directly coded into mathematica directly, but it seems as though there is recent support for ...
1answer
177 views

### First passage time distribution in mathematica

I'm trying to calculate first passage time distribution for some processes in Mathematica. First I tried to calculate this for Wiener process with zero drift and $\sigma = 1$ and the absorbing ...
1answer
172 views

### Place spheres randomly in a box without collisions?

Suppose I have a distribution of sphere radii, $P(r)$. I need to sample configurations of $N$ spheres in a cubic box of side $L$ (assume they fit), where the $N$ spheres have radii following the ...
4answers
751 views

### Uniform distribution on z = 1 − √( x ^2 + y ^2) , z ≥ 0 [duplicate]

Let $S$ belong to ${\rm I\!R^3}$, $z = 1 − \sqrt{x^2 + y^2}$ , $z ≥ 0$. I need to write a program that generates a random point on $S$ with uniform distribution. I've tried to use ...
1answer
79 views

### Evaluation of RandomChoice in a summation

Of course the familiar summation Sum[i, {i,n}] yields $n (1 + n)/2$. I'd like to add integers with an arbitrary randomly chosen sign (+ or -) before each term ...
2answers
344 views

### Solving a differential equation with colored Gaussian noise

I'm trying to reproduce the following equation: With $n(t)$ defined as: Assuming $g_A=g_B=1$ I tried using NDSolve but struggle with the last term ...
1answer
156 views

### Generate data through RandomVariate from an interpolated distribution [duplicate]

I have a few data point, that I can interpolate into a distribution. I want to be able to generate points that follow this distribution, but Mathematica does not seem to be happy. Here is my code: <...
3answers
92 views

### Creating multiple random 2d data

I want to create a certain number n of 2d random data, which have the following structure: ...
0answers
82 views

### Sphere packing with target volume fraction

I've stumbled upon this sphere packing question, and now I have another related one. How can I have a function that returns a sphere packing with a target volume fraction? Sphere can obviously have ...
3answers
153 views

### Generate a random Fibonacci sequence

I want to generate the random sequence defined by $a_n = a_{n-2} + \beta(n)a_{n-1}$ where $\beta$ takes values $\pm1$. My attempt is ...
0answers
668 views

### Stochastic Gradient Descent with constraints

Let's say we have a convex objective function $f(\textbf{x})$, with $\textbf{x}\in R^n$ which we want to minimise under a set of constraints. The problem is that calculating $f$ exactly is not ...
1answer
84 views

### EstimatedProcess estimate biased?

I'm estimating the ARProcess parameters of a set of 1000 time series generated with an ARProcess and RandomFunction. Each time ...
1answer
132 views

...
1answer
106 views

### Question about RandomSeed option in AdaptiveMonteCarlo NIntegrate method

I've been familiarising myself with the different options available in the AdaptiveMonteCarlo method for NIntegrate but one of ...
1answer
65 views

3answers
195 views

### RandomVariate of ProbabilityDistribution returns values outside the support of a CDF (non-symmetric PDF)

From this post (95069) I can see that this question has been been given a workaround for symmetric PDFs and that the bug was eventually addressed. I checked and the fix is still in place for my ...
0answers
45 views

### Random Number Generation on Parallel Cores [duplicate]

So, I've noticed an odd trend in some of my Mathematica results recently- I'm running large Monte Carlo simulations on a system that involves running several jobs independently, each on a different ...
1answer
215 views

### Cloud-based random question generator

Is there any way to create a micro site that generates a random question type and keeps the same question until the right answer has been inputted? I tried ...
3answers
174 views

### Draw from continuous-discrete distribution

I have a random variable with a CDF that is almost everywhere differentiable, but has a point mass somewhere: ...
1answer
52 views

...
2answers
670 views

### Generating random points on a Klein's bottle [duplicate]

There is a neat way in Mathematica to generate random points on a sphere. Note that "randomness" is defined (somewhat not mathematically strictly) so that the points must be evenly distributed over ...
2answers
384 views

### Animate trajectory of Brownian motion

I'm hoping to animate the trajectory of a 2D Brownian Motion. Here's my attempt, which is based on what I've read in Mathematica's documentation: ...
1answer
564 views

### How can I generate pink noise using Mathematica?

I need a time series of pink noise. How can I generate pink noise using Mathematica?
5answers
296 views

### Exclude zero when sampling random integers

I want to generate triplets of random integers over where the integers are in the range -9 to 9 (inclusive) but excluding zero. How can I do that? I have the following table. ...
1answer
185 views

### Generate coronograph speckle pattern in mathematica

How to simulate the radial coronograph "speckle-noise" in this image? The 3 circled objects are exoplanets. Their star has been blocked out by a coronagraph, resulting in optical noise known as ...
1answer
64 views

### Creating time varying 2d coordinates with OrnsteinUhlenbeckProcess

I see that I can create time varying 1d data with e.g. ...
2answers
119 views

### Locally randomizing a path on a graph

I have a walk $v_1 \ldots v_n$ on a graph $G$ and I want to apply the following operation to it: I wish to choose two indexes, $l$, $k$, and replace the sub-path from $v_l$ to $v_k$ with one of the ...
1answer
71 views

### Fix the outcome of a smooth function from a 1D random field

I have created a smooth function from a 1D random field. I used an existing code (Efficiently generating n-D Gaussian random fields) to generate random numbers with the correct Gaussian statistics, ...
2answers
319 views

### Generation of 'n' random symmetric matrices

I want to generate 3 random symmetric matrices, each of dimension 3 whose elements are normally distributed. It could be done simply as ...
2answers
64 views

### Make a RandomChoice inside a RecurrenceTable at each time of use, rather than once at time of definition

I recently watched the Numberphile video "Chaos Game" and I am trying to recreate the phenomenon discussed therein. The video depicts the following process: First, draw 3 points somewhere within the ...
1answer
827 views

### Brownian dynamics simulation

is there any way to improve computational speed of the following Brownian dynamics simulation of a trapped particle in the Markovian case ? I time-discretized the equation of motion and then use a ...