0
$\begingroup$

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.

1 Answers 1

1

a) $\mathbb{P}\{N = n\} = \mathbb{P}\{N > n-1\}-\mathbb{P}\{N > n\}$.

For (b): It seems that you should design some test based on $N$. Say, Region of rejection of Null-hypothesis can be smth like $\{N>c\}$.

Say, for given $\alpha>0$ define $n$ such that $\dfrac{1}{n!}\leq \alpha<\dfrac{1}{(n-1)!}$. Then get samples from random numbers generator and find the index $N$ of the first random variable that is larger than the one that comes immediately before. If $N\leq n$, accept generator. Otherwise reject. Type-I error of this test is $P(N>n|H_0)=\dfrac{1}{n!}\leq\alpha$.

You can try to design some other tests based on this r.v. $N$.

  • 0
    Thank you, I was more so confused with b.) could you provide a more detailed answer? I can reward you with a 300 bounty once I can start a bounty2017-02-23
  • 0
    @Wolfy Try to make your own efforts. The question sounds like a problem from the homework that needs your solution trials. In particular, can you find the $\alpha$-level for the test with rejection region $\{N>c\}$?2017-02-23
  • 0
    It is not for homework, they are practice questions for preparing for the exam and I just don't really know where to begin with b.) if I had a solution that I could refer to then I would be able to solve questions like this2017-02-23
  • 0
    Try firstly to design test with Rejection region as above.2017-02-23
  • 0
    umm, you mean like region where $N > c$ such that $c$ is something that contradicts the way $N$ is defined, if that makes any sense2017-02-23
  • 0
    Here $c$ stands for natural number which should be choosen in accordance with the $\alpha$-level (significance level of a test, probability of Type-1 error) you want to have.2017-02-23
  • 0
    I see, could you provide an additional hint so I can try to re-edit my answer with an attempted solution for part b2017-02-23
  • 0
    I would really appreciate if you help me with part b.), you took the time to answer my question already, I just need a little more help2017-02-23