# How to decide the randomness of a dataset by checking the prime numbers inside it?

So it is weekend! I am reading currently a book where I found this sentence: "71 percent of men said they had a 'good sense of direction'. Only 47 percent of women reported same thing.", and I thought 'nonsense! two primes in a row, this stastistic is a fake!'. Ok it might be exaggerated, but then I started to think about the question I am asking now... How could I decide when a supposed random dataset is not so random by looking at the prime numbers inside?

I would do as follows, but I am not sure if it would be right or not, so I would like to read other solutions.

To simplify, let us imagine a dataset of 100 random different integer elements of any range.

$S=\{567,10,...,10001,205,8747\}$

First, I would reorder the dataset from the smaller to the greater.

$S=\{10,205,567...8747,10001\}$

a) Then if there is randomness, I would expect the random primes to be gradually more scattered to the right of the dataset, and less scattered at the beginning of the dataset in some extent (as it happens with the distribution of primes into the integers). If that does not happens, then I would think the dataset is not so random.

b) I would compare $(1)$ $\frac{S_{last}-S_{first}}{\pi(S_{last})-\pi(S_{first})}$ versus $(2)$ $\frac{Total-elements-of-S}{Total-primes-in-S}$.

If $(2)\gt(1)$ I would think that it is not so random.

Would this be right or not? I would like to know other options, thank you!

You need to have some notion of variance. A simplistic strategy to start with would be to use the Cramér model where each integer $n \ge 2$ is attached to a random indicator variable $X_n$ which is $1$ with probability $1/\ln n$. Then you can extract the expected value and variance of $\sum_{n \in S} X_n$ and compare the actual number of primes to this. More sophisticated would be to work out the actual tail probabilities for the random variable $\sum_{n \in S} X_n$ to determine a $p$ value.