Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 14 of 22

Optimize a test against a specified alternative

Prove the likelihood-ratio ordering and handle randomization.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

Try

A single binary observation will distinguish p₀=1/3 from p₁=2/3. Rejecting the null after a success has null rejection probability 1/3 and power 2/3. Rejecting after a failure has null rejection probability 2/3 and power 1/3. The success is stronger evidence for the specified alternative because its likelihood ratio is two, whereas a failure’s ratio is one half. We want to allocate a fixed null-error budget to observations with the largest alternative probability per unit of null probability.

Predict

Suppose the allowed size is only 1/6. No deterministic rule using this single observation achieves exactly that positive size. Predict how randomization can fill the budget: reject with probability 1/2 when a success occurs, and never after a failure. The size is (1/3)(1/2)=1/6, while the power is (2/3)(1/2)=1/3. Randomization here is an explicitly specified additional coin flip, not a vague uncertainty about what the test will decide.

Experiment

Create the likelihood-ratio ordering and compare two tests with the same size. Test A randomizes only on success; test B randomizes only on failure.

OutcomeNull probabilityAlternative probabilityLikelihood ratio
02/31/31/2
11/32/32

To give test B size 1/6, reject with probability 1/4 after a failure. Its power is 1/12, much smaller than test A’s 1/3. Explain the comparison using probability budgets before writing a formal proof. This finite table makes the optimization mechanism inspectable without relying on a continuous curve.

Understand

A randomized test φ(x) lies between zero and one and records rejection probability conditional on the data. For simple null density f₀ and simple alternative f₁, its size is E₀φ and power is E₁φ. A likelihood-ratio rule φ⋆ rejects when f₁>kf₀, accepts when f₁<kf₀, and may randomize at equality to achieve size α. The threshold k is nonnegative. Null-zero but alternative-positive points should be rejected at no size cost.

For any competing test φ of size at most α, the product (φ⋆−φ)(f₁−kf₀) is nonnegative pointwise. Integrating yields E₁φ⋆−E₁φ≥k(E₀φ⋆−E₀φ)≥0. This proves the Neyman–Pearson lemma when the stated threshold rule attains the allowed size. It is a proof about the two specified probability laws. It does not require asymptotic normality or a chi-square approximation. Equality cases can allow more than one most-powerful rule.

Apply

For n Bernoulli observations and fixed 0<p₀<p₁<1, divide the alternative likelihood by the null likelihood. The ratio is a positive constant times [p₁(1−p₀)/(p₀(1−p₁))]ˢ, where s is the success total. The bracket exceeds one, so the optimal ordering is by large s. Determine the threshold using the null distribution, including any boundary randomization. Estimating the threshold from the alternative distribution would spend the wrong error budget.

Reverse the alternative to p₁<p₀ and the ordering reverses. This is why “most powerful” must name its alternative. A test optimal against a large increase is not automatically optimal against a decrease or a composite set containing both. Generalized likelihood-ratio tests address a broader construction, but they do not inherit this simple-versus-simple optimality proof automatically.

Continue

For each test, report its null family, alternative, rejection function, size and power target. A p-value alone does not identify the optimization problem. Continue to Monotone likelihood ratios to find situations where the same ordering works for every member of a one-sided alternative. That extension requires control over the whole composite null, not merely one conveniently chosen parameter value.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

For one Bernoulli observation, reject iff X=1. Under p₀=1/4, what is the size?

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

Under p₀=1/4, reject with probabilityγ only when X=1. What γ gives size 1/8?

Integers, fractions and finite decimals are accepted. Expressions such as sqrt(2) are not parsed by this checker.

Prove a likelihood-ratio test φ* with size α is most powerful for simple f₀ versus f₁.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For n iid Bernoulli observations and fixed 0<p₀<p₁<1, show the most-powerful ordering is by large success total s.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Why does a most powerful test against one simple alternative not automatically maximize power against every alternative?

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

How should points with f₀=0 and f₁>0 be treated in a simple-versus-simple test?

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.