2
votes
1answer
21 views

The probability of getting a certain image by random pixelation

Well, seeing that I'm terribly bad at math I don't know how to solve this, I'll try to explain, excuse me if I sound dumb. Just suppose that I've got a photo/image with 320x240 resolution and 24 bit ...
0
votes
0answers
12 views

How to normalise logarithm depending on the size of the range of possible values

I'm attempting to write a function which can be used to generate weighted random numbers between a set range, the size of which can arbitrarily grow and shrink, depending on some modifying value to ...
2
votes
0answers
52 views

“Alice and Bob” problem with matrices

Alice has a binary matrix $A$, and Bob has a binary matrix $B$. Both matrices are of size $n \times n$. Alice and Bob want to check if the matrices are equal except for exactly $1$ entry. Alice has to ...
1
vote
0answers
20 views

Ideal shrinking of discrete randomness source

I have a discrete randomness source that emits random integer numbers in range [0..N) with uniform distribution. I need to reduce this distribution, limiting it to ...
0
votes
0answers
20 views

Mathematically safe, open TAN generation and verification

For an upcoming Arduino project I need to generate, distribute and verify TANs (transaction authentication numbers). Let me explain (and assume for a second this is happening on a bigger computer). I ...
1
vote
2answers
50 views

Simple algorithm for generating Poisson distribution

I found a very simple algorithm that draws values from a Poisson distribution from this project. The algorithm's code in Java is: ...
13
votes
2answers
206 views

$e$ popping up in topic I'm unfamiliar with

I programmed up a little algorithm that goes like this: Fix two positive, real numbers, call them $\alpha$ and $\beta$. Generate a new, random, real number, $x \in [0,1]$ Set $\alpha$ = ...
0
votes
1answer
78 views

Generating Random Serialnumber with least similarity

I want to generate 16-digits hexadecimal serial-number like: F204-8BE2-17A2-CFF3. (This pattern give me 16^16 distinct serial-number But I don't need all of them as I describe below) I need an idea ...
2
votes
0answers
90 views

Using an elliptic curve to create pseudo random number

I recently started learning about encryption. I read about how elliptic curves can be used to create pseudo random numbers (and how the nsa might have abused this fact to create a backdoor in ...
1
vote
0answers
34 views

choose a list of words such that have equal letter frequency

I have a big list meaning full Words. surely letter frequency of this word list is different for each letter. Now my problem is to find a way to randomly select words from this word list to a new ...
1
vote
4answers
108 views

What is an example for an algorithm which makes use the power of randomness?

Can someone give a (most simple) example for an algorithm on a machine, which has access to random numbers, and which is faster than any other known algorithm for the same task? My actual motivation ...
0
votes
0answers
36 views

Slicing Up Uniform Random Rotation Quaternions

I'm generating uniform random rotations using quaternions. I am using the method attributed to Shoemake, which is discussed in another post (Uniform Random Quaternion In a restricted angle range): ...
4
votes
2answers
198 views

Algorithm to generate an uniform distribution of points in the volume of an hypersphere/on the surface of an hypersphere.

I am searching two simple/efficient/generic algorithms to generate a uniform distribution of random points: in the volume of a n-dimensional hypersphere on the surface of a n-dimensional hypersphere ...
1
vote
2answers
68 views

Pseudorandom numbers - Get a sequence of number not close each others

I have this function inside a software: a+(SeededRand(Round((SongTime-0.5+(Round(1000*c)))*1))-0.5)*b it creates a pseudo-random numbers sequence inside the ...
5
votes
1answer
168 views

Generate random numbers between a range such that no number comes twice.

Sorry if my question is stupid, math has been always a wild beast for me. I am an application developer. In one application I have a module which assigns a random 6-8 digit number and a serial number ...
1
vote
2answers
298 views

Can random number generators be used in compression?

This is basically a recurring thought I have from time to time and I suspect it is flawed, so my question is basically why can't you do the following: Basically, I imagine that given a seed and a ...
2
votes
1answer
174 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 ...
1
vote
1answer
215 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
150 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
66 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
279 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
145 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
199 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
706 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
58 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". ...
2
votes
4answers
526 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
80 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
513 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
144 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
177 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
156 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
155 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
115 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
883 views

How/why does this noise function work?

How/why does this noise function work? ...
3
votes
1answer
140 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
302 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
839 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
216 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 ...