6
$\begingroup$

I am new to Statistics and R. So, I'm stumbling upon certain problems. Please bear with me.

There' a question - 2% items in a factory are defective. What is the probability that there will be 2 defective items in 100 items?

My textbook solved it as a Poisson distribution and took l = np = 2. Then it solved using PDF to get the answer as 0.2706. The corresponding R syntax is dpois(2,2)

I solved using binomial distribution and used dbinom(2, 100, 0.02) but got something different. However dbinom(1, 100, 0.02) comes near to the Poisson distribution answer.

So, I learnt that Poisson is a special kind of Binomial where n tends to infinity and p is very small. But however they should give same results, shouldn't they?

Maybe I'm asking something very trivial and missing something. Please help me out. Thanks in advance.

$\endgroup$
3
  • 1
    $\begingroup$ Could you add the numeric results into the question? $\endgroup$ Commented Jan 28, 2018 at 8:27
  • $\begingroup$ @Juho Kokkala, sorry! Can you explain numeric results? $\endgroup$
    – lu5er
    Commented Jan 28, 2018 at 9:38
  • 1
    $\begingroup$ I meant just the values you got using the binomial distribution (such as $0.2734$) $\endgroup$ Commented Jan 28, 2018 at 10:23

1 Answer 1

9
$\begingroup$

Both yield nearly the same result:

> dpois(2,2)
[1] 0.2706706
> dbinom(2,100,.02)
[1] 0.2734139

Both results would get more similar as n tended to infinite and p tended to zero, but n=100 is large but a lot smaller than infinite, so you can get an accurate result up to a couple of significant digits.

Edit in response to comment: Ok.. So based on n should I choose which method to use?

The variable in your statement is distributed according to a binomial. Therefore, the binomial distribution produces the exact result. Then, you should use the binomial distribution if you can do the maths.

However, sometimes calculation with binomial is difficult, specially when computations need to be done by hand or when some parameters are unknown. Then you can resort to two approximations of binomial if n is large:

  • If n is large and p is small, you can use Poisson distribution to approximate binomial (as in this problem).
  • If n is large and n*p is not small, you can use normal distribution to approximate binomial.

For example, solving your problem by hand using binomial involves calculating $0.98^{98}$, which can take a bit long, while solving it using Poisson doesn't need anything harder than $e^{-2}$, that is a lot easier even if you don't have a logarithms table at hand.

However, if you use R, Excel or any other software with statistical capabilities, you don't need to worry about such approximations because the program handles them when needed.

$\endgroup$
2
  • 1
    $\begingroup$ Ok.. So based on n should I choose which method to use? $\endgroup$
    – lu5er
    Commented Jan 28, 2018 at 9:44
  • 4
    $\begingroup$ @lU5er "should" depends on what you are trying to do. If you are trying to solve a homework problem in a section about the Poisson approximation to the binomial then you should use Poisson. Even apart from that, you might prefer Poisson if $n$ is large enough since it might yield a model which is easier to reason about. Also, even in R the time difference between the methods is not nothing (as microbenchmark() will show). For a single calculation it is utterly negligible, but in a program with many, many evaluations it might make a difference. $\endgroup$ Commented Jan 28, 2018 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.