# Questions tagged [random]

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

693 questions
Filter by
Sorted by
Tagged with
129 views

I’m currently getting to grips with the AdaptiveMonteCarlo method in the NIntegrate function. I’ve been using the sub-method <...
161 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 ...
243 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 ...
237 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 ...
786 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 ...
93 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 ...
488 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 ...
237 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: <...
105 views

### Creating multiple random 2d data

I want to create a certain number n of 2d random data, which have the following structure: ...
100 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 ...
219 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 the values $\pm1$. My attempt is: ...
822 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 ...
101 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 ...
149 views

### Plotting using RandomReal output [closed]

...
136 views

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

208 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 ...
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 ...
252 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 ...
193 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: ...
58 views

...
699 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 ...
456 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: ...
726 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?
436 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. ...
213 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 ...
64 views

### Creating time varying 2d coordinates with OrnsteinUhlenbeckProcess

I see that I can create time varying 1d data with e.g. ...
124 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 ...
86 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, ...
369 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 ...
81 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 ...
881 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 ...
32 views

### RandomVariate and Map, strange behavior noticed

I'm performing Bayesian Analysis and I have written this piece of code ...
529 views

### Random walk with decreasing step size

I have to make simulation of a random walk that gets smaller and smaller. Each step the x-axis gets rescaled 1/2 and y-axis by 1/Sqrt. So one needs more and more ...
### Get random solution for equation with $n$ parameters and infinite solutions?
I'd like a low-discrepancy sequence of points over a 3D-hypercube $[-1,1]^3$, but don't want to have to commit to a fixed number $n$ of points beforehand, that is just see how the numerical ...