# How to do an equidistribution test? [duplicate]

Suppose I have a sample of $$N$$ numbers $$a_1,\dots,a_N$$ from $$1,\dots,k$$. How can I test whether they are equidistributed?

I'm not interested in a full randomness test as the order does not matter to me, so Testing random variate generation algorithms is not relevant to me, neither are its dupes. For me, a sequence $$1,2,3,\dots k,1,2,3,\dots,k,\dotsc$$ is perfectly fine.

I would like to have a test just from the frequencies/counts, i.e., my input data really is the vector of number of occurrences $$c_j=\#\{n\leq N:a_n=j\}$$ for $$j=1,\dots,k$$. I was unable to google the way how to proceed.

• Chi square test. Feb 5 '19 at 12:34
• @user2974951 Thanks a lot, after some googling based on your help I found that I have to calculate $\chi^2=Nk\sum_{j=1}^k (c_j/N-1/k)^2$ and that I have $k-1$ degrees of freedom. But from this I'm not sure how to proceed.
– yo'
Feb 5 '19 at 12:45