49

If "manually" includes "mechanical" then you have many options available to you. To simulate a Bernoulli variable with probability half, we can toss a coin: $0$ for tails, $1$ for heads. To simulate a geometric distribution we can count how many coin tosses are needed before we obtain heads. To simulate a binomial distribution, we can ...


45

If you can get access to a very precise clock, you can extract the decimal part of the current time and turn it into a uniform, from which you can derive a normal simulation by the Box-Müller transform:$$X=\sqrt{-2\log U_1}\,\cos(2\pi U_2)$$(and even two since $Y=\sqrt{-2\log U_1}\,\sin(2\pi U_2)$ is another normal variate independent from $X$). For ...


20

Yes, coin flip is truthfully random process. While it is possible to load a die, so that it favours certain outcomes, you cannot bias a coin (see paper by Andrew Gelman and Deborah Nolan published in The American Statistician for further details). You can argue that coin toss is a deterministic process and in fact you can build a mathematical model that ...


19

the chance of finding this random seems low to me whereas finding BABDCABCDACDBACD seems less random. Why would that be? If the overall proportion of letters A...D is equal to 0.25 for each letter, and each letter is independent of the other one, then both words are exactly equally probable. If the distribution of letters differ, then of course the ...


18

This is not possible, unless you managed to retrieve missing data. You cannot determine from the observed data whether the missing data is missing at random (MAR) or not at random (MNAR). You can only tell whether the data is clearly not missing completely at random (MCAR). Beyond that only appeal to plausibility of MCAR or MAR as opposed to MNAR based on ...


18

Let's count and see. By construction of the file, all 4-bit strings are equally likely. There are 16 such strings. Here they are: 0. 0000 1. 0001 2. 0010 3. 0011 4. 0100 5. 0101 6. 0110 7. 0111 8. 1000 9. 1001 10. 1010 11. 1011 12. 1100 13. 1101 14. 1110 15. 1111 Your procedure throws out strings 10 through 15. So in the cases that you actually ...


18

If you are not making any inference for a wider group than your actual sample, then there is no application of statistical tests in the first place, and the question of "bias" does not arise. In this case you would just calculate descriptive statistics of your sample, which are known. Similarly, there is no question of model "validity" in this case - you ...


17

I'll have a go at this, though it's a bit above my head, so treat with sprinkle of salt... You're not exactly wrong. I think that where your thought experiment falls down is that differential entropy isn't the limiting case of entropy. I'm guessing that because of this, the parallels between it and Kolmogorov complexity are lost. Let's say we have a ...


17

You could try Shannon information: $$ H = -\sum_{i = 0}^n {P_{i}\log_{2}(P_{i})} $$ where, $P_{i} = \frac{c_{i}}{n}$, $c_{i}$ is the count of some letter $c$ in the word and $n = |{\rm word}|$. For the first word you have $H = 0.35$. In the second word you have $H = 2$. If the entropy is high, you could think of it as more random vs. another word with ...


16

How would you demonstrate an event "eventually happens"? You would conduct a thought experiment with a hypothetical opponent. Your opponent may challenge you with any positive number $p$. If you can find an $n$ (which most likely depends on $p$) for which the chance of the event happening by time $n$ is at least $1-p$, then you win. In the example, "$S_n$...


12

Theory If the autocorrelation is going to have any meaning, we must suppose the original random variables $X_0, X_1, \ldots, X_N$ have the same variance, which--by a suitable choice of units of measure--we may set to unity. From the formula for the $L^\text{th}$ finite difference $$X^{(L)}_i=(\Delta^L(X))_i = \sum_{k=0}^L (-1)^{L-k}\binom{L}{k} X_{i+k}$$ ...


9

In addition to the Dieharder suite that Sephan Kolassa mentioned, other well known test suites include TestU01 and the NIST Statistical Test Suite (STS). The PractRand library you mentioned rates Dieharder and STS as "bad" and TestU01 as "good". But, unlike the other test suites, PractRand is not as well known, and there do not seem to be any academic ...


9

Other answers here have focused on the overall occurrence of different letters in the sequence, which may be one aspect of the "randomness" expected. However, another aspect of interest is the apparent randomness in the order of the letters in the sequence. At minimum, I would think that "randomness" entails the exchangeability of the vector of letters, ...


8

I found the information I was talking about in my comment. From van Buurens book, page 31, he writes "Several tests have been proposed to test MCAR versus MAR. These tests are not widely used, and their practical value is unclear. See Enders (2010, pp. 17–21) for an evaluation of two procedures. It is not possible to test MAR versus MNAR since the ...


8

Random relates to random variable, and independent relates to probabilistic independence. By independence we mean that observing one variable does not tell us anything about the another, or in more formal terms, if $X$ and $Y$ are two random variables, then we say that they are independent if $$ p_{X,Y}(x, y) = p_X(x)\,p_Y(y) $$ moreover $$ E(XY) = E(X)E(...


8

I think it makes sense to think of the world of mathematics and the real world as separated in principle. However, firstly in order to make real use of mathematics, the world of mathematics and the real world have to be connected by interpretation, including addressing/checking whether the connection is appropriate. Secondly, mathematics was originally, and ...


7

At least for the "Mann-Kendall Rank Test", the problem seems to be in the testing package you're using, and not in the data. Specifically, the Mann-Kendall test is supposed to detect monotone trends in the data by calculating the Kendall rank correlation coefficient between the data points and their position in the input sequence. However, looking at the ...


7

Given one realisation of the iid random sample $(X_1,\ldots,X_n)$, $(x_1,\ldots,x_n)$, corresponding to one element $\omega$ of $\Omega$, the random variable $$X_{(1)}=\min_{1\le i\le n} X_i$$ takes the value $$\min_{1\le i\le n} x_i=\min_{1\le i\le n} X_i(\omega)$$ The index $i$ of the smallest realisation among $(x_1,\ldots,x_n)$ is itself the realisation ...


6

Computers achieve randomness by two means: A source of 'true' randomness: This can be a circuit that picks up background radiation or some complex quantum mechanical device. A pseudo-random number generator (PRNG): An algorithm that is not actually random (run it twice, you get the same output) but whose output is very difficult to distinguish from true ...


6

Statistical calculations can answer this question: IF you collected many random samples, in what fraction would the mean be as far (or further) from the population mean as you observed? If the answer is tiny, you might suspect that the sample was not random. But statistical calculations cannot answer the question: Was this a random sample? The only way to ...


6

Regardless of how fair the coin toss is, it is not a good way to assign treatments in a clinical trial. With a perfectly fair coin toss, it is possible that all of the subjects get assigned to the same treatment! While that would be rare, it would be fairly common to end up with a very lopsided distribution of treatments. Better: Shuffle the order of the ...


6

The "suggested algorithm" is incorrect. One way to see why that is so is to count the number of equiprobable permutations performed by the algorithm. At each step there are $m$ possible values for $k$, whence after $n$ steps there are $m^n$ possible results. Although many results will be duplicated, the point is that the probability of outputting any ...


6

The Poincaré plot that you specifically refer to (from wikipedia) is indeed the same as a lag plot. However, as Fabrice Pautot notes in his answer a Poincaré map(/plot) more commonly refers to something different, something more general (also on wikipedia). This ambiguity in the reference to Poincaré (map or plot) is probably due to the researchers in the ...


6

The dependence structure is simply the values of $f(x_1,\cdots,x_n):=P(X_1,\cdots,X_n)$. So by permuting the vectors, you are also permuting the dependence. Nothing is lost (unless you can't keep track of your permutation indices). For example, if $Y=(Y_1,\cdots,Y_n)$ with $Y_i=X_{\pi(i)}$, where $\pi$ is your permutation, then $P(Y_1,\cdots,Y_n)=f(Y_{\pi^{-...


6

It's a typical brain teaser. Invert the question: what is the probability that none of the blue balls are scooped out of the bag? All of a sudden it's easy to answer! $$\frac{n-r}{n}\frac{n-r-1}{n-1}\dots\frac{n-m+1-r}{n-m+1}=\frac{(n-m)!(n-r)!}{n!(n-r-m)!}$$ You pull the first ball, and it's not blue. How likely it is? $\frac{n-r}{n}$ So, you keep pulling ...


6

Other people have looked at the statistical qualities of the PCG generators and found them to be good, see for example https://lemire.me/blog/2017/08/22/testing-non-cryptographic-random-number-generators-my-results/. On that page you will also find references to other RNGs, that are all faster than MT. If being published and raw speed are important for you, ...


5

Let's start from theory, and worry about "How To" later. Let's suppose that $U \sim \mathrm{Uniform}(0, 10)$. Now, fix an integer, say $i$. The probability that $i-\epsilon/2 < U < i+\epsilon/2$ is obviously $\epsilon$, for any $0 < \epsilon < 1$. Now, mathematical equality requires $\epsilon \to 0$, and so the probability of observing any ...


5

Peter Flom already provided some links that should address your question but to state the answer directly: No, there is no table but a formula that make it possible to generate a series of apparently random numbers. To get an idea of what is going on, you might consider some elementary pseudo-random number generators like the middle-square method or the ...


5

This is a difficult and widely studied problem. One of the big reasons people are interested in it is that people like to use Amazon Mechanical Turk (AMT) for experiments, but many of the turkers on AMT just guess. The simplest strategy to avoid guessers is to manually establish the correct answer to some questions, and then weed out those people who answer ...


Only top voted, non community-wiki answers of a minimum length are eligible