Comment continued with sample size computations from Minitab
statistical software. Testing $H_0: \mu = 1$ vs. specific alternative
$H_a: \mu = 0.5,$ with data from a population with $\sigma^2 = 1.$
Power and Sample Size
1-Sample t Test
Testing mean = null (versus < null)
Calculating power for mean = null + difference
α = 0.05 Assumed standard deviation = 1
Sample Target
Difference Size Power Actual Power
-0.5 27 0.80 0.811832
-0.5 36 0.90 0.902575
-0.5 45 0.95 0.951240
So, for example, if you want the probability of rejection to be $0.9$ (power 90%) in these circumstances, you would need a sample of size $n = 36.$
Addendum per Comment: Suppose you have $n = 40$ observations from a population distributed as $\mathsf{Norm}(\mu = 10.2, \sigma = 1),$ as follows:
set.seed(121)
x = rnorm(40, 10.2, 1)
summary(x); sd(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
8.731 9.655 10.318 10.268 10.861 11.815
[1] 0.8135376
The stripchart below shows the $n=40$ observations. The dotted
red line is at $\mu_0 = 10$ and the solid black line is at
$\bar X = 10.268.$
R code for figure:
stripchart(x, pch="|")
abline(v = 10, col="red", lwd=2, lty="dotted")
abline(v = mean(x), lwd=2)
First, consider $H_0: \mu \le 10,$ vs $H_a: \mu > 10.$
Because $\bar X = 10.268,$ we may have evidence that $\bar X$
is significantly greater than $10,$ rejecting $H_0$ in favor
of $H_a.$ In R, a one-sample t test gives the following results:
t.test(x, mu = 10, alte = "greater")
One Sample t-test
data: x
t = 2.0809, df = 39, p-value = 0.02203
alternative hypothesis: true mean is greater than 10
95 percent confidence interval:
10.05094 Inf
sample estimates:
mean of x
10.26767
It turns out that $\bar X = 10.318$ is significantly larger
than $10$ at the 5% level of significance because the
P-value $= 0.02203 < 0.05 = 5\%.$
By contrast, for the same data, suppose we want to test
$H_0: \mu \ge 10,$ against $H_a: \mu < 10.$ Because $\bar X = 10.268,$ we have no evidence that $H_a < 10.$ If this is the
hypothesis we had planned to test before collecting data, we
might go ahead with the formality of a t test, but we already
know we cannot reject $H_0$ in favor of $H_a.$
t.test(x, mu = 10, alt="less")
One Sample t-test
data: x
t = 2.0809, df = 39, p-value = 0.978
alternative hypothesis: true mean is less than 10
95 percent confidence interval:
-Inf 10.48439
sample estimates:
mean of x
10.26767
The P-value is greater than 5%, so we can't reject $H_0$ at the 5% level. In particular, as you suspected, the P-value of this test looking in the
"wrong" tail is $1$ minus the P-value for the previous t test (looking in the "correct" tail): $0.022 + 0.978 = 1.$
Note: A two-sided test of $H_0: \mu=10$ against $H_a: \mu \ne 10$
has P=value $= 0.044 = 2(0.022),$ where $0.022$ is the P-value of
the first one-sided t test (the one looking in the "correct" tail).
t.test(x, mu=10)$p.val
[1] 0.04406042