Questions tagged [random]
Questions about random number generation and the properties of numbers so generated.
906
questions
0
votes
0
answers
20
views
Including absorbing boundary (surface) for a continuous stochastic process on a complex domain
Often of interest are stochastic processes with absorbing boundaries (states). However, Mathematica does not natively include functionality to deal with absorption.
In one spatial dimension there is a ...
1
vote
2
answers
71
views
Randomly replace some letters in words with hyphen
I have a list containing some related words
...
2
votes
1
answer
92
views
2
votes
1
answer
56
views
Wishart distribution implementation with positive semidefinite scale matrix
The built-in Mathematica function WishartMatrixDistribution[\[Nu],\[CapitalSigma]] requires a positive definite (PD) scale matrix ...
4
votes
1
answer
130
views
How can I generate a random number within a function and use the result repeatedly in the same function?
I want to write a function that will randomly select an element in a list of arbitrary length and operate on it. For example, if I have
L = RandomInteger[100, {10}]
...
3
votes
1
answer
214
views
How to use Mathematica to find the maximum expected value of multiple normal distributions?
Is it possible to calculate the maximum expected value of $ n (n\geq 2) $ independent (identical distributed) random variables that follow a normal distribution? If possible, how to find it? If it ...
2
votes
1
answer
63
views
Why is random sampling with ordinary and compiled code so different?
Consider the following code:
...
7
votes
1
answer
218
views
Early computer art - Frieder Nake's "Walk Through Raster"
Frieder Nake
Frieder Nake (born 1938 in Stuttgart, Germany) is a mathematician, computer scientist, and pioneer of computer art. Nake is one of the "3N" computer pioneers, an abbreviation ...
0
votes
2
answers
60
views
Automatic matrix operations with parameters obtained by random numbers
I have matrix T defined by 2 parameters:
T = {{0, 0, 0},{0, 0, a},{0, a, b}};
These 2 parameters are randomly generated by means:
...
13
votes
3
answers
2k
views
Michael Noll's early computer art - arranging graphic elements in a circular manner
Michael Noll
A. Michael Noll (born 1939 in Newark, New Jersey) is an American engineer and professor emeritus at the Annenberg School for Communication and Journalism at the University of Southern ...
2
votes
1
answer
109
views
Fast sampling from Fermi-Dirac distribution under specific conditions
This question is a continuation of the following one.
Let us assume a Fermi-Dirac (FD) distribution (times $p^{2}$):
...
1
vote
1
answer
121
views
How to quickly sample from the following distributions
Consider the following distributions:
...
5
votes
2
answers
519
views
Fill a matrix with randomly placed elements that are a certain distance apart
Problem statement
I want to populate a matrix of points with randomly placed elements, here denoted as x. In all matrix rows there must be an equal number of x-...
1
vote
1
answer
95
views
How to compile the following code (sampling from a distribution)?
Consider the following code:
...
0
votes
0
answers
52
views
How to quickly sample points according to the given distribution?
Consider the following points sampler:
...
0
votes
1
answer
82
views
Resampling the points with a constraint [closed]
I have a list of npts elements energies obeying some arbitrary distribution. By performing some operation many times, it would ...
2
votes
0
answers
58
views
Why RandomSample fails and how to fix this?
Consider the following sampling:
weights = 10^RandomReal[{-13, Log10[35]}, 499500];
vals = Range[Length[weights]];
randomvals = RandomSample[weights -> vals];
...
4
votes
2
answers
141
views
How to speed up the following algorithm?
I have some random combinations of numbers pairs (where numbers range from 1 to some ntest) ...
16
votes
1
answer
521
views
Reproducing Heinrich Heidersberger's Rhythmograms
Heinrich Heidersberger (1906 - 2006) was born in Ingolstadt, Germany, and grew up in
Austria. He studied architecture in Graz, which he abandoned in favor of art. From 1928 until 1931 he lived in ...
0
votes
1
answer
78
views
How to select non-repeating pair of numbers?
Consider the following combinations of integers comb, where the integers range from 1 to n ...
11
votes
1
answer
302
views
Early computer art - reproducing Harold Cohen's turtle drawings
Harold Cohen
Harold Cohen (1928 - 2016) was a British pioneer of computer-generated art. After his studies at the Slade School of Fine Arts in London he became soon well known in London as an abstract ...
18
votes
1
answer
357
views
Can we emulate Paul Henry's drawing machine?
Desmond Paul Henry
Desmond Paul Henry $(1921-2004)$ was a Manchester University Lecturer
and Reader in Philosophy. He was one of the British pioneers of Computer Art.
Henry with Drawing Machine 2, ...
0
votes
0
answers
59
views
How to make the following pairing?
Consider the following list of identifiers:
Npart=5000;
ilist=Range[1,Npart];
And parameters belonging to the given identifier:
...
19
votes
3
answers
1k
views
Vera Molnár's interruptions - erasing graphic elements
Vera Molnár
Vera Molnár (1924 - 2023) was a Hungarian artist who, like Victor Vasarely, lived and worked in France. She was one of the
pioneers of computer graphics. Trained as a traditional artist, ...
7
votes
1
answer
155
views
Creating a Random T-Spline Instead of a B-Spline
I want to be able to create a function so that instead of BSplineSurface[pts], it would be TSplineSurface[pts,error]. I think it ...
4
votes
3
answers
503
views
Efficiently fill an ellipse with a k-many random ellipses
So, I can create a circle filled with circles of the same radius that gives this example picture:
with this code:
...
7
votes
1
answer
296
views
How to condition all cells of a notebook to a specific SeedRandom?
Is there a way to fix SeedRandom[.] for an entire notebook? If I carry out many calculations using random numbers, I need to give a separate code ...
6
votes
3
answers
244
views
Incrementing a random element of an array repeatedly
Consider this code to simulate a simple instance of the coupon collector problem. We initialize an array to {0, 0} and then keep incrementing a random element until we've incremented every element at ...
0
votes
2
answers
93
views
Appending Random Number to Existing List
My goal is to append random number to list like below.The problem is whenever I try appending a random number, the previously created numbers are changed which I don't know why. How to add a random ...
6
votes
2
answers
249
views
Split a sequence with conditions
I need a function which splits a sequence of arbitrary length
at x random points and which guarantees that each partition (bin) contains a minimum of ...
1
vote
1
answer
100
views
Unwanted reevaluation in Manipulate with RandomPointConfiguration
Here is a simple illustration of a problem I am encountering. I want to use RandomPointConfiguration inside Manipulate, but it ...
1
vote
2
answers
179
views
How to use first time generated randomly matrix? [closed]
I'm trying to solve one (very little) problem. :)
I've generated 3x3 randomly matrix with
V[i_, j_] := Table[RandomInteger[{-10i, 10j}], {3}, {3}];
Now I want to ...
0
votes
0
answers
41
views
Combinations of distributions to be called with `RandomVariate`
I'd like to manipulate distributions that I'm going to retrieve using RandomVariate; e.g., I would like to take
...
11
votes
4
answers
1k
views
How to create a random zonogon?
A zonogon is a polygon that is convex and is made only out of pairs of parallel sides with the same length. Any regular polygon with an even number of sides is an example of a zonogon.
When I use: <...
3
votes
2
answers
189
views
Approximate a Wiener Process by a Karhunen-Loève expansion
I'm trying to approximate a Wiener Process by a Karhunen-Loeve expansion (see slide 20) with the following code:
...
3
votes
2
answers
214
views
Fill data points within the boundary established by the given points
I have the following data points:
...
1
vote
1
answer
90
views
How to select the points that belong to the given region?
Consider two regions:
...
2
votes
1
answer
221
views
Applying NDSolveValue on a differential equation
I am trying to solve stochastic Schrodinger equation (Schrodinger equation in the presence of Ornstein Uhlenbeck Process)
$$i\frac{d}{dt}\begin{pmatrix}c_1(t)\\ c_2(t)\end{pmatrix}=H(t)\begin{pmatrix}...
4
votes
5
answers
240
views
How to delete the complex numbers which are generated in a list of numbers?
Here I have generated a list of numbers
...
1
vote
0
answers
114
views
Random Seed and Parallelization in Compiled Functions
I am having trouble reproducing a random number from a compiled function with parallelization even with the random seed being set.
Specifically, running the following script should give the same value ...
3
votes
2
answers
144
views
How can I use replacement rules with randomized values? [closed]
Suppose I have a list that I want to use replacement rules to replace each occurrence of a a given symbol with a randomly selected value, with this choice being randomized for each occurrence.
For a ...
1
vote
0
answers
44
views
How can I use RandomFunction to solve an SDE in reverse time?
I am working with a problem of the Ito-stochastic differential form given by
$$\mathrm{d}x=g(x,t)\,\mathrm{d}t+f(x,t)\,\mathrm{d}W,$$
where $W$ is a Wiener process.
I furthermore have to satisfy the ...
3
votes
2
answers
117
views
Update Random Each Repetition of Animate
I found a solution that's not what I wanted but it will suffice
Thanks - Larry
...
1
vote
3
answers
155
views
Plotting Average Positions of 2D Random Walk
I need to generate a plot that shows the averaged position at n steps of 1000 different random walks that are each 1000 steps long. So far I am using ...
0
votes
1
answer
78
views
How to get the time series of colored noise obtained by AudioGenerator function?
In the documentation I found a code that plots a Periodogram.
...
1
vote
1
answer
101
views
How to get randomly arranged image in Mathematica?
I'm now thinking about randomly arrangement of the imported image.
After importing 2 hand-written images, image1 and image2, I want to make each 5 copys and randomly arrange them in one graph, i.e. ...
0
votes
0
answers
74
views
How to generate points belonging to some region very fast?
Consider two variables Ex,th. th ranges within
thmin=10^-5;
thmax=Pi/2;
while ...
4
votes
1
answer
277
views
Illustrating the central limit theorem
I'm working on this question is from Wolfram Mathematica online course. I tried my best to find the answer, still not getting it right
The question is:
Make a list of histograms of 10000 instances of ...
1
vote
1
answer
102
views
Why is generating normalized random $1000 \times 1000$ matrices and plotting the eigenvalues so slow?
For each of the distributions $N(0,1)$ and $\pm 1$ equal probability and for each of $N \in \{5,10,20,50,100,200,1000\},$ I want to generate an $N \times N$ matrix with entries chosen from the ...
1
vote
1
answer
156
views
Wolfram Mathematica Monte Carlo for integrals approximation
I wanted to implement the Monte Carlo method for multiple integrals approximation in Wolfram Mathematica. Namely I wanted to let the user insert as input the dimension of the integral and the number ...