Question:
Let $U_1,U_2,\ldots$ be a sequence of independent uniform $U(0,1)$ random variables, and let $$N = \min\{n\geq 2: U_n > U_{n-1}\}$$ In other words, $N$ is the index of the first uniform random variable that is larger than the one that comes immediately before. For example, if the numbers are $0.2$, $0.1$, $0.3$ then $N = 3$. Then $$\mathbb{P}\{N > n\} = \frac{1}{n!}$$
a.) What is the density function of $N$, i.e., what is $\mathbb{P}\{N = n\}$?
b.) Design a statistical test for randomness. Explain how to go from a specific random number generator, to the final recommendation on whether the generator is accepted or not.
I normally don't post a question without somewhat of an attempted solution, but I am pretty lost here. For part b.) I was thinking of using chi-squared to test for randomness or plotting the pairs of triplets in the sequence of $u_1,\ldots,u_n$ that are generated from $U(0,1)$ but I am not sure if this is sufficient or not. Any suggestions are greatly appreciated.