Questions tagged [randomness]
Randomness is a way to mathematically model uncertainty. We often assume to have access to some well-defined source of random numbers, or that input values or events follow some probability distribution.
188
questions
2
votes
2answers
45 views
If current time in milliseconds is considered good enough random seed for a pseudorandom number generator, why not just use that time directly?
I was reading about pseudorandom number generators and how they need a seed and how that seed is usually current system time in milliseconds. One of the most common algorithms is the linear ...
1
vote
1answer
29 views
Simple generator of pseudo-random permutations of variable length short sequence
The problem in front of me is to write a function (from scratch) to permute n elements, where n is an argument. I decided to break it down to applying Knuth's shuffles algorithm, therefore I needed to ...
0
votes
1answer
48 views
Need help regarding random password generator: Urgent [closed]
I had generated a random password from a website which unfortunately has put me into trouble.
The password contains 26 characters which includes alphabets, numbers and special characters. My trouble ...
1
vote
1answer
48 views
Finding efficient randomized algorithm
I'm doing a course on randomized algorithms and
I've encountered a question that I'm struggling to solve.
Given a system of $m$ linear equations with $n$ variables over finite field $\mathbb{F_2}$ ...
0
votes
0answers
7 views
How to input random values (constraints) of any variables in case of formulating Linear Programming Problem?
Suppose,
Min 2x+3y
Subject to, x=2,x=5,x=7
y=5, y=9
is a linear program. Where x holds the values 2 or 5 or 7 and y holds the values 5 or 9. Then what should the correct ...
1
vote
1answer
28 views
Derandomize MAX-CUT problem using $\log n$ bits
Consider the MAX-CUT problem. We can flip $n$ coins to generate a random cut, and by linearity of expectation we get that with "good probability" our cut we'll be bigger then $\frac{n}{2}$.
Using ...
0
votes
0answers
23 views
Proving $BPP[\frac{1}{3},\frac{2}{3}] = BPP[a,a+\gamma]$ where $0<a<a+\gamma<1$
I can prove $BPP[\frac{1}{3},\frac{2}{3}] \subseteq BPP[a,a+\gamma]$ by sampling the promised $BPP[\frac{1}{3},\frac{2}{3}]$ Turing machine $k$ times and accept if $k\cdot(a+\frac{1}{2}\gamma)$ of the ...
0
votes
0answers
32 views
Are real computers capable of producing true random series with a program of finite length?
Suppose that one has a Blum–Shub–Smale machine. Is it possible to write down a program of finite length that produces a series of numbers, with each consisting of a finite number of digits, such that ...
21
votes
6answers
8k views
Can we generate random numbers using irrational numbers like π and e?
Irrational numbers like $\pi$, $e$ and $\sqrt{2}$ have a unique and non-repeating sequence after the decimal point. If we extract the $n$-th digit from such numbers (where $n$ is the number of times ...
2
votes
1answer
70 views
What doest it mean: “computer is an intelligence amplifier”?
There is one example in Kolmogorov complexity books and related articles:
Consider we have a monkey at a typewriter and a monkey at a computer keyboard.
If the monkey types at random on a typewriter,...
31
votes
2answers
2k views
Simulating a probability of 1 of 2^N with less than N random bits
Say I need to simulate the following discrete distribution:
$$
P(X = k) =
\begin{cases}
\frac{1}{2^N}, & \text{if $k = 1$} \\
1 - \frac{1}{2^N}, & \text{if $k = 0$}
\end{cases}
$$
The most ...
3
votes
1answer
36 views
How good (or bad) is my makeshift PRNG?
Say I have designed a makeshift PRNG for my personal amusement, now I would like to see how good it is. How do I benchmark its "randomness"? Ideally, I want to know a statistics test, such that if I ...
3
votes
1answer
50 views
Random observations of a total ordering, how much they tell us?
Suppose we have a total ordering over elements $a_1,a_2, ..., a_n$, meaning there is permutation $\pi$ such that $a_{\pi(1)}<a_{\pi(2)}<...<a_{\pi(n)}$. But we don't know $\pi$. What we know ...
1
vote
1answer
50 views
Uniformly random iteration of subtrees
I want to iterate through the first $k$ elements of a randomly ordered list containing all subtrees for a given tree. The definition of subtrees that I'm using is: "A subtree of $T$ is a subgraph of $...
1
vote
1answer
65 views
PRNG for a gaussian distribution?
I need suggestions for algorithm for Pseudo random number generators that will produce a near gaussian distribution (bell curve) for automatically generating test data. I know that PRNG produce ...
2
votes
1answer
37 views
Sublinear Homomorphism Property Testing Counter Example
This is a homework question, so I'm not looking for answers, just general guidance.
I'm looking at a Sublinear Algorithms survey where (Group) Homomorphism property testing is discussed. The case of ...
1
vote
1answer
50 views
Concentration bound for sum of dependent geometric random variable?
consider following persudocode:
i=0
while(i< k):
uniformly pick u,v in V
if(uv in E):
remove uv form E;
i++;
let $T$ be the number of ...
1
vote
0answers
62 views
Matrix with zero spectral radius
I need an algorithm which generates a random matrix with spectral radius equal zero.
The only solution I have so far is to generate two vectors $v,w$, normal onto each other ($v\perp w$), and then ...
-1
votes
1answer
79 views
Is there a name for this shuffle algorithm?
Is there a standard name for the following algorithm? At each step, the code picks an index, remove the object at that index, and remember to never pick that index again. See the following ...
0
votes
2answers
31 views
Random conditional association
I have a really specific problem to solve and i'm looking for an existing algorithm to help me (i hope i'm in the right section of stackExchange).
I would have to make "random" association between ...
1
vote
1answer
30 views
On uniform randomness of the weight of the remaining edges of a graph after deleting some of them
Suppose we have a graph $G(V,E,W)$, where $V$ and $E$ are the set of vertices and edges and $W$ is non-negative weight on the edges. Let $w(e)$ be the weight of edge $e$ and $N(e)$ be the neighboring ...
6
votes
1answer
177 views
Is it possible to simulate a fair coin with a finite number of tossing of a biased one?
It is a classic problem to simulate a fair coin with a biased one.
According to Fair Coin (wiki),
John von Neumann gave the following procedure:
Toss the coin twice.
If the results ...
1
vote
2answers
247 views
How to determine seed collision probability in a PRNG?
I want to use a PRNG to generate random patterns. I would provide the PRNG with a hash value as a seed. Ideally, the seed size would be 64-bit or 128-bit and I would expect no collisions if the seeds ...
2
votes
1answer
31 views
Is there a complexity class “BQP without error”?
I was wondering if there is a complexity class for problems that can be solved efficiently by a quantum computer such that it always gives the right answer? For example the Deutsch-Josza algorithm ...
1
vote
0answers
95 views
Generate higher dimensional pink noise
1D Pink noise, is easy enough to generate. See https://www.dsprelated.com/showarticle/908.php for example.
What about higher-dimensional pink noise, such as 2D or 3D pink noise? Is there an algorithm ...
3
votes
1answer
133 views
How could you characterize “true randomness” of a finite sequence?
This question occurred to me while reading http://arxiv.org/abs/1806.08762/ Any observed sequence is necessarily finite, and any finite sequence is computable, either by explicitly storing all the ...
0
votes
1answer
66 views
Finding the Entropy of a random experiment with probability of $\frac{1}{3}$
Entropy is the randomness collected by an operating system or application for use in Cryptography or other uses that require random data. The formula for Entropy is $$H(p_1, ..., p_k)=-\sum_{i=1}^{k} ...
2
votes
1answer
361 views
Generating uniformly random bits from a stream of arbitrarily biased bits
Say we have a function called GenBiasedBit. This function returns 1 with probability p (where p is an unknown real number between 0 and 1 exclusive) and returns 0 with probability 1 − p. How could I ...
25
votes
11answers
9k views
Is von Neumann's randomness in sin quote no longer applicable?
Some chap said the following:
Anyone who attempts to generate random numbers by deterministic means is, of course, living in a state of sin.
That's always taken to mean that you can't generate ...
1
vote
1answer
57 views
Are there any stochastic models of non determinism in the rate of program execution?
We know that typical operating systems and high level languages (especially those with garbage collection) cannot be used for real time operating systems. Java & jet engines don't mix, and ...
1
vote
2answers
62 views
Would using mouse position in the below scenario generate true random numbers?
I'm having trouble wrapping my head around random number generation so I figure it would be better to ask now, rather than screw up later.
Let's say I want to write a function that generates a random ...
7
votes
3answers
2k views
Problem with the pseudo random number generator One-Time-Pad
I've started learning cryptography in class and we've come across One-Time-Pads, in which the key (uniformally agreed upon) is as long as the message itself. Then you turn the message into bits, do $...
1
vote
1answer
145 views
Placing small circles randomly inside a larger circle, where no two small circles intersect
Sorry if this is the wrong place to ask, was unsure...let me know if it belongs some where else.
So i am trying to work out a way to write an algorithm to place a series of small circles of a set ...
2
votes
1answer
96 views
Why doesn't this put $BPP$ in $NP$?
From Sipser Gacs we know $x\in L(M)$ for a machine $M\in BPP$ $\iff$ $$\exists t_1,\dots,t_{|r|}\forall r\in\{0,1\}^{|r|}\vee_{i\in\{1,\dots,|r|\}}M(x,r\oplus t_i)=1.$$
From Adleman we know $x\in L(M)...
3
votes
1answer
83 views
RNG: removing bias by counting bits
I have a hardware RNG that sends me some random bits. Due to nature of that RNG, the source is biased. Then, the bitstream is processed in a following way to remove the bias:
two counters are used, ...
2
votes
1answer
192 views
Expected Linear time Minimum Spanning Tree algorithm
I am trying to understand the proposed "Randomized Linear-Time Algorithm to Find MST".
My findings:
I have read and search almost every available resource( main paper, wiki, reports on paper, lecture ...
0
votes
1answer
39 views
Looping through random integers - will it halt with probability 1?
Say I have a simple program that has the pseudocode like this:
...
1
vote
1answer
36 views
Randomly choose a line - algorithm
We have a large file that can't fit into internal memory. How do we randomly pick one line so that each line has the same probability to be picked?
And how do we randomly pick such n lines so that ...
5
votes
3answers
1k views
How to select a binary tree node uniformly at random
The exercise I'm trying to solve is
You are implementing a binary search tree class from scratch, which, in addition, to insert, find and delete, has a method ...
2
votes
2answers
53 views
Indexing a random permutation
I am curious if there exists a method for specifying a permutation $F_k: X \to X$ with a small(ish) $k$.
Something that comes very close to my goal is a block cipher, say AES. But block ciphers have ...
3
votes
2answers
380 views
What Good Is Kolmogorov Complexity Since It Is Relative?
Kolmogorov complexity is relative to a choice of Universal Turing Machine. Because of the Invariance Theorem, the difference in complexity assigned by two Universal Turing Machines is bounded by a ...
2
votes
1answer
120 views
Fitness model for scale free networks
In order to generate scale-free networks, we can use this algorithm, derived from Barabási–Albert model:
1) we assign every node a "weight" $\theta_i$ (or two in the direct case).
2) we place $m$ ...
1
vote
3answers
84 views
Given a sufficiently powerful computer and model, can dice rolls be predicted?
I guess that this is a chaos, randomness and modelling question. Can it be conceived that a sufficiently powerful (perhaps quantum) computer might be able to accurately predict the scores on a ...
1
vote
0answers
46 views
What is the relationship between entropy rate and quantization?
I have a totally random source of signal data that looks like a typical normal distribution. I've included an image as I like pictures:-
The source has a mean of 0, and a standard deviation of 1. ...
0
votes
1answer
35 views
TRNG by hamming distance of processor tics
I hardly remember on a lecture, where it was told, that the distance of the practical actual running-speed of a processor to the previous tic is used, to generated a true random entropy for seeding. ...
8
votes
2answers
230 views
What makes a pseudorandom generator, a high quality one?
Reading this answer to this SO question: Why do we not combine random number generators?, it talks about
very high-quality PRNG (Pseudo Random Number Generator)
so it makes me wonder what ...
2
votes
1answer
938 views
How to understand the analysis of expected running time of randomized quick-sort in this paper?
I'm learning the book named Data Structures & Algorithms in Python.
On Page 557-558, there is a proof of the expected running time of randomized qucick-sort. I have some problems confusing me ...
5
votes
2answers
332 views
Shuffling a list while keeping order relative to related elements
I'm looking to shuffle a list of the elements $a_1,\dots, a_6, \dots, e_1, \dots, e_6$
while keeping two rules:
if I loop though the list and filter out a specific letter or number it should be in ...
2
votes
3answers
431 views
Why do we need Gibbs sampling (and MCMC)?
I just learned about Gibbs Sampling which is an MCMC method. Given a distribution $\pi$, we want to sample an item according to $\pi$.
Maybe my alternative suggestion would sound somewhat naive (even ...
0
votes
1answer
42 views
Difference in scale between mean page loading times and exponentially distributed page loading times?
Apologies if this is the wrong place to ask.
For my experiment, I have a single-page application and a multi-page application. I am testing them with an exponential distributed delay throttling. The ...