How do you know something isn't random?

Suppose I made a random number generator that's supposed to return a number 1-10, but I made it always return 4, and didn't tell you.

How would you know with 100% certainty it wasn't random?

Even if you generated 4 so many times that the odds of such are less than atoms in the observable universe, would you ever be able to actually know?

• This does not seem to be a mathematical question; perhaps the statistics SE would be a better fit – Calvin Khor Apr 10 at 4:00
• Actually, I think the confusion is going to boil down to philosophy. This seem to be a special case of the problem of induction. – user10478 Apr 10 at 4:06
• According to xkcd, 4 has be vetted by the IEEE as the standard random number. – Sandejo Apr 10 at 4:25
• What do you mean by "random" (e.g. chaotic systems are deterministic but unpredictable due to sensitivity to initial conditions)? We can have no certain knowledge of causal relationships in the real world by purely empirical means (Hume), so there is no way of being 100% certain of causes through observation. So the answer is "no" we can't be 100% certain of anything (even "cogito ergo sum") without making some assumptions. – Dikran Marsupial Apr 12 at 10:33
• Only in mathematics you can (sometimes) "know with 100% certainty" if something is true. There is no such thing as "100% certainty" in the physical world. – Igor F. Apr 14 at 12:48

An obligatory Dilbert comic:

If you have a random number generator that at random generates "4" with probability $$p$$, the probability of observing it $$n$$ times in a row is $$p^n$$, assuming that the draws are independent. Notice that the more times you observe "4", the smaller the probability gets, but it will never go down to zero. There will always be a slight chance of observing one more "4" in a row. So you can never be 100% certain.

how would you know with 100% certainty it wasn't random?

You wouldn't. This gets into why there are many different probability interpretations.

All answers seem to focus on the nature of random while the question concerns truly the nature of knowledge. What is it to know something?

You seem to implicitly allude to an unattainable and impractical notion of knowledge, some God-like insight into matters. We're human, for us knowledge is not an absolute state of clarity and vision. We know that it's Friday today, that milk is white and the Winter is coming etc.

Unfortunately the subject is outside the field of statistics. Hence, my terse answer: if your RNG keeps returning 4, then you will know that it's not random after a few trials.

You and I know that the Sun will rise tomorrow. If someone doesn't then they should see a therapist to deal with anxiety, maybe take some pills etc. The point is that it's not the subject of statistics in this case.

Checking for the randomness can be viewed as "discover patterns".

In your random generator example, we can calculate the probability of certain events (for example consecutive 4 for 10 times) and conducting experiment to verify our assumption.

For example, we know certain thing is very less likely to happen and it is happening all the time (say hitting the jackpot all the time). Then we are suspecting the problem of the random generator.

Of course we cannot sure, but we can say, it is highly likely (say 99.9999999%) the data is not from random. And In real world we dot not need to have a black or white answer, we just simply do not trust the random generator and do not use it.