# Solve a strange inequality

GabrielN00

## Homework Statement

Solving an exercise I found myself with this problem: the solution ##c## needs to verify both ##\sum_{k=1}^c n\lambda^k\frac{e^{n\lambda}}{k!}\leq \alpha## and ##1-\sum_{k=1}^{c+1} n\lambda^k\frac{e^{n\lambda}}{k!}\geq \alpha##.

Can an equation like this be solved for c?

## The Attempt at a Solution

An inversion of the inequality didn't work because it vanishes ##\alpha##, I don't think there is an explicit form for the solution, but I've failed in finding an argument to explain why.

Last edited by a moderator:

mfb
Mentor
Assuming all parameters are positive, both sums increase with increasing c, so the inequalities will be valid from c=0 (or c=1) up to some maximal c. If you are just interested in finding any solution, test the smallest c allowed.

Apart from constant prefactors, your sum is ##\displaystyle \sum_{k=1}^{c} \frac{\lambda^k}{k}##, I'm not aware of closed forms for that (although some special values of ##\lambda## might have them). Is it really ##k## in the denominator, not ##k!## ?

GabrielN00
Assuming all parameters are positive, both sums increase with increasing c, so the inequalities will be valid from c=0 (or c=1) up to some maximal c. If you are just interested in finding any solution, test the smallest c allowed.

Apart from constant prefactors, your sum is ##\displaystyle \sum_{k=1}^{c} \frac{\lambda^k}{k}##, I'm not aware of closed forms for that (although some special values of ##\lambda## might have them). Is it really ##k## in the denominator, not ##k!## ?
It is k!. I mistyped that.

There was another error, it is
##1-\sum_{k=1}^{c} n^k\lambda^k\frac{e^{n\lambda}}{k!}\geq \alpha##, NOT ##1-\sum_{k=1}^{c+1} n\lambda^k\frac{e^{n\lambda}}{k!}\geq \alpha##.

and

##\sum_{k=1}^{c} n^k\lambda^k\frac{e^{n\lambda}}{k!}\leq \alpha## instead of ##\sum_{k=1}^{c} n\lambda^k\frac{e^{n\lambda}}{k!}\leq \alpha##

Last edited by a moderator:
mfb
Mentor
Okay, so we have the standard Poisson distribution with ##n\lambda## expectation value. I'm not aware of closed formulas for the cumulative distribution function.

As the two sums are now the same, the problem got easier: Check which inequality you have to consider for ##\alpha## smaller or larger than 1/2,

GabrielN00
Okay, so we have the standard Poisson distribution with ##n\lambda## expectation value. I'm not aware of closed formulas for the cumulative distribution function.

As the two sums are now the same, the problem got easier: Check which inequality you have to consider for ##\alpha## smaller or larger than 1/2,

I don't understand the last part. I don't have the values ##n,\lambda,c## which I think I need to calculate the sum, and I need to calculate the sum in order too know which inequality should I use if ##\alpha## smaller or larger than 1/2.

fresh_42
Mentor
Without all the constants in the sum, it is just ##\sum_{k=1}^c \frac{\lambda^k}{k!} \leq \ldots ## which is just the exponential function ##- 1##. There are probably more approximations ##r## for ##e^x = \sum_{k=0}^N \frac{x^k}{k!} + r(x;N) \text{ with } r(x;N) \leq \ldots ## than of any other function.

Ray Vickson
Homework Helper
Dearly Missed
It is k!. I mistyped that.

There was another error, it is
##1-\sum_{k=1}^{c} n^k\lambda^k\frac{e^{n\lambda}}{k!}\geq \alpha##, NOT ##1-\sum_{k=1}^{c+1} n\lambda^k\frac{e^{n\lambda}}{k!}\geq \alpha##.

and

##\sum_{k=1}^{c} n^k\lambda^k\frac{e^{n\lambda}}{k!}\leq \alpha## instead of ##\sum_{k=1}^{c} n\lambda^k\frac{e^{n\lambda}}{k!}\leq \alpha##

Do you really mean to have ##e^{n \lambda}## rather than ##e^{- n \lambda}##? I ask, because if ##p_k(\mu) = \mu^k e^{-\mu}/k!## is the Poisson probability mass function for mean ##\mu## your sum has the form ##e^{2 n \lambda} \sum_{k=1}^c p_k(n \lambda)##. If you had ##e^{-n \lambda}## instead, your sum would be ##\sum_{k=1}^c p_k(n \lambda)##, which is almost the cumulative distribution function; it merely lacks the ##k=0## term.

GabrielN00 and fresh_42
GabrielN00
Do you really mean to have ##e^{n \lambda}## rather than ##e^{- n \lambda}##? I ask, because if ##p_k(\mu) = \mu^k e^{-\mu}/k!## is the Poisson probability mass function for mean ##\mu## your sum has the form ##e^{2 n \lambda} \sum_{k=1}^c p_k(n \lambda)##. If you had ##e^{-n \lambda}## instead, your sum would be ##\sum_{k=1}^c p_k(n \lambda)##, which is almost the cumulative distribution function; it merely lacks the ##k=0## term.

You're right. It is ##e^{-n\lambda}##.

It's supposed to be the cumulative function. This is part of a larger problem, I didn't post the whole thing because I had some parts worked out. I don't think I can edit the initial post anymore, but I will post the original problem to give some context (which I probably should have done before).

The idea of the problem consists in having ##X_1,\dots, X_n## simple random sample of ##X\sim \operatorname{Poisson}(\lambda)## and the goal is the optimal critical region ##\alpha## for ##H_0:\lambda =\lambda_0## against ##H_1:\lambda=\lambda_1##.

I applied Neyman-Pearson theorem and followed ## \frac{\lambda_0}{\lambda_1} = \frac{(\lambda_0^{\sum x_i} e^{-\lambda_0}) / (\prod_{i=1}^n x_i!)}{(\lambda_1^{\sum x_i}e^{-\lambda_1})/(\prod_{i=1}^n x_i!)} = \frac{\lambda_0^{\sum x_i}e^{\lambda_1}}{\lambda_1^{\sum x_i}e^{\lambda_0}}\leq k##

Taking logarithms

## \ln \left( \lambda_0^{\sum x_i}e^{\lambda_1} \right)-\ln \left( \lambda_1^{\sum x_i}e^{\lambda_0} \right)\leq \ln(k)\\
\ln \left( \lambda_0^{\sum x_i}\right)+\ln\left(e^{\lambda_1} \right)-\ln \left( \lambda_1^{\sum x_i}\right)-\left(e^{\lambda_0} \right)\leq \ln(k)\\
\left(\sum x_i\right)\ln (\lambda_0)+\lambda_1 -\left( \sum x_i \right)\ln \left( \lambda_1\right)-\lambda_0\leq \ln(k)\\
\left(\sum x_i\right)\left(\ln (\lambda_0) -\ln \left( \lambda_1\right)\right)\leq \ln(k)+(\lambda_0-\lambda_1)\\
\sum x_i\leq \frac{\ln(k)+(\lambda_0-\lambda_1)}{\ln (\lambda_0) -\ln \left( \lambda_1\right)}
##

Because of that I have to find ##c## such that
##P\left( \sum_{i=1}^n X_i \leq c |, \lambda = \lambda_0 \right) \leq \alpha##

and

##P\left( \sum_{i=1}^{c+1} X_i \le c \,\middle|\, \lambda = \lambda_0 \right) \geq \alpha##

Which reduced to the pair of equations you see above.

Last edited by a moderator:
Ray Vickson
Homework Helper
Dearly Missed
You are right, it is ##e^{-n\lambda}##
In that case, you can express the sum in terms of known functions:
$$\sum_{k=0}^c \frac{(n \lambda)^k e^{-n \lambda}}{k!} = \frac{\Gamma(c+1,n \lambda)}{\Gamma(c+1)},$$
where ##\Gamma(p,q)## is the incomplete Gamma function:
$$\Gamma(p,q) = \int_q^{\infty} t^{p-1} e^{-t} \, dt .$$
Whether this is of any use at all is another issue.

Last edited:
Ray Vickson
Homework Helper
Dearly Missed
You're right. It is ##e^{-n\lambda}##.

It's supposed to be the cumulative function. This is part of a larger problem, I didn't post the whole thing because I had some parts worked out. I don't think I can edit the initial post anymore, but I will post the original problem to give some context (which I probably should have done before).

The idea of the problem consists in having ##X_1,\dots, X_n## simple random sample of ##X\sim \operatorname{Poisson}(\lambda)## and the goal is the optimal critical region ##\alpha## for ##H_0:\lambda =\lambda_0## against ##H_1:\lambda=\lambda_1##.

I applied Neyman-Pearson theorem and followed ## \frac{\lambda_0}{\lambda_1} = \frac{(\lambda_0^{\sum x_i} e^{-\lambda_0}) / (\prod_{i=1}^n x_i!)}{(\lambda_1^{\sum x_i}e^{-\lambda_1})/(\prod_{i=1}^n x_i!)} = \frac{\lambda_0^{\sum x_i}e^{\lambda_1}}{\lambda_1^{\sum x_i}e^{\lambda_0}}\leq k##

Taking logarithms

## \ln \left( \lambda_0^{\sum x_i}e^{\lambda_1} \right)-\ln \left( \lambda_1^{\sum x_i}e^{\lambda_0} \right)\leq \ln(k)\\
\ln \left( \lambda_0^{\sum x_i}\right)+\ln\left(e^{\lambda_1} \right)-\ln \left( \lambda_1^{\sum x_i}\right)-\left(e^{\lambda_0} \right)\leq \ln(k)\\
\left(\sum x_i\right)\ln (\lambda_0)+\lambda_1 -\left( \sum x_i \right)\ln \left( \lambda_1\right)-\lambda_0\leq \ln(k)\\
\left(\sum x_i\right)\left(\ln (\lambda_0) -\ln \left( \lambda_1\right)\right)\leq \ln(k)+(\lambda_0-\lambda_1)\\
\sum x_i\leq \frac{\ln(k)+(\lambda_0-\lambda_1)}{\ln (\lambda_0) -\ln \left( \lambda_1\right)}
##

Because of that I have to find ##c## such that
##P\left( \sum_{i=1}^n X_i \leq c |, \lambda = \lambda_0 \right) \leq \alpha##

and

##P\left( \sum_{i=1}^{c+1} X_i \le c \,\middle|\, \lambda = \lambda_0 \right) \geq \alpha##

Which reduced to the pair of equations you see above.
I really don't "get" these two equations. Suppose, eg., that ##\lambda_0 < \lambda_1##. Say we accept the null hypothesis if ##\sum X_i \leq c## and reject it if ##\sum X_i > c##. (Since the random variables are discrete we need to distinguish ## < c## from ##\leq c##, and I have more-or-less arbitrarily chosen the ##\leq c## version for the acceptance region.) Thus, we accept ##H_0## if ##\sum_{I=1}^n X_i \leq c## and reject it otherwise. So, the probability of a type-I error is ##P(I) = P(\sum_{I=1}^n X_i > c| \lambda = \lambda_0)##, and we want this to be ##\leq \alpha.## For a given ##n## that tells you the acceptable values of ##c##.

The probability of a type-II error is ##P(II) = P(\sum_{I=1}^n X_i \leq c | \lambda = \lambda_1)##, and (presumably) we want this to be ##\leq \beta## for some specified value ##\beta.## Your presentation does mention any ##\beta##, but of course you could take ##\beta = \alpha.## However, if you are doing that you need to mention it!

The two conditions taken together give two inequalities involving ##(n , c)##, which we can probably solve (numerically) using a computer algebra package such as Maple or Mathematica.

Last edited:
StoneTemplePython
Gold Member
You're right. It is ##e^{-n\lambda}##.
I will post the original problem to give some context (which I probably should have done before).

You definitely should have.

You're right. It is ##e^{-n\lambda}##.
The idea of the problem consists in having ##X_1,\dots, X_n## simple random sample of ##X\sim \operatorname{Poisson}(\lambda)## and the goal is the optimal critical region ##\alpha## for ##H_0:\lambda =\lambda_0## against ##H_1:\lambda=\lambda_1##.

Suppose for a minute that ##X## is instead a normal random variable with variance of 1. Can you solve this? How would you do it?

- - - - - - - -
I am getting concerned that you are getting into the weeds of classical stats with a firm grounding in probability. Classical stats is already notorious for being presented in a cookbook of recipes fashion, with ties to probability, making it confusing for people. If the ties aren't strong, it gets worse.