Hypothesis testing with Neyman–Pearson (finding cutoff quantile of Poisson dist) I am currently trying to solve a problem that should be very easy, yet I am stumped, and help would be GREATLY appreciated!!
The background of the question is this:
Q: The number of typing errors in a newspaper can be modeled by a Poisson distribution with some mean $μ$. Each of the $31$ students in a journalism course are allocated at random a past edition of the The Guard newspaper and asked to find the number of typing errors it contains. The total number of errors found by the students is $120$, i.e. $\sum_{i=1}^{n}y_i=120$.
It has been hypothesized by the instructor of the course that there are an average of $5$ typing errors in each edition of The Guard. The editor of the newspaper has objected, claiming that the mean is less than $5$ per edition. You want to test this with at $5\%$ significance level.
Here is where I begin my work
So I want to test: $H_0:\mu_o=5$ and $H_a:\mu_a<5$.
According to the Neyman Pearson lemma, we can create the most powerful test by looking at the likelihood ratio (LR). I simplified the LR and got the following which I believe is correct, hopefully!
$$LR= e^{-n\mu_a+n\mu_0}(\frac{\mu_a}{\mu_0})^{\sum_{i=1}^{n}y_i}$$
Now looking at the ratio, and the fact that $\mu_a<\mu_0$, we can see that effectively our test statistic is $\sum_{i=1}^{n}y_i$, and as it increases, we get less comfortable rejecting $H_0$, since it makes our LR smaller.
Now this is where I am stuck:
Now I know that to reject $H-0$, I need to find the cut off value where $\sum_{i=1}^{n}y_i \le k$ where $k$ is the cutoff value. 
So since $\sum_{i=1}^{n}y_i$ is our test statistic, we can say that we have $n=31$ independent Poisson distributions which leads our test statistic to have $n\mu_0$ Poisson distribution. I am unsure if what I just did is correct or not, but assuming it is, we next want to find $k$. Using $R$, we have our test statistic model $n\mu_0$ $=$ $31\cdot4=124$ which we can use in $R$.
qpois(0.05 ( = significance level) ,124) ( = our new parameter for the mean under H_0) = 106
which is incorrect. Hopefully this clears up the confusion! Thanks so much everyone!!
 A: Apart from a few oddnesses with notation, you seem to have almost got it sorted out.
This bit is wrong, though:

Now to find the value of k where we would reject H0 when the total number of observed errors is no greater than k, can we not just use R with the following code:

qpois(0.05 = the alpha level,5 = value of null)

You need to stick with the observed number of errors across the sample. With 31 people, you won't observe only a few errors. If you try to work with 'number of errors per person' (i.e. you divide the total number of errors by the number of people), it's no longer a Poisson distribution, but a scaled Poisson (it takes values that are multiples of $\frac{1}{31}$), and the ignoring the distinction will give you grief. Better to just work with the integer variable, "the total count of errors".
Under the null hypothesis, the distribution of $\sum_i y_i$ has a distribution you can easily work out.
You can then use the inverse cdf, or quantile function (qpois in R) to compute the critical value you need for your rejection rule, but take care about what it gives you. If it's not clear to you why you would subtract 1 as whuber suggested, you should use the cdf (ppois in R) to compute the actual significance level for the rejection rule you propose; that should make it obvious why. (Alternatively, draw a diagram of what's going on, and it should soon become clear.)
Here I've drawn the probability function for the total count of a similar but different problem (one with different numbers):

The aim is to find the value $C$ which will yield a type-I error rate that is no more than 0.05 (the sum of all the probabilities up to and including it, as suggested by the brace underneath the diagram). If you keep that straight, you should have little trouble working out what's going on
