# Show a composite test is the most powerful after deriving a similar most powerful simple test

Let $$X$$ be a real-valued random variable with density $$f(x) = (2\theta x + 1 - \theta) \mathbb{1}(x \in [0,1])$$ where $$1$$ here is the indicator function and $$-1 < \theta < 1$$. I am trying to derive the most powerful size $$\alpha$$ hypothesis test for the hypotheses $$\begin{cases} H_0 : \theta = 0 \\ H_1 : \theta = 1 \end{cases}$$.

I have resorted to trying to derive the likelihood ratio test, which by the Neyman Pearson lemma is the most powerful. The likelihood ratio is $$\Lambda = f_1/f_0 = 2x1(x\in [0,1])$$. Therefore I'd expect the hypothesis test to be reject $$H_0$$ if $$2X > k$$ for some $$k$$. We can determine $$k$$ using the size $$\alpha$$. I get $$\alpha = \mathbb{P}_{H_0}(2X > k)\Rightarrow k = \sqrt{1 - \alpha}$$.

Now I want to derive a uniformly most powerful test for the hypotheses $$\begin{cases} H_0 : \theta = 0 \\ H_1 : \theta > 0\end{cases}$$.

The Neyman-Person lemma (as proved in our statistics class) does not apply for the case of composite hypotheses. So I think we need to adapt our solution to the simple hypothesis case to get a uniformly most powerful test for this new case. But I'm unsure precisely of the argument to use.

I've been stuck on a couple of other problems of this type ("given a most powerful test with simple hypotheses, show that if we alter the hypotheses to become composite then the composite test is actually uniformly most powerful as well") and would therefore appreciate some help through this example.

Your MPT is fine, with one small correction: under $$H_0$$, we have $$X \sim \mathrm{Unif}(0,1)$$, so $$\alpha=\mathbb{P}_{H_0}(2X > k)=1-k/2$$, which implies that $$k=2(1-\alpha)$$.
To find a UMPT, start by picking some (arbitrary) value $$\theta_1>0$$ and construct the MPT for $$H_0:\theta=0$$ vs. $$H_1':\theta=\theta_1$$. If this MPT is the same for any value of $$\theta_1$$, then it is the UMPT when the alternative is the composite hypothesis $$H_1:\theta>0$$.