Skip to main content

Questions tagged [random]

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

Filter by
Sorted by
Tagged with
2 votes
1 answer
25 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}] ...
dr_strangeloop's user avatar
3 votes
1 answer
185 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 ...
138 Aspen's user avatar
  • 1,373
2 votes
1 answer
56 views

Why is random sampling with ordinary and compiled code so different?

Consider the following code: ...
John Taylor's user avatar
  • 5,827
7 votes
1 answer
177 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 ...
eldo's user avatar
  • 74.1k
0 votes
2 answers
53 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: ...
Gae P's user avatar
  • 657
13 votes
3 answers
1k 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 ...
eldo's user avatar
  • 74.1k
2 votes
1 answer
90 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}$): ...
John Taylor's user avatar
  • 5,827
1 vote
1 answer
112 views

How to quickly sample from the following distributions

Consider the following distributions: ...
John Taylor's user avatar
  • 5,827
5 votes
2 answers
505 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-...
eldo's user avatar
  • 74.1k
1 vote
1 answer
87 views

How to compile the following code (sampling from a distribution)?

Consider the following code: ...
John Taylor's user avatar
  • 5,827
0 votes
0 answers
50 views

How to quickly sample points according to the given distribution?

Consider the following points sampler: ...
John Taylor's user avatar
  • 5,827
0 votes
1 answer
81 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 ...
John Taylor's user avatar
  • 5,827
2 votes
0 answers
54 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]; ...
John Taylor's user avatar
  • 5,827
4 votes
2 answers
134 views

How to speed up the following algorithm?

I have some random combinations of numbers pairs (where numbers range from 1 to some ntest) ...
John Taylor's user avatar
  • 5,827
16 votes
1 answer
470 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 ...
eldo's user avatar
  • 74.1k
0 votes
1 answer
76 views

How to select non-repeating pair of numbers?

Consider the following combinations of integers comb, where the integers range from 1 to n ...
John Taylor's user avatar
  • 5,827
11 votes
1 answer
259 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 ...
eldo's user avatar
  • 74.1k
18 votes
1 answer
335 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, ...
eldo's user avatar
  • 74.1k
0 votes
0 answers
58 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: ...
John Taylor's user avatar
  • 5,827
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, ...
eldo's user avatar
  • 74.1k
7 votes
1 answer
141 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 ...
Teg Louis's user avatar
4 votes
3 answers
485 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: ...
Teg Louis's user avatar
7 votes
1 answer
283 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 ...
Tugrul Temel's user avatar
  • 6,223
6 votes
3 answers
237 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 ...
dreeves's user avatar
  • 696
0 votes
2 answers
89 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 ...
Soon's user avatar
  • 648
6 votes
2 answers
246 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 ...
eldo's user avatar
  • 74.1k
1 vote
1 answer
93 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 ...
Russ Lyons's user avatar
1 vote
2 answers
176 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 ...
stoboja's user avatar
  • 19
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 ...
zjs's user avatar
  • 153
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: <...
Teg Louis's user avatar
3 votes
2 answers
176 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: ...
Stratus's user avatar
  • 2,954
3 votes
2 answers
212 views

Fill data points within the boundary established by the given points

I have the following data points: ...
葉柏樂's user avatar
  • 157
1 vote
1 answer
87 views

How to select the points that belong to the given region?

Consider two regions: ...
John Taylor's user avatar
  • 5,827
2 votes
1 answer
203 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}...
Radmehr's user avatar
  • 51
4 votes
5 answers
230 views

How to delete the complex numbers which are generated in a list of numbers?

Here I have generated a list of numbers ...
Sangeeta Dey's user avatar
1 vote
0 answers
112 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 ...
Kohei's user avatar
  • 11
3 votes
2 answers
133 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 ...
erfink's user avatar
  • 1,089
1 vote
0 answers
40 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 ...
JAC's user avatar
  • 21
3 votes
2 answers
112 views

Update Random Each Repetition of Animate

I found a solution that's not what I wanted but it will suffice Thanks - Larry ...
L. Gorham's user avatar
1 vote
3 answers
146 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 ...
Mandty24's user avatar
0 votes
1 answer
76 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. ...
Maksim's user avatar
  • 1
1 vote
1 answer
94 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. ...
rani's user avatar
  • 321
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 ...
John Taylor's user avatar
  • 5,827
4 votes
1 answer
264 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 ...
Ratheesh's user avatar
  • 317
1 vote
1 answer
100 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 ...
Display name's user avatar
1 vote
1 answer
138 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 ...
Greg's user avatar
  • 11
2 votes
1 answer
56 views

How to predict number from a set of data?

I have 2 sets of data. For example, ...
user8357568's user avatar
8 votes
1 answer
304 views

Creating a random symmetric matrix with a particular rank

The documentation about LinearAlgebra has a section on Constructing Matrices, but the examples of random matrices using RandomReal don't offer an obvios way to ...
lotus2019's user avatar
  • 2,131
0 votes
2 answers
76 views

Table generation with random variates inside. Mathematica [closed]

I'm new on this forum, and I'm also a new user of the software Mathematica. For this reason, I'm sorry if my question will be unclear and / or dumb. I have to make a numerical simulation with random ...
Gabriel T's user avatar
0 votes
1 answer
91 views

Bad performance of 3D self-avoid persistent random walk with periodic boundary conditions

I'm trying to simulate a self-avoiding persistent random walk with periodic boundary conditions a large number of times. For some reason, the script I've written is extremely slow for self-avoiding ...
M  .  M's user avatar
  • 105

1
2 3 4 5
19