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

learn more… | top users | synonyms (1)

5
votes
1answer
48 views

RandomGraph with specific constraints

I need to generate random connected simple graphs (no loops) with the constraint that exactly two vertices must only have a single edge. I can create many connected graphs (but very few will have the ...
12
votes
1answer
170 views

Regime Change Stochastic Process

I would like to simulate an Ito process in which the drift and diffusion terms change after hitting a boundary for the first time. For example, a Geometric Brownian Motion X which has 0 drift and ...
4
votes
2answers
343 views

Simple Monte Carlo simulation

I want to find the Monte Carlo simulation of the integral $$\int_0^1 \sqrt{1-x^2}\mathrm dx$$ The Cesàro mean is $$I_n=\frac1n\sum_{k=1}^{n} f(U_k) $$ I want to plot the scatter plot ...
1
vote
2answers
59 views

Calculating Variance (without Variance expression)

I am learning Mathematica on the fly, one of my tasks is to find the variance of white noise. I followed the tutorial for finding white noise by using the code: ...
10
votes
2answers
483 views

Generating uniform random points over a binary image

So I recently read this excellent post about generating random points over arbitrary regions. I hope Wolfram eventually builds that functionality into Mathematica's Random functions. I want to do this ...
4
votes
3answers
113 views

How do I draw random points from a region [duplicate]

as the title,this problem have confused me a whole day.If I have a region,how can I yield a random member in this region.The region such as ...
2
votes
2answers
60 views

How do I execute a block of code multiple times? [closed]

Rudimentary pseudoconceptial question: I have a specific block of code that uses random variables and generates a plot at the end based on random code. I want my code to run 10 different times to get ...
0
votes
0answers
33 views

Parametrizing a matrix given its trace and norm

I have a problem where I have to generate random matrices with the following properties: ($a$ is a given fixed number) $\mathrm{Tr}\, A=0$ $\mathrm{Tr}(A^\dagger A)=\|A\|_F^2=a$ I was wondering ...
0
votes
2answers
109 views

Generate a list with random values between a and b [closed]

I am trying to perform system identification.. To properly identify the system i have to give the system a "rich" signal which are able to "activate" all the modes of the plant. A rich signal would ...
2
votes
0answers
34 views

Custom graph distribution

I am working with random graphs a lot. It's quite easy to describe random graph using, adjacency matrix or just a list of edges. However I am thinking that I might benefit from describing random ...
0
votes
1answer
59 views

usage of random numbers in recursive loop

I am trying to evalute two functions using iterative process as below ...
19
votes
1answer
270 views

Generating animations of clouds with Mathematica

I'd like to generate some visually-pleasing animations of clouds, fog or smoke with Mathematica. My idea of "visually-pleasing" is along the lines of one of the images on the Wikipedia article for ...
1
vote
2answers
238 views

How to generate a random, relatively prime number to p?

I'm sorry if this is an obvious question, but I'm a newbie and googling didn't help me much. Is there a way in Mathematica to generate a number q coprime with ...
1
vote
3answers
75 views

Fill an array, symmetric with respect to its centre

I want to create an array that must be symmetric with respect to the centre of it, as in the following example: 0 1 2 3 4 3 2 1 but, instead of having such ...
0
votes
1answer
58 views

How do I apply a conditional append rule to plot randomly chosen points?

I'm working on an attempt at forming a sort of "Mandelbrot" set using Newton's method and randomly chosen points. Effectively I need to define a loop for Newton's method to determine whether my points ...
8
votes
3answers
377 views

Turning a set of random walk data 45 degrees

I have a set of data that is just a "random" (generated by me, not by computer) sequence of length 2000 of 1's and (-1)'s. I used it to plot a 1-D random walk where +1 is step up, (-1) is step down, ...
1
vote
1answer
157 views

Combining Mandelbrot and Monte Carlo

I'm trying to combine plotting a Mandelbrot set with Monte Carlo randomization to plot an equation using random points for complex number z, for the function $z^3-2z+2=0$. Below is the code I have ...
1
vote
1answer
107 views

Finding uniformly distributed random points on an ellipsoid

I am trying to generate a poincare map for a system whose reduced energy manifold looks like the following surface. (x/a)^2 +(y/b)^2 +(z/c)^2=1 I want to find a ...
6
votes
3answers
334 views

Simulate random data with correlation

I would like to simulate some random data e.g. between 0 and 1, but with a given correlation. In other words some data where the correlation between two datasets is e.g. a constant or within a give ...
4
votes
0answers
69 views

RandomVariate, MSE and Cramer-Rao bound calculation

I'm using the following code to plot the variance of a moment estimate of a parameter of Rice distribution and its' Cramer-Rao bound. First I generate $10^3$ vectors $\texttt{R}$ ($10^3$ elements ...
0
votes
1answer
184 views

Random numbers in C++ and Mathematica gives wrong results? [closed]

I have the following strange phenomenon which puzzles me!: I have a piecewise constant probability density given as ...
1
vote
1answer
90 views

Failed to create a special random-disturbed initial condition for partial differential equation

I try to use BSplineFunction to creat a initial condition for NDSolve which has periodic boundary condition, that is realized by ...
0
votes
1answer
113 views

Generate a small random disturbance on a flat surface for NDSlove

I want to generate a small random perturbation on a flat surface defined on a square domain, e.g. 1 + 0.05 rand(x,y), which can be used as initial condition with periodic boundary conditions in ...
0
votes
2answers
37 views

Simulate from an AR(1) process where the parameters vary over time

I would like to simulate from an AR(1) process, where the $\rho$ parameter in the process of the form: $X_t = \rho X_{t-1} + \epsilon_t$ varies over time. The path of $\rho$ and $var(\epsilon_t)$ ...
0
votes
1answer
85 views

How to improve this function that selects parameters from arbitrary distribution using Recursion?

Below, I have defined a function using Which to select model parameters based upon various conditions. My questions are: Is there any danger in writing this function using Recursion? Is there a more ...
9
votes
5answers
410 views

How to randomly select subsets

I have a list of around 300 elements. I want to sample subsets of length 25 such that my samples are all distinct. My first inclination was to use something like ...
13
votes
3answers
1k views

Can Mathematica's random number generation be improved?

Performance on Random Number generation is intolerable. Whenever you need many deviates from the same distribution but with different parameters it takes forever. Here is a thread on Poisson ...
2
votes
1answer
56 views

Why is RandomVariate of special probability distribution doesn't working in all cases

I would like to generate a random variates in Mathematica 9 with this distribution: ...
0
votes
1answer
35 views

Fit process parameters to a transformed AR(1) process

I would like to fit the parameters of an exponented AR(1) process using Mathematica's EstimatedProcess, however, the function does not seem to evaluate to anything. First of all I create the ...
0
votes
0answers
76 views

Von Neumann's method to generate points uniformly distributed on a region of a n-sphere surface

I am trying to generate points uniformly distributed on a region of a single n-sphere surface (all angles in hyperspheric coordinates are between 0 and Pi/2). I decided to use von Neumann's method ...
2
votes
1answer
82 views

Time inhomogeneous Markov Chain in Mathematica

I would like to create a discrete 2-state Markov process, where the switching probabilities in the transition matrix vary with time. I can currently do the following, which creates a process with ...
2
votes
3answers
301 views

Creating a fast random array generator

I want to create N x N array of random numbers. (N is an integer). The constraints are, each element should be between 0 to l(integer) ( here 0<= l <= N) and the sum of elements in each row ...
0
votes
0answers
60 views

Random generation of three-non-collinear and four-non-coplanar points in 3D space

Please, take a look to this code. How it can be improved so that the time execution becomes smaller? ...
1
vote
1answer
85 views
6
votes
2answers
100 views

Sum considers RandomInteger[] as a constant

Perhaps this is expected behavior, but I was kind of surprised by the following: ...
24
votes
3answers
1k views

Generating 250 random points crashes the kernel, but not 249

Fixed in 10.1.0. Consider the following function, which generates uniformly random points on the surface of the 2-sphere: ...
2
votes
4answers
524 views

Random real numbers that sum up to specific value

In here, it works with "Integer". What if I want 5 positive real numbers that sum to 1? RandomChoice[IntegerPartitions[100, {5}]]/100. That will work. But only ...
0
votes
2answers
49 views

Getting RandomChoice to work in Manipulate function

I'm a beginner mathematica programmer and I am tryin to create my first demonstration. This code should represent what happens if one changes the size of the reading frame, calculating the nucleotide ...
2
votes
2answers
395 views

Generate nonoverlapping random circles [duplicate]

I want to distribute n circles unformly in an area(e.g. free plannar space). The circles could touch each other but cannot overlap. ...
0
votes
0answers
69 views

How to randomly create disks with randomized radii under given specific cover ratio? [duplicate]

I want to create uniformly distributed disks(dots) in a specific rectangular area. Suppose: the disk radii should be uniformly between $a$ and $b$ ($0<a<b$); there is no interaction between ...
1
vote
1answer
78 views

RandomVariate form a Specific Distribution with Restrictions

There are a lot of questions about generating random numbers form both uni-variate and bi-variate distributions. Mathematica has a lot of built in distributions for that purpose. However, I could not ...
1
vote
0answers
48 views

Help with Multivariate ProbabilityDistribution

I wish to obtain numbers from ...
4
votes
1answer
227 views

Monte Carlo Volume Calculation and Speed Up

I am trying to do a Monte Carlo area calculation for an irregular area defined by: $$0 \le x \le 1, 10 \le y \le 13, y \ge 12 \cos(x), y \ge 10 + x^3$$ I used the code with modifications (so I can ...
9
votes
2answers
216 views

Sampling phase space uniformly for a given energy

For example, for the 1D harmonic oscillator, the energy is given by: $$ E = \frac{1}{2 m} p^2 + \frac{m \omega^2}{2} x^2 $$ where x is position and p is the momentum. I would like to sample phase ...
5
votes
2answers
197 views

TemporalData, RandomFunction, Loops: Extracting data from TemporalData sets?

I'm doing a finance project for my differential equations class to explore stochastic processes. I'm exploring IRA retirement funds. From the project write-up: Standing assumption: at time of ...
11
votes
4answers
603 views

Generating Random Real numbers with certain numbers not included

I'm writing a program that i need 1000 real number between -3 and 6. the code that I used for generating and saving them was l = RandomReal[{-3, 6}, 1000] But I ...
0
votes
0answers
63 views

What graph distributions are available in Mathematica?

Where can I find a list of all the graph distributions available in Mathematica?
2
votes
1answer
105 views

Is random number generation based on Farlie-Gumbel-Morgenstern copula wrong?

I am constructing a bivariate Farlie-Gumbel-Morgenstern distributions with Normal and exponential marginal as follows: ...
4
votes
2answers
98 views

Generate non-overlapping permutations

Let l be a list l = Flatten[Range[7] & /@ Range[12]]; (* 1,2,3,4,5,6,7,1,2,3,4,5,6,7,... *) The question is to ...
0
votes
2answers
71 views

A constraint to RandomReal for sum of numbers equal to arbitrary n

I want to generate some random numbers but respect a constraint. So I use RandomReal[{0,1},N,WorkingPrecision -> 2] I want to fix a constraint in order ...