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

learn more… | top users | synonyms (1)

1
vote
3answers
102 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
37 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 ...
1
vote
2answers
165 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
64 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 ...
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 ...
0
votes
0answers
36 views

Help with Multivariate ProbabilityDistribution

I wish to obtain numbers from ...
4
votes
1answer
167 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
177 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
107 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
519 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
59 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
81 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 ...
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. ...
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 ...
1
vote
1answer
110 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: ...
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: ...
2
votes
3answers
293 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
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$. ...
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 ...
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. ...
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

Parallelization and evaluation of random number generation

Suppose I have the following functions: ...
4
votes
1answer
174 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: ...
3
votes
2answers
99 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: ...
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 ...
1
vote
1answer
60 views

FindProcessParameters for Fractional Brownian Motion Returns Error

I have the following data: ...
3
votes
1answer
79 views
5
votes
1answer
198 views

Computing the Hurst exponent or fractal dimension of fractional Brownian motion

The Hurst exponent is related to the fractal dimension by noticing that the fractal dimension $D$ is equal to $2-H$, where $d$ is the intrinsic dimension and $H$ is the Hurst exponent, for 1-D ...
0
votes
0answers
63 views

How to deal with matrices involved in system of SDEs?

This question is in continuation of the the previous posts Solving Stochastic differential equation and Fast Simulations with Compile. What I want to do is numerically solving the epidemic model which ...
14
votes
6answers
491 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: ...
23
votes
5answers
2k views

2D random walk within a bounded area

I want to simulate a random walk on two dimension in a bounded area such as a square or circle. I am thinking of using If statement to define a boundary. Is there a ...
1
vote
3answers
131 views

Random reals according to conditions

I'd like to create a list of triplets $(x,y,z)$ which satisfy the following properties: $$0<x<1/2 \\ 0<y<1/2-x \\ -1<z<-2(x+y)$$ Basically I would like to uniformly generate random ...
15
votes
1answer
318 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 ...
0
votes
0answers
43 views

Random reals according to probability distribution [duplicate]

How do I generate a list a random real numbers that follow a probability distribution? If my pdf is $f(x)$, how do I "force" the random numbers to follow $f(x)$?
2
votes
3answers
279 views

Create a list of random reals

How can I create a list of random pairs $(x,y)$ where $0<y<x<1$ and $x,y \in \mathbb{R}$ ? I can't seem to place that inequality restriction on the random numbers that are generated.
0
votes
0answers
30 views

Generating a Table with a certian Density [duplicate]

How do I create a random table of 0's and 1's with a certain density instead of a probability? For Example: Manipulate[ Table[RandomChoice[{1 - density, density} -> {0, 1}, {10}]], ...
0
votes
1answer
98 views
5
votes
4answers
1k views

Random numbers that sum up to specific value

I would like to generate a list with random numbers, which add up to a specific value. While[Total[x] == 28, x = RandomInteger[{0, 28}, 5];Print[x]] The random ...
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 ...
0
votes
1answer
76 views

Probability Distribution of a Multivariate Hypergeometric distribution and maximum probability

Hello to all Mathematica Users! I have this question: Consider a box which contains 69 balls. 17 red, 1 white, 29 blue and 22 green balls. There will be picked 7 balls randomly, without putting the ...
3
votes
2answers
227 views

Addition of Matrices [closed]

How can I add the Matrices created by this: SeedRandom@0; Table[RandomInteger[{0, 34}, {2, 2}], {2}, {5}] // MatrixForm $\left( \begin{array}{ccccc} \left( ...
4
votes
3answers
126 views

Creating nested matrix using random integers

How do i create 15x2 matrix with 2x2 random integer elements? My code only returned identical 2x2 elements:
3
votes
1answer
159 views

How to generate a random binary tree with a given number of vertices and with a given shape, namely compact or elongated

I tried to generate a random binary tree with a Table of RandomInteger and to give a shape with a ...
4
votes
4answers
573 views

Skip other If conditions

I'm trying to write a code to "random" move in a matrix but it can't go to a certain position if it has a certain value (in this case I'm using the number 2). How do I make it to skip all other If ...
3
votes
1answer
162 views

Simulating a bounded continuous random walk in $n$-dimensions

You're given three $n$-dimensional real vectors, $\mathbf{x_0}$, $\mathbf{a}$ and $\mathbf{b}$, with $\mathbf{a} \le \mathbf{x_0} \le \mathbf{b}$ (vector inequality means component-wise inequality). ...
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 ...
1
vote
1answer
90 views

How to generate a random signal consisting of the specified functions

Let's assume that I have some particular signal on the finite time interval which is described by function $f(t)$. It could be, for instance, a rectangular pulse with amplitude $a$ and period T; gaus ...