# Tag Info

### How to sample points randomly below a curve?

There is no need in filtering out random points in a rectangle that don't fall in the prescribed region. The sampling within a region can be done directly with ...
• 24k
Accepted

### Efficient way to simulate thousands of Markov chains

While the other answers focus on circumventing the simulations, I focus on how to speed up the simulations themselves. (Sometimes, simulations might be unavoidable.) In this situation, when calling <...
Accepted

### Sisyphus Random Walk

We can iterate with FoldList: data = {0, 1, 1, 0, 1, 0, 1, 1, 1, 1}; FoldList[#2 * (#1 + #2)&, data] ...
• 36.4k
Accepted

### How to sample points randomly below a curve?

As noted in my comment, one approach is as follows. First, generate thousands of pairs of random numbers in the range {0, 2 π}, ...
• 61.8k
Accepted

### Implementing a planetary terrain generation algorithm

Here my two cents. I observed that the major part of the computation is about multiplication. Hence I transformed to logarithms such that we can use summations which can be executed efficiently with <...

### Implementing a planetary terrain generation algorithm

I have a basic implementation of this which I use with the output of DiscretizeGraphics: ...
• 47k

### New Compiler Technology in V12

I wanted to look into this for a long time, and it took only 2 months to come back to this question. To answer your main question: Yes, it appears that the new compiler only supports uniformly ...
• 113k
Accepted

### Generate randomly sized non-overlapping disks?

Just a quick modification of the code here, ...
• 69k
Accepted

### Why do changing the limits of RandomInteger not affect the result?

I'm pretty sure this is expected. Consider the following implementation of RandomInteger: ...
• 34.2k

### How to sample points randomly below a curve?

More of a first principles approach, use the function as a PDF to generate random x data, then for each ...
• 39k

### Smarter Shuffle of a List

You may Flatten the list and then take a RandomSample before partitioning to the original dimensions with ...
• 42.4k

### Is there a way to randomly distribute points within a circle on the surface of a sphere?

You can intersect the sphere and a cylinder, and then use RandomPoint. For example, here is a random point on the sphere: ...
• 131k

### How to create a random zonogon?

We can using Minkowski Sum (RegionDilation) of any Line's from the fixed point ...
• 77k
Accepted

### Reproducing Heinrich Heidersberger's Rhythmograms

A starting point We use two variables {u,v}: a parametric form of Mobius Strip f[u,v] and product with some factors to ...
• 77k
Accepted

### Is RandomGraph really random?

Indeed there are four graphs with 5 vertices and 7 edges, two of which have a Hamiltonian cycle: ...
• 65.9k
Accepted

### Random points around the given curve

Using RandomPoint[] with TubeMesh[] (routines from here and here) does the job: ...

### Efficient way to simulate thousands of Markov chains

I essentially derive a second distribution - without a need for stochastic modelling - from DiscreteMarkovProcess timeslices according to your state to value ...
• 19.1k

### RandomChoice output isn't packed

In order for RandomChoice to produce a packed array, the RHS of the rule needs to be packed: ...
• 131k

### Probability of an event

Using built-in statistical functions (Discrete Univariate Distributions). sampleBernoulli[p_, n_] := RandomVariate[BernoulliDistribution[p], n] Then ...
• 42.4k

### Efficient way to simulate thousands of Markov chains

In general, Mathematica is not always the best tool for this type of simulation. That said, you do not need to compute sample paths to compute the mean or variance. For a Markov chain with ...
Accepted

### On random numbers extracted from NormalDistribution by two different methods under the same seed

I think this is due to the Box–Muller transform that is employed to generate pairs of normally distributed values. This method is much faster than using the inverse commulative probability function. ...
Accepted

...
• 398k

### How can I generate the same random number in Mathematica and MATLAB?

If it is solely for regression testing, the quality of the random numbers doesn't matter very much. You can substitute a better random number generator once you know the Mathematica version matches ...
• 16.8k

### Generating random sequence of integers with ordering constraints

Perhaps have a look at DiscreteMarkovProcess using an appropriate transition matrix embedding your constraints? Here's a simple example, implementing 1-5 above, to ...
• 4,405

### Generating animations of clouds with Mathematica

Nice cloud-like images can be generated by summing "octaves" of any of a number of continuous noise functions. Perlin noise is one possibility, as mentioned in the OP; here, I'll present a slightly ...
Accepted

### Probability a random triangle on a circle contains the origin

Some issues with your code are that the list of random data you generate is not a PackedArray; moreover creating random numbers is more efficient if you generate ...

### Better random (unique) file name

It might be best to use CreateUUID. CreateUUID[] "73ccc27c-687f-4eca-8214-ceeb8a8b7773" ...
• 36.4k

### Generating random points on a Klein's bottle

There is a function for this since Mathematica 10.2. ...
• 70.8k