How to solve this possion probability question (Involving Hypothesis Testing) My main question was;
if $X$~$Poisson(5)$ and say we have that
 $P(X > K)=0.068$, then how do I solve for K? Given that $\lambda=\frac{1}{4}$ and X is the sum of 20 iid.
But I have a few different things that I am confused and wondering about in this problem.
To give more context,
It is from a hypothesis testing problem which started off saying suppose $X_{1},...X_{n}$ are poisson random variables with mean $\lambda$ and we want to test null $\lambda=\lambda_{0}$ and alternative $\lambda=\lambda_{1}$.
It asked to find at level alpha the optimal test ie that which rejects the null when $\bar Xn \gt$ Constant. for this constant I said that for a given $K$ the optimal test will reject the null if $$\bar Xn \gt \frac{-lnK+n(\lambda_{1}-\lambda_{0})}{nln(\lambda_{1}/\lambda_{o})}$$ and then it said, suppose $n=20$ the null is $1/4$ the alternate is $1/2$ , find that constant and type $1$ and $2$ probabilities
So I thought that this would mean $P(\bar Xn \gt C: \lambda=1/4)=0.068$ which
but that would be the same as $P(T \gt nc : \lambda=1/4)=0.068$ So If I can find that C and then divide by 20 to find my original constant and would it also be the type one probability.
The other part was the same except for the test which minimizes the sum of type one and two errors, for this one I found that it rejects the null when $$\bar Xn \gt \frac{ln(a/b)+n(\lambda_{1}-\lambda_{0})}{nln(\lambda_{1}/\lambda_{o})}$$ and so I think I would take same approach. The thing is I don't get how this will be any different from above? I am so extremely confused. I cannot understand the difference between the two problems. I am begging anyone to please help
I have been working on this for over two days, so many hours. I am just so confused. I have tried all my work, but I cant put it together. Please help
Thank you
 A: The CDF for the Poisson distribution is $$\mathbb{P}(X \leq K) = e^{-\lambda} \sum_{j = 0}^{K}\dfrac{\lambda^j}{j!}.$$
I use $\lambda$ to refer to the Poisson parameter for the distribution of $X$ overall (i.e. $\lambda=5$ for my purposes here).
We know that $\mathbb{P}(X>K) = 0.068$. 
Hence we can say that $\mathbb{P}(X \leq K) =1-0.068 = 0.932$.
Thus we need to solve $$\mathbb{P}(X \leq K)= e^{-5} \sum_{j = 0}^{K}\dfrac{5^j}{j!} = 0.932$$ for the value $K$.
We could get really fancy and work with error bounds on power series here, but I am going to give you a quick and dirty way to do this.
Start with $K = 4$ say.
$$\mathbb{P}(X \leq 4) = e^{-5}(1+5 + 25/2 + 125/6 + 625/24) = 0.4405.$$
This is too small. We want $0.932$. Maybe now try $K = 5$ or $K = 6$. 
$$\mathbb{P}(X \leq 5) = e^{-5}(1+5 + 25/2 + 125/6 + 625/24 + 5^5/120) = 0.616.$$
Right around $K=8$ you might find something magical....
This could be found by running the very simple command 
qpois(0.068, lambda = 5, lower.tail = FALSE) 
in R. However, that is going to return $9$, since we have some round off error. Instead try 
qpois(0.068095, lambda = 5, lower.tail = FALSE) 
