Exercises
Contents
Exercises#
Example 5.7 (link)#
Problem
Suppose that the number of customers visiting a fast food restaurant in a given day follows a Poisson distribution with parameter \(\lambda\). We further note that each customer purchases a drink with probability \(p\), independently from other customers and independently from Poisson distribution. Then, let \(X\) be the number of customers who purchase drinks, find \(\mathbb{E}[X]\).
Let \(Y\) be the number of customers visiting the restaurant in a given day. Then, we have
The problem mentioned that each customer purchases a drink with probability \(p\), independently from other customers \((\iid)\). This allows us to model each customer as a Bernoulli random variable with parameter \(p\). More concretely, let \(W\) be the indicator random variable of whether a customer purchases a drink or not, then we have \(W \sim \text{Bernoulli}(p)\).
We can then model \(X\) as the number of customers who purchase drinks in a day, which is a binomial random variable with parameters \(n\) and \(p\). More concretely, we have \(X\) as a sum of \(n\) independent Bernoulli random variables \(W\) with parameter \(p\), then we have \(X \sim \text{Binomial}(n, p)\).
The question asks us to find \(\mathbb{E}[X]\). We do know that \(\mathbb{E}[X] = np\), but we do not know what \(n\) is in a single day. Our intuition says that since the number of customers visiting the restaurant in a day follows a Poisson distribution, then the average number of customers visiting the restaurant in a day is \(\lambda\), by definition Property 15. Then we can instead say \(\mathbb{E}[X] = \lambda p\). It turns out our intuition is correct, and we can prove this result using the Law of Total Expectation.
The Law of Total Expectation states that
The tricky part is we need to sum all possible values of \(Y\), which is an infinite set \(\mathbb{N}\), let’s write it as follows:
For \(p_Y(n)\), we know that \(Y\) follows a Poisson distribution with parameter \(\lambda\), then we have
For \(\mathbb{E}[X \mid Y=n]\), we need to find a general expression for this, since this should be a expression in terms of \(X\), it means that \(X \mid Y=n\) follows a Binomial distribution with parameters \(n\) and \(p\).
where \(n\) is the number of customers visiting the restaurant in a day, and \(p\) is the probability of a customer purchasing a drink. Then
Putting everything together, we have
where we used the fact that \(\sum_{n=0}^{\infty} n p_Y(n) = \mathbb{E}[Y]\).