-2

I have come across questions in R which deal with exponential and poisson distributions separately, but I am unsure about how to go about it when you need to use both in the same question

The number of customers attending a shop in (0,t) has Poisson distribution with parameter βt. The time that each customer spends in the shop has Exponential distribution with parameter λ. Find the probability that while a particular customer is shopping, maximum k other customer arrive. Use (any) β=λ and k=2. Use 10,000 samples.

How would this be solved?

double-beep
  • 5,031
  • 17
  • 33
  • 41

1 Answers1

3

Simulate how long it will take for that customer to be served (using rexp), then simulate how many customers arrive during that time (using rpois). You should be able to combine both steps in a single expression. Make 10,000 such 2-step simulations. In what percentage is the number of arrivals <= 2?

Since this seems to be homework, I don't want to say any more than that.

Nit-pick: I don't like the wording of the problem when it says "find the probability ... " It would be more precise to say "estimate the probability ... ".

John Coleman
  • 51,337
  • 7
  • 54
  • 119