Questions tagged [random]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
29 views

RandomVariate and Map, strange behavior noticed

I'm performing Bayesian Analysis and I have written this piece of code ...
3
votes
1answer
517 views

Random walk with decreasing step size

I have to make simulation of a random walk that gets smaller and smaller. Each step the x-axis gets rescaled 1/2 and y-axis by 1/Sqrt[2]. So one needs more and more ...
4
votes
2answers
184 views

Get random solution for equation with $n$ parameters and infinite solutions?

I'm trying to get a random solution for an equation with arbitrary number of parameters which has infinite solutions. Note that the answer must be in n dimensions ...
2
votes
1answer
170 views

How can one generate an open-ended sequence of low-discrepancy points in 3D?

I'd like a low-discrepancy sequence of points over a 3D-hypercube $[-1,1]^3$, but don't want to have to commit to a fixed number $n$ of points beforehand, that is just see how the numerical ...
2
votes
3answers
403 views

3D random walk between two end points

Say I have 2 endpoints A and B. I would like to use W. Mathematica to generate a random walk between these two endpoints in a three-dimensional space. Es.: A=Point[{0,0,0}] and B=Point[{1,1,1}]. I ...
1
vote
1answer
120 views

Rescaling random walk

I want to make an animation of a random walk that rescales every time the graph gets to the end point, with the condition that the plot range on x axis is only on [0,1]. In first step, the graph ...
0
votes
0answers
42 views

Difference in the eigenvalues of random matrices

I am a novice in Mathematica and coding, in general. I have doubts in understanding a code in which nearest neighboring distance between eigen values of random matrices is evaluated. ...
3
votes
1answer
244 views

Problems with RandomChoice

Consider an Matrix of dimension n1xn1. I would like to get a list with n2 distinct matrix (of dimension ...
5
votes
1answer
252 views

ParallelTable much slower than Table on RandomReal with arbitrary precision

So I was trying a very simple example (Mathematica 11.0.1) ...
2
votes
1answer
172 views

Adding random numbers to the arguments of a sum of cosines

This is probably really a simple question. I would like to plot a sum of cosines with increased argument and for each cosine in sum I would like to add random value: ...
1
vote
1answer
270 views

Animating Random walk [closed]

I need to make a animation of a development of a random walk. The code for generating the walk itself works, but when I try to animate it, I get an error saying Non-negative machine-sized integer ...
-3
votes
1answer
101 views

Plotting randomly generated points [closed]

I am trying to generate 100 random points of variables mf1 and msc1 and calculate mhiggs. I ...
0
votes
1answer
130 views

How to perform integration processes NDSOlve and show list of random variables used in this process?

I have an ODE system which solves of n variables, with initial conditions defined using the previous differential equation solution of n-1 variables and with an initial condition for the last variable ...
1
vote
1answer
89 views

Estimating angle between two random vectors

I'm interested in angles between random vectors on unit ball. Expected value of cosine is 0 by symmetry, so, expectation of cosine squared is the interesting bit. The following ...
0
votes
2answers
156 views

How to create lists with random numbers symmetric?

I need to create two vector lists using table. This list contains random numbers that I want to be symmetric. ...
1
vote
1answer
445 views

Fourier Transform With Noise

For the following function I need to do the following steps. Sin[2πt](1+0.2 Sin [6πt] + 0.1 Sin [8πt]) Plot the function. Generate a table of data points from this function with random noise ...
0
votes
3answers
126 views

Create a random array totaling a given value with given numbers [duplicate]

I have to create a random 16x16 array filled so that the sum of the entire flattened array is 500 (e.g. the sum I'd need for the array ...
0
votes
0answers
89 views

Mathematica cannot generate the random variables for a given Probability Distribution

I need to generate a large number of random variables from the distribution generated by the following code. Distribution is given by DistributionF. The code is ...
5
votes
5answers
296 views

Numerical approximation of $\pi$

Points are randomly scattered inside the unit square, some fall within the unit circle with probability $P=\pi/4$. so $P$ is approximated by the fraction $$P\approx \frac{\text{Number of red ...
11
votes
1answer
134 views

Dataset interferes with SeedRandom

Bug introduced in 11.0.1 or earlier and fixed in 11.1 This seems like a pretty awful bug: SeedRandom[1]; RandomInteger[10, 10] Out: {1,4,0,7,0,0,8,6,0,4} While:...
4
votes
0answers
116 views

List of mathematicians

How to make a list of mathematicians by using Mathematica? There are $284387$ person entity in Mathematica, but I need only mathematician entity I tried something like this ...
1
vote
3answers
205 views

Uniform distribution with restricted domain in dimensions $\ge 2$

I want to generate numbers from a 2D "cylindrical" distribution, whose PDF would be: $f(x,y) = \begin{cases}1/(45^2 \pi) & x^2+y^2 \le 45\\0 & \text{otherwise}\end{cases}$ I don't know if it ...
5
votes
1answer
55 views

Explanation for RandomChoice list increment behavior [duplicate]

Why does this code produce a number close to 1000 but not exactly 1000? a = {0, 0}; Do[a[[RandomChoice[{1, 2}]]]++, 1000] Total[a] Moreover the number seems to ...
1
vote
1answer
112 views

Generate a list of randomly distributed $1$s and $0$s with fixed proportion of $1$s [duplicate]

I need to simulate a random initial state of an 1D cellular automaton, but with different 'densities' of filled cells. Let's say the size of the list is $N$, then I need to be able to fix a number $P$...
6
votes
1answer
204 views

Why is Compile + RandomReal faster than random real?

In the process of playing around with Compile, I discovered something surprising. RandomReal[{-1, 1}, 3] is a lot slower than <...
3
votes
1answer
87 views

RandomVariate problem with PascalDistribution? (10.3, Win) [duplicate]

Observe: ...
4
votes
2answers
106 views

How can I speed up getting a random point from from the difference of two regions?

I am trying to create a blue point (please see image below) within a small radius of a red point such that the blue point lies outside of the black circle. The code thatIi have used to generate the ...
1
vote
3answers
480 views

Generate a set of `n` random numbers with mean $\mu$ and standard deviation $\sigma$? [closed]

What is the most convenient way to generate a sample of i.e. n=500; random numbers (integers? floats?) with mean mu=50; and ...
2
votes
0answers
283 views

Random points on the Cuboid, and using FindShortestTour

How to plot a random points on the Cuboid? Graphics3D[{Yellow, Opacity[0.3], Cuboid[{0, 0, 0}, {1, 3, 1}]}, Boxed -> False] And how can I use ...
3
votes
1answer
91 views

How do I interpret the time series processes format?

How do I interpret the result: ARIMAProcess[2.22836, {0.363326}, 1, {}, 6.35083] in terms of the equivalent recurrence equation; say ...
14
votes
5answers
964 views

Random points around the given curve

How to plot a random points around the following Helix curve? ...
0
votes
1answer
87 views

Constrain a variate to never be zero

Is it possible to impose a constraint on the generation of a variate so that it cannot be zero? For example, I have expressions like this: ...
3
votes
4answers
85 views

Create process with a series of irregular changes

I want to create a process with a series of irregular changes. For example, imagine we have a list of day numbers: {10, 23, 37, 45, 62} and a list of changes of the same length: {-5, 7, 14, -3, 25} ...
5
votes
1answer
543 views

How to generate certain number of random points in a convex hull mesh?

I am a newbie to Mathematica. I have some 2D point data, and I generated a ConvexHullMesh from it. Now, I want to generate a certain number of random points within ...
2
votes
1answer
90 views

How to find a value to make function positive and real? [closed]

Let ...
7
votes
1answer
271 views

The curious case of missing random-walking particles in the box

Note: I added the entire code I wrote below to generate the initial configuration and have explained step by step what each part of the code does Kindly bear with the code and the explanation. Since ...
25
votes
4answers
2k views

How to sample points randomly below a curve? [duplicate]

How can I randomly select 1000 points uniformly from the shaded area below the plotted curve? Plot[1/π Cos[θ]^2, {θ, 0, 2 π}, Filling -> Bottom]
3
votes
2answers
305 views

Sum acting weird for large values [duplicate]

I have the following functions: T = Compile[{n}, Boole[Sum[RandomReal[]^2, {n}] <= 1]]; Monte[d_, n_] := Sum[T[d], {n}]/n*2^d T is a function that generates a ...
-7
votes
1answer
194 views

Can one use the new random matrices features of Version 11 in addressing a certain octonionic-based question?

I have cross-posted the question https://math.stackexchange.com/questions/2012301/can-one-test-an-octonionic-interpretation-for-a-conjecture-apparently-valid-in and https://physics.stackexchange....
10
votes
1answer
381 views

Is RandomGraph really random?

I think there are 2 non-Hamiltonian graphs with 5 vertices and exactly 7 edges. There are a total of 4 graphs with 5 vertices and 7 edges. If I run (in version 9): ...
0
votes
2answers
432 views

Maximum Likelihood estimation

I am trying to implement this function and solve for parameters: Now as many can see it is a maximum likelihood estimation: I have this data: ...
1
vote
0answers
84 views

ItoProcess with log

I would like to use ItoProcess to simulate some paths of $r(t)$, a process that follows the sde $$d\ln\left(r\left(t\right)\right)=\left(\theta-\ln\left(r(t)\right)\...
0
votes
2answers
2k views

How to generate random numbers for Beta distribution in a range?

In Excel I can just write: BETA.INV(RAND(),alpha,beta,lowerbound,upperbound) To generate a beta distributed random between lower bound and upper bound How can ...
0
votes
1answer
197 views

Beginner Simulating Gaussian Process with Correlation

I have no little experience with algorithms. I would like to learn how to simulate a real valued Gaussian process with correlation (e.g., exponentially correlated $\Gamma(t)=e^{-\vert t \vert/2}).$ ...
5
votes
2answers
152 views

Colorize $3D$ “random walk” of $\pi$ digits

The following graphic is a 3D "random walk" of $\pi$ digits by converting them in base $6$ representing $6$ directions : ...
1
vote
0answers
57 views

Alternative Methods of Using Cumulative Density Functions To Obtain Probabilities

I have a CDF that is generated from the subtraction of two arrays as part of a minimization procedure. A consequence is that events in the simulation can cause the subtracted total to be less than 0: ...
4
votes
0answers
97 views

Unexpected behavior of FindClusters

This is my code created by 10.4ï¼ ...
1
vote
1answer
189 views

Continuous noise representation

I am new to stochastic processes (and actually Mathematica too) and there are many things that I still didn't fully understand yet so please forgive me if I say something wrong. What I am trying to ...
7
votes
0answers
68 views

Problem/bug with `RandomVariate` and `FirstPassageTimeDistribution`?

...
0
votes
1answer
88 views

random walk using RecurrenceTable

I'm trying to generate a random walk using RecurrenceTable: ...