The probability of type-II error for this test is_______? Suppose X is a random variable on {0, 1, 2, . . .} with unknown p.m.f. p(x). To test the hypothesis $H_{0}$ : X ∼ $Poisson(1/2)$ against $H_{1}$ : p(x) = $2^{−(x+1)}$ for all x ∈ {0, 1, 2, . . .}, we reject $H_{0}$ if x > 2. The probability of type-II error for this test is
(A) $1/4$
(B) $1−(13/8)e^{−1/2}$
(C) $1 −(3/2)e^{−1/2}$
(D) $7/8$
When I tried this question the  answer I got was $(3/2)e^{-1/2}$
I checked and rechecked the question and Reread the definition of Type-II error but to no avail
Can you tell me where I went wrong?

 A: What you are interested in is the probability of $p(x)=2^{-(x+1)} \leq 2$.
> sum(2^-(0:2+1))
[1] 0.875

which is answer (D).
A: Your rejection region is $\{X < 2\},$ so the significance level is
$\alpha = 1- P(X \le 2),$ where $X \sim \mathsf{Pois}(1/2).$ As
computed in R, $\alpha \approx 0.0144.$
1 - ppois(2, 1/2)
[1] 0.01438768

Let's begin by looking at a a graph of the probability distributions according to $H_0$ (blue)
and $H_a$ (brown).
x = 0:15
pdf.0 = dpois(x, 1.2)
pdf.a = 2^(-(x+1))
hdr = "Null (blue) and Alternative Dist'ns"
plot(x-.1, pdf.0, type = "h", ylim=c(0,.5), col="blue", 
     lwd=2, ylab="PDF", xlab="x", main=hdr) 
 lines(x+.1, pdf.a, type="h", col="brown", lwd=2)
 abline(v = 2.5, col="red", lty="dotted")


The probability of Type II for this test will not be small because the distributions
under $H_0$ and $H_a$ are so nearly alike. (This may be what put you on
a wrong path in your attempt to answer. In practice, useful tests tend to
be ones for which Type I and Type II errors are both relatively small.)
The probability of Type I Error (significance level) $\alpha$ is the sum of the heights of the blue bars in
the rejection region (to the right of the vertical dotted line).
The probability of Type II Error is the probability of failing to reject the null hypothesis when it is false.
So the probability of Type II error is the sum of the heights of the brown bars to the left of the vertical dotted line: $1/2 + 1/4 + 1/8 = 7/8.$ Answer (D).
