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

learn more… | top users | synonyms (1)

13
votes
3answers
152 views
0
votes
0answers
19 views

Creating points that are remoted from one another beyond a certain threshold. Quasirandom sequance? [duplicate]

I am looking for an approach to create a set of pseudorandom pairs of numbers subjected to one condition. They must be not closer to one another than a certain limiting parameter. One approach might ...
5
votes
1answer
63 views

RandomPoint in geographic region from Polygon[region_]?

How do you generate a RandomPoint in a geographic region? ...
7
votes
0answers
58 views

Restarting random number generators where you left off

I have code that uses both RandomReal and RandomInteger a number of times to produces a sequence of $n$ data sets. After ...
14
votes
1answer
137 views

Why does't SeedRandom work here?

From the docs on SeedRandom, SeedRandom[] resets the generator, using as a seed the time of day and certain attributes of ...
16
votes
2answers
264 views

Implementing the PCG random number generator

PCG ("permuted congruential generator") is a recently-introduced random number generator. PCG is a family of simple fast space-efficient statistically good algorithms for random number generation. ...
0
votes
1answer
34 views

Variable Definitions and Random Numbers [closed]

I have currently created the following matrix: m={{RandomReal[{0,1}],RandomReal[{0,1}]},{RandomReal[{0,1}],RandomReal[{0,1}]}} In other words, a $2 \times 2$ ...
10
votes
2answers
125 views
1
vote
1answer
47 views

How to repeatly use random number generator in optimization problem

I am looking to run the optimization problem. I already finish my optimization code as below. ...
1
vote
0answers
39 views

Mixture of a bivariate distribution defined as a copula

I define a bivariate distribution: ...
4
votes
1answer
80 views
5
votes
3answers
102 views

ImplicitRegion gives arbitrary boundaries

This question uses Mathematica 10.2.0.0. equation1 is the major unbounded region I would like to generate: ...
3
votes
2answers
280 views

How do I generate n random numbers with an extra condition [duplicate]

I need to generate n random numbers that would sum into a. And I can't find an elegant solution here: ...
2
votes
3answers
514 views

For loop in Length computation code

Here is a code I wrote that is supposed to give the length of list after some splitting and regrouping. But it is inefficient. Is there a way to rewrite in more professional and efficient way? I guess ...
5
votes
2answers
130 views

How to find an estimated root efficiently with binary stochastic estimation of the function?

I am trying to construct certain nice geometric patterns, and one particular feature I'm trying to optimize is the balance of black and white corresponding to point being inside, or outside a ...
0
votes
2answers
156 views

Random non-overlapping disks in a square

I've found a nice code snippet by @belisarius from this question, that I'll reproduce here for reference: ...
2
votes
1answer
66 views

How do I define a random variable involving Part?

I need to define a random variable that involves Part, but when I try, for example ...
12
votes
1answer
485 views

What function generates random numbers in a compiled function?

I am writing a simulation for 2D random walk. I wrote several version of code, and found that the speed is like this (fastest to slowest): C++, Mathematica compiled procedural code, Mathematica ...
0
votes
0answers
68 views

Retrieving forthcoming step size from NDSolve

I'm solving a system of ODEs with a random component, which changes at each calculation step and depends on the step size. So I'm trying to realize something like this: (1) size of the forthcoming ...
6
votes
1answer
92 views

Slow-down encountered for RandomChoice in large lists

I was wondering if anyone could help me to speed up this code snippet which creates simple (sparse) networks by preferential attachment. The algorithm adds a vertex and an edge each time interval. ...
2
votes
2answers
83 views

Better to use loop or function when populated list?

In the past I have pretty much stuck to expression building when using Mathematica, but recently I have been writing a procedure to populate an array, which I guess are called "lists" in Mathematica. ...
1
vote
3answers
104 views

Partitioning List Into Sublists of Length 2 With The Pairing Being Random

I've done a bit of Googling with hopes of finding an answer, but to no avail. I'm looking for a way that I can have Mathematica take the elements of a list, say ...
3
votes
1answer
273 views

Plotting random circles in a square

How can we draw 20 circles which have random radius in a specified range, with random positions. All centers must be in a square with side=10 (for example centimeter): every overlapping between any ...
0
votes
0answers
45 views
5
votes
1answer
58 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
193 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 ...
5
votes
2answers
429 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
75 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
539 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 ...
8
votes
2answers
277 views

What's wrong with NIntegrate with “MonteCarlo” Method?

Bug fixed in version 10.2.0 My code is: ...
4
votes
3answers
177 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
82 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
42 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
122 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
38 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
67 views

usage of random numbers in recursive loop

I am trying to evalute two functions using iterative process as below ...
21
votes
1answer
324 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
297 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
76 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
65 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
404 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
174 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
132 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 ...
7
votes
3answers
377 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
85 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
213 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 ...
3
votes
1answer
138 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
127 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
46 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
91 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 ...