Hello(adsbygoogle = window.adsbygoogle || []).push({});

I have used a random number generator to create a list of uniformly random numbers, between 0 and 1.

The usual check that I do is sorting the list, and histograming the difference between the following and the previous one. The shape of the histogram should follow an negative exponential, and the slope will be the size of the list. If the size of the list is around 1e5, no strange effect is observed. If the size of the list is around 1e8, empty bins appear, following a certain repetitive pattern (empty bin - filled bin - empty bin - filled bin - empty bin - filled bin - 3 empty bins - filled bin ... )

I'm not sure about this test, because if the size of the list is huge, the exponential slope will be also huge, and I don't know how to face precision issues. For a list of 1e8 numbers, 1% are repeated (a std::map is used for storing the numbers, so sorting and controlling repetitions is easy).

Question: how to check (in a better way) if a list of numbers is uniformly random?

Thank you for your time.

Regards.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# C/++/# How to check if a list of numbers is random?

Tags:

Have something to add?

Draft saved
Draft deleted

Loading...

**Physics Forums | Science Articles, Homework Help, Discussion**