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

learn more… | top users | synonyms (1)

6
votes
0answers
62 views

RandomPoint works with a 2D ImplicitRegion but fails for any higher dimension

This is inspired by this answer which features code that I cannot get to work at all, and I tried to figure out why. It boils down to using the function ...
7
votes
1answer
141 views

Why is Random faster than RandomReal?

As of version 6, Random[] was superseded by RandomReal[ ] etc, but both still work perfectly well. Playing with some timing ...
6
votes
5answers
192 views

How to generate two group of $n$ random numbers in $U(0,1)$ such that sum of these two groups equal? [on hold]

I want to have two groups of $n$ random numbers $u_i$ and $v_i$ in $U(0,1)$, such that $\sum u_i = \sum v_i$ What I tried is: I can firstly get $u_i$ by ...
6
votes
1answer
67 views

RandomPoint fails with a large enough number of points

Bug introduced in 10.2.0 and fixed in 10.3.1. RandomPoint is new in 10.2.0. I have defined a simple ellipsoidal parametric region: ...
1
vote
2answers
40 views

Random bipartite graphs?

RandomGraph[{n,m}] generates a random graph with $n$ vertices and $m$ edges. I want to generate a random bipartite graph, like ...
2
votes
3answers
70 views

Smooth initial data

I need something that produce pseudorandom smooth initial data for modelling phase separation equations (Cahn-Hilliard and simular). Generator code for now: ...
1
vote
1answer
39 views

Generate a simulated covariance matrix

I am working on a problem where one of the input variables is the level of covariance between the entries in a particular matrix. To simulate this problem in Mathematica, I will need to feed my code ...
1
vote
2answers
125 views

Handling of Temporal Data [closed]

I use a random function of a process which yields a Temporal Data object, I need but do not know how to recuperate the numerical values of the process in a Table from the Temporal Data.
4
votes
2answers
117 views

Confining/Periodic boundary conditions implementation for 2D Random Walker

I am new to Mathematica, and am having trouble implementing confining boundary conditions for a random walk simulation confining the walker to a pre-defined region (periodic boundary conditions would ...
1
vote
0answers
75 views

Manipulate a random walk [closed]

For a college project I am manipulating a random walk. I managed to make a walk but in the manipulation every time a step is added the manipulation shows an entirely different walk. I understand why ...
0
votes
0answers
47 views

Random phases at each run in a wave superposition

I need to define a function which generates a random real number between 0 and $2\pi$, as a random phase constant for a wave superposition. The output should be different each time I re-run the code, ...
2
votes
1answer
109 views

Random Variate generating strange results when using ProbabilityDistribution

I have created a probability distribution that follows a general normal distribution, given by: $$ \frac{b *e^{-\left(\frac{\sqrt{(x-u )^2}}{a }\right)^{b }}}{2 a \Gamma \left(\frac{1}{b }\right)} ...
1
vote
1answer
98 views

How to use a random number generator as an independent variable in an existing model?

I am relatively new to Mathematica and I need some help regarding how to create a random number generator to be used as an independent variable for a model my group has been working on. Following is ...
5
votes
1answer
119 views

How to make my fuction return a step count

I am new to mathematica, and I have this 3d random walker program which runs with a fixed (given) amount of steps. What I want it to do is to run forever but stop when two walkers collide (aka have ...
4
votes
1answer
198 views

How to generate random natural numbers in $[1, \infty)$? [closed]

Functions like RandomInteger draw random variates from a finite range. Can one also obtain random natural numbers in case the range extends from 1 to infinity? If ...
5
votes
1answer
64 views

How to solve an equation system whose equations are based on Mod[x,y]

I'm trying to find the parameters of a specific linear congruential generator (pseudo random number generator) based on a list of the first five numbers generated by it. The list is this one: ...
1
vote
1answer
64 views

Generate $n$ randomly oriented non-intersecting cylinders with fixed radius and length

This post is in reference to the previous question here. How could I adapt the solution given to have the following constraints: fixed radius, fixed length, number of cylinders, and within a ...
6
votes
1answer
95 views

ParallelTable and Random

Each time I execute the following code it generates the same cylinders with the same format. ...
1
vote
1answer
63 views

Why doesn't RandomChoice work here? [closed]

I was using RandomChoice to run a simulation to test the probability that picking 4 marbles out of a bag containing 3 red and 7 blue marbles you get 2 red and 2 ...
5
votes
2answers
143 views

Extending a list

I have a range of n integers (always starting at 1) which are 1 apart, f.e. Range[10], Range[17] or ...
3
votes
2answers
205 views

generating randomly oriented non-intersecting cylinders

I could not find anything relevant with "googling" (only this) I can create a set of randomly oriented cylinders (code found here) ...
1
vote
3answers
112 views

how to find circles that intersect a square

I use the following (based on ideas and functions I got as ansers in [1], [2] by, repsectively, @ybeltukov and @J.M.) in order to find random circles with centers inside a unit square that intersect ...
0
votes
1answer
100 views

Hermitian Matrix

From Derbyshire's Prime Obsession, I would like to get the Mathematica code to generate a Hermitian matrix for evaluation and display. $ 256 \times 256 $ would be nice. Random Normal distribution, ...
3
votes
1answer
61 views

StringReverse question

I was thinking about how to make this with the StringReverse, but I failed: I have a sequence of (for example) "FDSRTYNHFNKHLIUHG", I wish to reverse, but randomly long sequence reversed from a ...
5
votes
5answers
419 views

Random character change in a random place

I would like to ask for help in a Random Replace of character. For example: ORANGE and change 1 character randomly (random place and random character from ORANGE) in it into any character of ORANGE, ...
14
votes
4answers
2k views

Random letters: What is the chance that real words are generated?

Suppose that we are just typing random letters with our keyboards and we include space bar. We don't distinguish between capital and lowercase letters. If we do this for a long time, how many of the ...
9
votes
2answers
231 views

What will happen, if I don't specify random seed by SeedRandom function?

Suppose I want to run several times of the same code containing RandomReal function, but I don't initialise the random seed. What will happen? I tried, but each ...
3
votes
1answer
73 views

Random Variable in Recurrence Function

Following the previously published question, I'm looking for the solution of RecurrenceTable with explicit random variable. For example, something like ...
6
votes
3answers
359 views

find the maximum number of not intersecting circles inside an ellipse

$Version "10.3.0 for Linux x86 (64-bit) (October 9, 2015)" (Sequel to 98724 and 99345) (I use codes originally created by Andy Ross, ybeltukov and J.M.). I ...
3
votes
2answers
86 views

Storing and taking average of random number generated plots [closed]

I am working on a code which generates a number of random numbers which I have to use in a set of matrices. This set is then multiplied with some other matrix set in a particular order. And finally I ...
0
votes
1answer
108 views

How to draw cylinders inside a cylinder

It can be considered as a sequel to 98724 I adopt the code of ybeltukov (thanks again) and I slightly modify it. ...
5
votes
2answers
234 views

Generate random non-intersecting lines inside a square

EDIT I have the following code which generates (pseudo-) randomly oriented and distributed but not intersecting lines. In fact, the code is from the reply I got here: ...
4
votes
1answer
172 views

Random Partitions

I want to write a function RandomPartition to partition a vector of length n into p partitions of varying (random) lengths. For example with ...
1
vote
2answers
166 views
1
vote
0answers
45 views

Sampling from an one-dimensional Wishart [closed]

I searched for a similar question but could not find one. My problem is sampling from an one-dimensional Wishart distribution. The Mathematica specification is ...
3
votes
2answers
251 views

How-to cast a set of random points on the surface of a cuboid?

I have been able to implement point picking for cylinders and spheres. However, I strugle to implement a solution for a cuboid. Please see code for point generation on cylinders and spheres below: ...
5
votes
3answers
168 views

Generating correlated random variables with normal distribution

This site and this site provide some background as to what I am trying to achieve, but with some variations in what is required. First I want three random variables with a normal distribution, ...
1
vote
1answer
110 views

How to simulate Multifractional Brownian Motion?

The maximum I would ask, is hints, how to model MFBMotion. Link to paper Firstly, i wanted to simulate in MATLAB that code: ...
2
votes
0answers
70 views
4
votes
1answer
99 views

Huge overhead in RandomPoint[ImplicitRegion]

Commenting answers of this question @JasonB noticed the big overhead of RandomPoint ...
25
votes
5answers
2k views

Generate two random numbers with constraints

I want to generate two random numbers, $p$ and $q$, between $0.5$ and $1$. They are connected by the constraint $1/(2q) > p$. How do I generate $p$ and $q$?
1
vote
2answers
76 views

Creating a random complex univariate polynomial

I am a newbie in Mathematica, but I need to create a random univariate polynomial of degree d with complex coefficients whose entries are random complex variables with real and imaginary parts being ...
0
votes
2answers
46 views

Evaluating a list of inequalities with random numbers [closed]

I have a list of inequalities, which include in total four parameters, that I would like to test by feeding the four parameters with random numbers. The goal is to find the best values of the ...
3
votes
2answers
49 views

Autoregressive Process Question

May I know what $x,y,z$ in ARProcess[x,{y},z] mean? ...
4
votes
1answer
137 views

Average positions in a 1D random walk

I wrote this to simulate m random walks of n steps ...
2
votes
2answers
145 views

Programming a 2D random walk

I have these functions Randomwalk1[n_] :=Accumulate[2*RandomInteger[{0, 1}, n] - 1]; Randomwalk2[n_] := NestList[# + 2*RandomInteger[{0, 1}] - 1 &, 0, n] ...
7
votes
1answer
124 views

Speeding Up RandomVariate

Consider the following code where we first take 1000 independent samples from a Poisson distribution, and then take 1000 independent samples from 1000 different Poisson distributions: ...
6
votes
4answers
488 views

Random sampling of multiple integers with constant sum

I want to build a model of 40 geological layers, assuming each layer has equal chance to be one of the four types of rocks and the four types of rocks have equal chance to appear in any layer. The ...
17
votes
1answer
261 views

What pseudo-random number generators are available to Mathematica users?

One would think I should be able answer the question I pose in the title for myself by reading the Documentation Center article ref/SeedRandom, but it's not so simple. That article does give a list ...
1
vote
2answers
71 views

Loop calculations with random numbers

Given a function f f=f[x,y,z] I would like to compute f for different random values of x,y and z greater than 0 ...