Let $X$ be a Negative Binomial random variable, $X \sim \mbox{NB}(n, p)$, with $P(X=x) = {n+x-1 \choose x} p^n (1-p)^x, x = 0, 1, 2, \cdots$. Suppose I do this experiment where I toss a coin until I got 8 heads. I got the 8th head on the 10th trial. So, we have $n=8$ and $x=2$. Now, I want to test the hypothesis that $p=0.5$ against a two-sided alternative of $p \ne 0.5$. What would be the critical region for this test? How would I calculate a two-sided P-value?
P-value is defined as the probability, under the Null, of getting a result as extreme or more extreme than what was obtained in a particular experiment. Here, it is obvious that $S=\{0,1,2\}$ constitute the critical region of extreme values. Therefore, $P(X \in S) = 0.0547$. However, this is only a one-sided P-value. It is not obvious to me how to define the critical region for the other tail of the asymmetric distribution. For instance, $P(X > 15) = 0.0466 $. Would the two-sided P-value for my experiment be $p=P(S_2)$ where $S_2 = {\{0,1,2\}} \cup {\{16 , \cdots\}}$?