Exercise :
Let $p$ be the probability of having Heads during a coin toss. For the hypothesis testing $H_0 : p = 0.5$ against the alternative $H_1 : p > 0.5$ we count the number of independent trials $X$ needed until having Heads for the first time. If the critical region of the test is $K = \{ X > 3 \}$, then :
i) Calculate the importance level $a$ of the test given.
ii) Calculate the probability of the type II error for the test above, if $p=0.7$.
Attempt :
Since we are interested for an experiment regarding trials until a first success, we have a Geometric Distribution. Thus :
$$\mathbb{P}(X=k) = (1-p)^{k-1}p$$
For part (i), we have :
$$a = \mathbb{P}(\text{Reject} \; H_0|H_0) = \mathbb{P}(X>3|p=0.5)=1-\mathbb{P}(X\leq 3 | p=0.5)$$ $$=$$ $$1-\mathbb{P}(X=3|p=0.5)=1-\sum_{i=1}^3 (1-0.5)^{i-1}\cdot 0.5$$
For part (ii), we have :
$$\text{Type II Error}=\mathbb{P}(\text{Accept} \; H_0|H_1) = \mathbb{P}(X\leq3|p=0.7)$$ $$=$$ $$\sum_{i=1}^3(1-0.7)^{i-1}\cdot 0.7$$
Question : Is my reasoning and my solution correct ? I am worried a bit about the probability calculating part.
"a" is significance not importance although in this case they mean the same thing :) Ok, the actual probability of rejecting the null given it's a fair coin is getting 4 tails which is $0.5^4 = .0625$.
Are you sure you have stated the question correctly? This test is set up to make a type II error an almost certain outcome. For a type II error, this would result in getting a head in 4 flips $= 0.7 + 0.7\cdot 0.3 + 0.7\cdot 0.3^2 + 0.7\cdot 0.3^3 = .9919$.
In most schools, accepting the null isn't an option. It's failure to reject the null.