2
votes
1answer
20 views

Fast generation of Pareto-distributed randoms.

I'm developing a library of routines for generating random numbers for simulations (it's on GitHub). I've included fast routines for normally distributed and exponentially distributed randoms, using ...
0
votes
1answer
60 views

Simple random sample without replacement

I have a data file from which I wish to create a uniformly distributed simple random sample, without replacement. Will the following algorithm give me an unbiased result? ...
1
vote
1answer
49 views

Algorithm to generate a random sequence.

Let $f(n):\mathbb N \to\mathbb N$, be a function randomly gives a integer from $0$ to $n-1$. How can I generate a random sequence of integer with $n$ element which contain every integer from $0$ to ...
1
vote
1answer
39 views

Finding a distribution for random number generation

I am writing a program for solving the shortest path in travelling salesman problem, with a twist that there are multiple salesmen who partition the cities among themselves, thus creating two part ...
1
vote
1answer
147 views

What are the differences between the random walk and the gaussian random walk?

I know the random walk mobility model, but I can not understand what are the differences with respect to gaussian random walk. In other words, I know how to implement the two-dimensional random walk: ...
1
vote
0answers
85 views

Efficient generation of a von Mises-Fisher distribution

The von Mises-Fisher distribution is a probability distribution on the ($p-1$)-sphere. I'm interested in the efficient generation of this distribution for a relatively high dimension ($1000$ or ...
4
votes
1answer
160 views

Pseudo random number generator: Why not to use “too many” random variables in one application

I found statement in an article "Good Practice in ( Pseudo ) Random Number Generation for Bioinformatics Applications" that you should not use too many random variables in a single simulation. Authors ...
0
votes
1answer
290 views

Uniform Random Quaternion In a restricted angle range

I'm trying to sample uniform random rotations. I'd like the rotations to be restricted in a range [-θ,θ]. I found a method by K. Shoemake which can be summarized as: ...
2
votes
2answers
53 views

Does re-ordering a shuffled pile while drawing from it affect the randomness of the draw?

In the game "Settlers of Catan", there is a stack of fourteen tiles, four of which are "water", two "gold", and the other eight an arbitrary mixture of "sheep", "wheat", "ore", "brick", and "lumber". ...
1
vote
4answers
220 views

Get `n` random values between 2 numbers having average `x`

I want to get n random numbers(e.g n=16)(whole numbers) between 1 to 5(including both) so that average is x. x can be any value between (1, 1.5, 2, 2.5, 3, 3.5, 4, ...
1
vote
1answer
69 views

Finding a subsequence (of a very long sequence) which does not sum to an even number

[Edited. I've revised to problem to focus on the special case of the integers modulo 2.] You are given a function f from binary strings x ∈ {0,1}n to the integers, or (without loss of ...
5
votes
1answer
309 views

Generating geometrically-distributed variates over an interval given endpoints and expected value

I want to generate random variates from a truncated geometric distribution over the interval $[0, n)$ with specified expected value, $0 \le E < n$. The obvious way to do this seems to be to sample ...
1
vote
1answer
94 views

Period of least significant bits of linear congruential random number generator

On a practice exam for a course on stochastic simulations I encountered the following question: Show that the least significant $n$ bits must repeat with a period $2^n$ for a congruential random ...
3
votes
0answers
162 views

Simulation and Stochastic Processes

Supposing we want to take a sample from the distribution $p(x)=cp^*(x)$ where $c$ is the normalization constant and $p^*(x)$ is given by $$p^*(x)=0.5\exp(-(x-\mu_1)^2)+0.5\exp(-(x-\mu_2)^2).$$ ...
0
votes
1answer
148 views

Algorithms and Simulation

Supposing we want to take a sample from a $N(0,1)$ distribution and i can take a sample from a $N(0,σ^2)$. (a) Construct a disposal/rejection algorithm with function $N(0,σ^2)$, which generates a ...
0
votes
1answer
112 views

Generating a random Eisenstein integer matrix whose inverse has Eisenstein integer entries

Thanks to a question I previously asked, I realized that a Gaussian integer matrix should have a determinant of $\pm 1$ or $\pm i$ for it to have an Gaussian integer inverse. From that, I gather that ...
1
vote
2answers
102 views

terrain generation help

I'm trying to make a 3D terrain generator. In doing so, I decided that I would use basic rectangles and then just turn them by having 4 points, 1 on each side, then turn the rectangle to fit in those ...
5
votes
1answer
548 views

How/why does this noise function work?

How/why does this noise function work? ...
2
votes
1answer
108 views

Uniform PRNG for long integer structures

Good morning! I don't actually know where to attribute this question (maybe it's better to publish it on StackOverflow), but it's more related to math theory than to actual realization. Since the ...
5
votes
1answer
232 views

How is a Halton sequence related to a Latin hypercube?

I currently use a Halton sequence to choose parameter sets for a prognostic model (e.g. using metabolic rate and protein content parameters to predict growth rate). From my understanding, both a ...
0
votes
1answer
365 views

Consequences of choice of a seed for random number generating algorithm?

Background I am trying to do a reproducible scientific analysis. My conclusions are not dependent on the random number generator, but the RNG does change the results ~1% between runs. I would like to ...
2
votes
3answers
171 views

Expected time of tree search algorithm on random input

We have a perfect binary tree on 2^k-1 nodes. Every node in the tree is marked with probability 1/2, and a node is either marked or unmarked. We want to find a marked node and return it. Our algorithm ...