Hersi Maths WhatsApp me

Understand · explore · practise

Complete two-tailed hypothesis tests

Complete a two-sided binomial test with explicit equal-tail boundaries, inclusive probabilities and a careful contextual conclusion.

Before you startTwo-tailed critical regions and one-tailed tests.

01 / Either direction can challenge the claim

Choose the two-sided alternative before seeing the count.

H₀: p=p₀; H₁: p≠p₀.

Here, use an equal-tail at-most test: the lower and upper tail budgets are each α/2.

Define the event whose probability is p. A change can be either an increase or a decrease. The calculation still uses p₀, not the sample proportion.

Choose a sample, keep the rule fixedExplore

A device should select either output equally often. Test a change with 20 independent trials at nominal 5%, using equal tails at most 2.5% each.

02 / Write the full null model

An equal-output claim concerns a population probability.

A device is designed to select output A with probability 0.5. An engineer suspects the probability has changed. In 20 independent trials under comparable conditions, A appears 15 times. Test at nominal 5% using the equal-tail at-most rule.Worked example

Let p be the probability of output A

H₀: p=0.5; H₁: p≠0.5.

Let X count output A in 20 trials

Under H₀, X~B(20,0.5), assuming independent trials and a common probability.

Observed count x=15

The upper end is relevant to this observation; each end has budget 0.025.

01 · Null versus observation

Why is B(20,0.75) the wrong null model here?

Hint

Where does 0.75 come from?

Worked solution

15/20=0.75 is the observed proportion. H₀ specifies 0.5 for the probability used in the test.

02 · Direction

Why is p>0.5 not the given alternative?

Hint

Read the original suspicion.

Worked solution

The engineer suspected a change in either direction. Seeing a high count does not authorise rewriting that preselected two-sided alternative.

03 / Use half the level for an observed tail

Include the observed count.

Watch: both ends share the rejection rule

Pause, replay or seek freely. The notes explain the same idea and stay in view.

Evaluate the observed upper tail.Worked example

P(X≥15) = 1 − P(X≤14) ≈ 0.02069473

This includes 15,16,…,20.

0.02069473 ≤ 0.025

The observed upper tail meets its half-level budget.

Reject H₀

There is sufficient evidence at nominal 5%, under this rule and model, that the probability of output A differs from 0.5.

03 · Off by one

Why not use 1−P(X≤15)?

Hint

Identify the first included count.

Worked solution

That gives P(X≥16) and wrongly omits the observed 15.

04 · Nearby observation

For 14 outputs A, the upper tail is 0.05765915. State the decision.

Hint

Compare with 0.025.

Worked solution

Do not reject H₀. There is insufficient evidence of a change at nominal 5% under the stated test.

04 / Both boundaries belong to one test

Construct the region independently of the observed sample.

By symmetry, P(X≤5)=P(X≥15)≈0.02069473. The next counts fail: P(X≤6)=P(X≥14)≈0.05765915. Therefore the full critical region is X≤5 or X≥15. Counts 6 through 14 do not reject.

05 · Lower observation

What conclusion follows if output A appears five times?

Hint

Check membership of the other tail.

Worked solution

Five lies in the critical region, so reject H₀. There is sufficient evidence of a change in the output probability under the stated test.

06 · Boundary check

Why is six excluded?

Hint

Use its inclusive lower tail.

Worked solution

P(X≤6)≈0.05765915 exceeds 0.025, so it does not meet the per-tail condition.

05 / Report the achieved level when asked

Discrete tails rarely use the whole budget.

The actual significance is P(X≤5)+P(X≥15)≈0.04138947, or 4.138947%. It is at most the nominal 5%. This is the probability of rejecting under H₀, not the probability that H₀ is false.

07 · Add the regions

Why add, rather than multiply, the two tails?

Hint

Can one count lie in both?

Worked solution

They are disjoint alternatives in a union. Add their probabilities to find the rejection probability.

08 · Nonrejection under the null

Find the probability of not rejecting if H₀ is true.

Hint

Complement the actual level.

Worked solution

Approximately 1−0.04138947=0.95861053. This is not the probability that H₀ is true after observing nonrejection.

06 / Specify what your two-sided calculation means

Different exact two-sided conventions need not agree for asymmetric distributions.

For this symmetric example, doubling the observed one-sided tail gives 0.04138947, which can be compared with 0.05 and gives the same decision. These lessons define the equal-tail construction explicitly. Do not assume every software package uses that same definition of an exact two-sided p-value.

09 · Wrong full-level comparison

Why not compare an observed tail with 0.05 for this equal-tail test?

Hint

There are two preselected directions.

Worked solution

The equal-tail construction gives each end 0.025. Giving each tail 0.05 can allow up to 0.10 overall.

10 · Asymmetric model

For B(20,0.2), may you reflect the lower cutoff about 10 to get the upper cutoff?

Hint

Check symmetry.

Worked solution

No. A binomial distribution is symmetric at p=0.5. Compute both tails separately for p=0.2.

07 / Make the conclusion match the evidence

Avoid proof, causal claims and retrospective direction changes.

11 · Equality after nonrejection

Rewrite “14 does not reject, therefore the device is perfectly fair”.

Hint

State what the test failed to establish.

Worked solution

There is insufficient evidence at nominal 5%, under the stated rule and assumptions, that the output probability differs from 0.5. Fairness has not been proved.

12 · Direction after rejection

Can the result with 15 outputs A prove p=0.75?

Hint

Distinguish an estimate from a hypothesis-test conclusion.

Worked solution

No. The sample proportion estimates p, but rejection supports a difference from 0.5 rather than proving a particular value.

13 · Serial dependence

The device repeats its preceding output unusually often. Which assumption needs scrutiny?

Hint

Does one result affect the next?

Worked solution

Independence. A binomial test may be inappropriate if successive trials are dependent.

14 · Full argument

List the components of a complete two-sided test.

Hint

Follow the reasoning from parameter to context.

Worked solution

Define p and X; state H₀ and H₁; justify the null binomial model; state nominal level and tail convention; calculate inclusive tails or a justified critical region; compare and conclude in context.

08 / Two possible extremes, one planned rule

Keep the model and hypotheses fixed.

Use the null probability, allocate half the level to each tail, include boundary counts and state the full rejection region. Calculate the actual total if requested. Rejection is evidence against the null within the model; nonrejection is not proof of equality.

Section 1 of 8 · Either direction can challenge the claim