# Randomness measure of a sequence over a finite set [duplicate]

If $$S$$ is a finite set (such as outcomes of a dice). If I have a sequence $$x_0 ... x_n$$ of elements over $$S$$, how can I measure randomness quality of such a sequence as compared to measuring quality of random bits?

• I've tried to enhance the quality of your question, including the info below the answer of Paul. Please check if the question is still correct. – Maarten Bodewes Oct 13 '19 at 13:33
• There is no such thing as randomness of a sample. Randomness is a property of a process that could produce any of various outcomes and you don't know which. Taken literally, this question is unanswerable: you can talk about randomness of a process (involving, e.g., physics), or tests of a sample to distinguish distributions, but not randomness of a sample. See, e.g., crypto.stackexchange.com/a/71437 for what I suspect you might mean to be asking about, and crypto.stackexchange.com/a/58132 for further discussion of what statistical hypothesis tests mean. – Squeamish Ossifrage Oct 13 '19 at 13:46

The simplest approach is the bias away from uniformity of the sequence, $$\epsilon$$. $$P(x_n = \text{any member of S}) = \frac{1}{|S|} \pm \epsilon$$. So a regular die has 6 possible outcomes and thus a cardinality of 6. Therefore in the case of a perfectly fair die, $$P(x_n = \text{any member of S}) = \frac{1}{6} + 0.$$
The USA's NIST organisation aims for $$\epsilon = 2^{-64}$$ when characterising a sequence as 'fully' random. And this leads to issues of mensuration as it's very difficult to generate and managed the amount of data needed for an accurate determination with such small bias.