Compute the probability of committing a type I and II error.

I hope that someone could help me with the following question of my textbook:

One generates a number x from a uniform distribution on the interval [0,θ]. One
decides to test H0 : θ = 2 against H1 : θ = 2 by rejecting H0 if x ≤0.1 or x ≥ 1.9.

a. Compute the probability of committing a type I error.

b. Compute the probability of committing a type II error if the true value of θ is 2.5


So my understanding of this question is that it would not reject if x is 1.9-2.0 or 0.0-0.1.

The problem with this question is that I don't how to start. In my previous questions I had more information to solve this kind of questions. I think I understand what error type I and II mean. Type I means falsely rejected and type II falsely accepted.

According to the book, the answers are a:0.1 and b:0.72

• From context, it seems clear that $H_1: \theta \ne 2.$ – BruceET Jun 24 '15 at 0:06

For a type I error, you calculate the probability of a rejection under the assumption that the null hypothesis is true. So you find the density of $X$, call it $f_X$, under the assumption that $\theta=2$. Then the probability of a rejection is

$$\int_0^{0.1} f_X(x) dx + \int_{1.9}^2 f_X(x) dx.$$

For a type II error, you calculate the probability of an acceptance under the assumption that the null hypothesis is false. In real problems you generally can't compute this, because usually knowing that the null hypothesis is false doesn't specify the distribution uniquely. But in your case they tell you what the actual value of $\theta$ is for this part of the problem, which lets you compute it. Specifically, the probability of an acceptance is

$$\int_{0.1}^{1.9} f_X(x) dx$$

where $f_X$ is the density of $X$ under the assumption $\theta=2.5$.

• Thank you! I got the answer. – Danique Jun 23 '15 at 17:34
• ian, sorry, I think I did something wrong, because when I filled in your formula the answer of a is correct, but b is not correct. Sorry for being not clear. I hope you be so nice to tell me what I did wrong for b. $$\frac{1.9^2}{2}-\frac{0.1^2}{2} = \frac{9}{5}$$ – Danique Jun 23 '15 at 17:44
• @Danique In b you need to be sure to use the density of $X$ with $\theta=2.5$, which is $\frac{2}{5}$ on $[0,2.5]$ and zero elsewhere. So you should have $\int_{0.1}^{1.9} \frac{2}{5} dx = \frac{3.6}{5}=0.72$. – Ian Jun 23 '15 at 17:46
• Thanks! I used 2. I feel really stupid, sorry. Now both of the questions are correct. – Danique Jun 23 '15 at 17:48
• @Danique No worries, I should probably have used different notation for the two different densities in my answer. – Ian Jun 23 '15 at 17:49