Write an R function compare(n,p,k) that computes (exactly) P(X =k) P(Y= k), where Y~Pois(np).

Hello Picasso,

please visit the homework policies of RStudio Community (FAQ: Homework Policy - meta / Guides & FAQs - RStudio Community) and provide a reprex (reproducible example) of your thoughts on how to solve this question.

As a hint: You might want to read about the R build in function for the density of a Binomial (dbinom()) and Poission (dpois()) respectively.

Kind regards