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

learn more… | top users | synonyms (1)

0
votes
0answers
7 views

What is the chances of a duplicate in this equation [migrated]

I'm not very good at math; However I have a scenario where I'm trying to find the chance of duplicate for randomly generated data. In a nuttshell I have a "bag" with 62 different items, lets say a ...
1
vote
1answer
67 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 ...
9
votes
2answers
172 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 ...
4
votes
1answer
165 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 ...
3
votes
1answer
269 views

Boundary condition for stochastic differential equation

I have a simple stochastic differential equation (SDE) with white noise: ...
24
votes
3answers
357 views

Assign a randomly generated list to variable

Bug introduced in 10.0.0 and fixed in 10.0.2 I don't know if this is a silly question, but it really baffles me. So please help me understand this behavior. ...
5
votes
2answers
106 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
517 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
57 views

What graph distributions are available in Mathematica?

Where can I find a list of all the graph distributions available in Mathematica?
25
votes
4answers
2k views

How to generate a random tree?

Is it possible to generate a random tree without explicitly constructing a random adjacency matrix that satisfies tree properties? How about a random directed tree? Edit: incredible answer by ...
22
votes
3answers
654 views

Which Distributions can be Compiled using RandomVariate

Recently, Oleksandr kindly showed a list of Mathematica commands that can be compiled. RandomVariate was part of that list. However, whether this can be compiled depends upon the distribution that is ...
2
votes
1answer
80 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
75 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
57 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 ...
1
vote
3answers
194 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. ...
30
votes
9answers
7k views

How to create animated snowfall?

Well, the title is self-explanatory. What sorts of snowfall can we generate using Mathematica? There are two options I suggest to consider: 1) Continuous GIF animations with smallest possible number ...
6
votes
1answer
168 views

Random filling of L-length line with l-length segments

I have discrete L-length line filled randomly with 2-length segments so its cover line with gaps 0 or 1. So we can describe cover configuration as sequence of gaps such as {0,0,1,0,1}. How I can ...
3
votes
1answer
158 views
9
votes
4answers
273 views

How can I generate and randomly assign color to annular sectors?

How can I generate such an image and fill every annular sector with a random colour?
1
vote
1answer
61 views

How to figure out the seed I used to generate several random numbers given that I didn't used SeedRandom at first place?

After generating thousands of random numbers, I figured out that I didn't used SeedRandom to store the seed. Is there a way for me to know what seed was used to generate these numbers? Thanks in ...
3
votes
1answer
104 views

Recursion when randomizing elements in a list

I want to randomize certain elements of a list; Since the code list = {a, b, c, d, e, f, g}; list[[{1, 3, 5}]] = RandomSample@list[[{1, 3, 5}]]; list works fine, ...
6
votes
2answers
467 views

Generate Random Text within a Rectangle

I would like to generate images such as the four below. That is: some text of different length fit within a Rectangle[] using ...
2
votes
2answers
170 views

Constraining a random function

This question is a follow-up from here. I have a function that generates a list of correlations between some random variables: ...
0
votes
1answer
121 views

Generate Random 3D Network using GraphPlot3D and loop

Instead of writing all this out I want to do the same thing with a loop and be able to manipulate n and k. The idea is to create a randomly generated network where n is the number of nodes and k is ...
12
votes
3answers
2k views

Create triangular mesh from random list of points

I have a list of points. I would like to take these points and create a mesh of triangles from them, making sure triangles don't overlap. So here's a list of points: ...
9
votes
5answers
542 views

Randomly assigning color to Graphics3D objects?

I have a set of Graphics3D primitives (here, spheres) which I would like to assign either: (1) One of a subset of colors, e.g. {Green, Red} (2) A random color over some RGB interval Writing ...
2
votes
3answers
291 views

Coloring random points in an annulus

I have found the following random generator to generate points in an annulus in stackoverflow on stackoverflow ...
2
votes
1answer
123 views

How to label vertices in a grid with random integers?

I would like to assign each vertex a random number with the minimum bound equal to the smallest vertex and the maximum equal to the value of the largest without repeats. For example, in a 20x20 grid, ...
4
votes
2answers
260 views

Repeatedly randomly redrawing part of a random sample that matches a certain criterion

I would need some (a lot of) help to improve/rewrite some code. Since my real problem is a bit too complicated to explain, I'll try to show a simplified scheme of what I want to achieve. I create ...
4
votes
1answer
218 views

How can I randomize order of elements in a list?

Is there a straightforward way to go from an ordered list like: ord = {a, b, c, d, e, f, g, h} to a disordered list like: ...
1
vote
1answer
109 views

Generate random nxn matrix with all negative eigenvalues

I need to generate an nxn matrix with random entries, but I also need all of the eigenvalues to be negative (real or complex doesn't matter). I have: ...
14
votes
6answers
484 views

How to generate random points in a region?

The Mathematica 10 documentation was updated for FindInstance adding support for regions. In my use case I'm trying to sample points in a set of disks: ...
14
votes
3answers
3k views

How to generate random directed acyclic graphs?

How to programmatically build random directed acyclic graphs (DAG)? I know about the AcyclicGraphQ predicate and the ...
14
votes
3answers
464 views

How to Import random elements of huge data files

I am calculating huge data files with an external program. I would like then to import the data into Mathematica for analysis. The files are 2 columns and up to many millions of rows. So for ...
0
votes
1answer
57 views

Why does RandomFunction return variable number of data points?

I am using the following code snippet to generate Compound Poisson process random numbers: ...
4
votes
1answer
169 views

Generating random symmetric matrix

Suppose first that I want to generate a matrix whose elements are i.i.d. with distribution dist. This is easy: ...
94
votes
7answers
16k views

How to generate a random snowflake

'Tis the season... And it's about time I posed my first question on Mathematica Stack Exchange. So, here's an holiday quest for you Graphics (and P-Chem?) gurus. What is your best code for generating ...
6
votes
3answers
700 views

Random Geometric Graphs

I'm trying to implement an application which uses random geometric graphs in Mathematica, but it seems Mathematica lacks the functionality. I need the following functionalities: Generate a set of ...
2
votes
2answers
97 views

How to randomly partition a range [closed]

I need to create a partition of a list of integers from $1$ to $n$ into a number of partitions of different size, with the constraint that the total number of elements in the partition must equal $n$. ...
1
vote
2answers
90 views

Verify positive definiteness using random numbers

I wish to verify whether T'T - IdentityMatrix[2] is always positive definite for a certain choice of elements of T'T. ...
8
votes
3answers
295 views

Random Integer Sequences

I want to construct a random square matrix in the following manner: a) Three states [0 | 1 | 2] are repeated ...
2
votes
2answers
257 views

How can I get this sum? [closed]

I want to sum the following numbers. At present I am calculating my sum as follows. a = 10^20 + 10^30 + 10^40; In the above case, if I want to add 100 or more ...
2
votes
1answer
52 views
1
vote
1answer
59 views
3
votes
2answers
98 views

Sublists of Random Permutations

What is an efficient way to create a list of (psudo)randomly chosen permutations? I'm trying to create a list like below: ...
2
votes
1answer
141 views

Plot A Function Of A Stochastic Process

I am trying to do something very simple in Mathematica 9. I want to play around with option pricing and for that I thought it best to use the new stochastic process functionality. So, first of all I ...
0
votes
0answers
36 views

Is there a reliable way to compute the Hurst Dimension of a time series [duplicate]

The Mathematica function FindProcessParameter exists but may be unreliable: FindProcessParameters for Fractional Brownian Motion Returns Error Is there a simple algorithm that can be done in ...
15
votes
1answer
317 views

Speed up adding Poisson noise to an image

I'm simulating some images corrupted with Poisson noise, but I'm encountering a few problems with performance. According to the documentation on ImageEffect, one ...
8
votes
2answers
817 views

What is the best distribution for my histogram?

I defined a security bound for a random walk (cube with 15 lengh) and i have this code to obtain a sample of the random times at which the random walk crosses the boundary for the first time: ...