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

learn more… | top users | synonyms (1)

1
vote
3answers
121 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
113 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
434 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
249 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
83 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
411 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
94 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
126 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
252 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
199 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
172 views
1
vote
0answers
48 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
289 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
206 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
135 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
80 views
5
votes
1answer
107 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
87 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
50 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
53 views

Autoregressive Process Question

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

Average positions in a 1D random walk

I wrote this to simulate m random walks of n steps ...
2
votes
2answers
183 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
142 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
597 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 ...
18
votes
1answer
290 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
78 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 ...
20
votes
2answers
354 views

Spacing out random walks so they don't overlap

From an external simulation program, I have lots of particle tracks which follow random walks, all of which start at or near the origin $(0,0)$. This means that when I plot the walks in Mathematica, ...
1
vote
0answers
48 views

Randomly generate a list of arbitrary length from a finite set [closed]

I have a finite set of elements (5 to be exact). Suppose the first element has probability $\frac{1}{2}$ of being selected, while each of the others has probability $\frac{1}{8}$ of being selected. ...
13
votes
3answers
170 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 ...
8
votes
1answer
132 views

RandomPoint in geographic region from Polygon[region_]?

How do you generate a RandomPoint in a geographic region? ...
7
votes
0answers
78 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 ...
15
votes
1answer
218 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 ...
20
votes
2answers
624 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
36 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
164 views

Possible bug in VonMisesDistribution?

Bug introduced in 10.2 or earlier and fixed in 10.3 Observe: ...
1
vote
1answer
90 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
50 views

Mixture of a bivariate distribution defined as a copula

I define a bivariate distribution: ...
4
votes
1answer
129 views
5
votes
3answers
121 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
423 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
530 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
156 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 ...
1
vote
3answers
324 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
80 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 ...
13
votes
1answer
585 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
133 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 ...