# Sheldon Ross 10: Exercise 3.53

Question: Suppose X is a Poisson random variable with mean λ. The parameter λ is itself a random variable whose distribution is exponential with mean 1. Show that P{X =n} = (12)n+1

Analytical Solution

There is not much to it, just set up the conditional expression and that should be it

P{X=n} = Integral( P{ X=n | Λ = λ } P{ Λ = λ }) ∂λ with ( λ ∈ [0, ∞) ) = Γ(n+1)n! 2n+1 = (12)n+1

Note, P{ X=n | Λ = λ } would the PMF of the Poisson Distribution

Simulation Solution

The first image below is showing the analytical solution and the second one is showing the experiment. The code for the both is provided below in the code section.

Code

```Module[
{\[CapitalLambda] := RandomVariate[ExponentialDistribution], data},
data =
KeySort@
Counts[
Table[RandomVariate[PoissonDistribution[\[CapitalLambda]]], 10000]
];
BarChart[
data,
ImageSize -> 788,
Frame -> True,
ChartLabels -> Placed[{Keys@data, Values@data}, {Below, Above}],
ChartStyle -> Directive[EdgeForm[Red], LightBlue],
FrameLabel -> (Style[#, 20] & /@ {"Outcome", "Count"})]
]

Plot[1 / 2^(n + 1), {n, 0, 10}, PlotRange -> All, Frame -> True,
ImageSize -> 788,
GridLines -> {Range[0, 10, 0.5], Range[0, 0.5, 0.05]},
AspectRatio -> 0.5,
FrameLabel -> (Style[#, 20] & /@ {"n",
"\!\(\*FractionBox[\(1\), SuperscriptBox[\(2\), \(n + 1\)]]\)"})]```

End of the post 😉