Statistical Test for Randomness just wanted to ask if it's possible to check whether a given sample of data is drawn from a random distribution? If so, can I use some statistical test like the Anderson-Darling test or Chi-squared test to know this? Sorry if the question is easy but I just wanted to be certain about this before moving on with my lab assignment.
 A: NIST maintains the test suite for random number generators, see https://csrc.nist.gov/projects/random-bit-generation/documentation-and-software
That’s where I’d start. You may adapt what’s suitable for your case
A: RANDU vs. runif in R (using Mersenne Twister). One preliminary test in vetting a pseudorandom number generator might be to look at the distribution of points in the unit cube.
# RANDU (multiplicative congruential generator)
a = 65539; d = 2^31; s = 11
m = 20000; r = numeric(m); r[1] = s
for (i in 1:(m-1)) {r[i+1] = (a*r[i]) %% d}
u = (r-.5)/(d-1)
u1 = u[1:(m-2)]; u2 = u[2:(m-1)];  u3=u[3:m]
par(mfrow=c(1,2))
 plot(u1,u2, pch=20, xlim=c(0,.1), ylim=c(0,.1))
 plot(u1[u3<.01], u2[u3<.01], pch=20, xlim=0:1, ylim=0:1)
par(mfrow=c(1,1))

In the figure below, the left panel shows "random" points
in the square with vertices $(0,0), (0.1,0.1),$ which look OK.
By contrast, points near one face of the unit cube indicate
that points in the cube lie on only a few planes.

# 'runif' in R using Mersenne Twister 
set.seed(2021); m = 20000; u = runif(m)
u1 = u[1:(m-2)]; u2 = u[2:(m-1)];  u3=u[3:m]
par(mfrow=c(1,2))
 plot(u1,u2, pch=20, xlim=c(0,.1), ylim=c(0,.1))
 plot(u1[u3<.01], u2[u3<.01], pch=20, xlim=0:1, ylim=0:1)
par(mfrow=c(1,1))

Below, plotting regions are the same as above, and both panels seem to have points at random.

A: Chi square test will allow you to determine things such as, after a series of die rolls, is the die “fair” ie each face has equal probability of being landed on. Your question is unclear, but I would guess this is what you want.
