Consider testing whether there is a bias in the probabilities of head and tail in a coin toss. Suppose that 5 independent trials of the coin toss resulted in 1 head and 4 tails. Compute the p-value of this observation (two sided test) given that the null hypothesis that there is no bias.
p value = probability obtaining result at least as extreme as actually observed assume $H_0$ is true.
$H_0$: coin not bias $p=0.5$
$H_1$:coin bias $p>0.5$
$$P(2,3,4,5\mid H_0=true)= P(X=2) + P(x=3)+P(x=4)+P(x=5) = 0.8125$$
Is the two sided mean p value is $0.8125\times2 = 1.625$? Am i correct?
If i'm correct i want to know what is the value of p in left side of the distribution, is it probability that tails are 4 times?
Notice in the definition of p-value, that it is says $\underline{\text{at least}}$ as extreme, so the observed value $X=1$ is included, both in the left and right p-value.
The right sided p-value is therefore $$p_{right} = P(X\geq 1) = P(X=1)+P(X=2)+P(X=3)+P(X=4)+P(X=5)$$ and the left sided is $$p_{left}=P(X\leq 1) = P(X=0) + P(X=1)$$ the two-sided p-value is $p = 2\cdot\min(p_{left},p_{right})$. In this case $p=2p_{left}$.
Also your statement of the alternative hypothesis should be $H_1: p\neq 0.5$ for a two-sided alternative.