A critical region is the set of sample outcomes on which a test rejects its null hypothesis. Its power function is ; its size of a statistical test is . Randomized tests replace the indicator of by a rejection probability .
The Neyman-Pearson lemma states that for two simple hypotheses with densities , the test that is one where , zero where , and randomized on equality to have null rejection probability , maximizes power among tests of size at most . Here . To prove it, let be any competing test. Pointwise, , since both factors have the same sign off the equality set. Integrating gives
This proves the lemma, including equality-set randomization and points where .
Take the exponential parameter to be its rate: for . For , the joint likelihood ratio is , decreasing in . Hence for the most powerful test is
There is no boundary randomization because has a continuous gamma distribution. Its density follows by repeated convolution: . Integrating by parts gives the exponential-rate likelihood-ratio test power
The threshold is the unique positive solution of this formula at with value . Differentiating the finite sum yields
Thus the power function is strictly increasing, and its supremum over is . Therefore the same test has size for the composite null . Since the threshold does not depend on the particular larger rate, it is also uniformly most powerful against all . The endpoint sizes zero and one have their trivial constant tests.