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

learn more… | top users | synonyms (1)

3
votes
3answers
161 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
60 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
180 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.
6
votes
3answers
292 views

How can I create a random symmetric matrix in this way?

The most straight forward way for me to think about is like this: ...
4
votes
2answers
156 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
84 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 ...
4
votes
6answers
940 views

Randomly Multiply OR Divide by a Random Number?

I want that Mathematica decides randomly if a given variable, gets multiplied or divided by a random number in a given range. The "naive" idea to just use ...
1
vote
1answer
79 views

Random phases at each run in a wave superposition [closed]

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, ...
3
votes
1answer
141 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
103 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
125 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
208 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
2answers
259 views

How to generate a random pulsar graph between two points?

I am going crazy trying to create this. I am trying to create a pulsar graph that starts and ends on two points that have the same y smoothly along the x axis. The pulsar should have random valleys ...
5
votes
1answer
138 views

Find random $n$ combinations of values with a given sum

This problem is described in the related StackOverflow question: Find all combinations of coins when given some dollar value. I would like generate a list of $n$ combinations of values that sum up to ...
5
votes
1answer
67 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
99 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
118 views

ParallelTable and Random

Each time I execute the following code it generates the same cylinders with the same format. ...
1
vote
1answer
71 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
147 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
250 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
128 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
122 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
62 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
446 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, ...
15
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
266 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
86 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
441 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
96 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 ...
3
votes
2answers
277 views

Generate a random PDF

How can I generate a random probability density function $p(x)$ in the domain $[0,1]$? Is there a single Mathematica function to do so?
0
votes
1answer
136 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
269 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
215 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
176 views
1
vote
0answers
53 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
319 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
236 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
153 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
87 views
5
votes
1answer
110 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
97 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
54 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
55 views

Autoregressive Process Question

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

Average positions in a 1D random walk

I wrote this to simulate m random walks of n steps ...
2
votes
2answers
215 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
147 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
654 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 ...
19
votes
1answer
302 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
96 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 ...