# Probability approximation and computation given Compound Poisson random variable

Consider a compound Poisson random variable $$S = \Sigma_{i=1}^N X_i$$ where N is Poisson with mean 2 and $$X_i$$ is equally likely to be any of 1,2,3,4 . Find P{S = 6}.

Solution:

Let me solve this problem. We are given that $$S = \Sigma_{i=1}^N X_i$$ where N is Poisson with mean 2 and $$X_i$$ is equally likely to be any of 1,2,3,4. We need to find the probability that S = 6.

Since N is Poisson with mean 2, the probability mass function of N is given by $$P(N=k) = \displaystyle\frac{e^{-2}2^k}{k!}$$ for $$k = 0,1,2,\dots$$

The conditional distribution of S given N=k is the distribution of the sum of k independent and identically distributed random variables, each of which is equally likely to be any of 1,2,3,4. Therefore, the conditional distribution of S given N=k is the k-fold convolution of the uniform distribution on {1,2,3,4}.

Let's denote by $$p_k$$ the probability that S=6 given that N=k. Then we have:

$$p_0 = P(S=6|N=0) = 0$$ since if there are no terms in the sum, the sum must be zero.

$$p_1 = P(S=6|N=1) = 0$$ since if there is only one term in the sum, it must be one of 1,2,3,4.

$$p_2 = P(S=6|N=2) = \displaystyle\frac{3}{16}$$ since there are two terms in the sum and each term can be any of 1,2,3,4. Three ways for the sum to be 6 are (4,2)(2,4),(3,3)

$$p_3 = P(S=6|N=3) = \displaystyle\frac{10}{64}$$ since there are three terms in the sum and each term can be any of 1,2,3,4. The 10 ways for the sum to be 6 are (1,1,4)(1,4,1),(4,1,1),(1,2,3),(3,2,1),(1,3,2),(3,1,2),(2,3,1),(2,1,3),(2,2,2).

$$p_4 = P(S=6|N=4) = \displaystyle\frac{10}{256}$$ since there are four terms in the sum and each term can be any of 1,2,3,4. The ten ways for the sum to be 6 are (1,1,1,3)(1,1,3,1)(1,3,1,1),(3,1,1,1),(2,2,1,1),(2,1,2,1),(2,1,1,2),(1,1,2,2),(1,2,1,2),(1,2,2,1).

There are five ways for the sum to be 6 when there are five terms in the sum and each term can be any of 1,2,3,4. Those are (1,1,1,1,2),(1,1,1,2,1),(1,1,2,1,1),(1,2,1,1,1),(2,1,1,1,1). So the correct value for $$p_5$$ should be $$p_5 = P(S=6|N=5) = \displaystyle\frac{5}{1024}$$.

Similarly, there is also one way for the sum to be 6 when there are six terms in the sum and each term can be any of 1,2,3,4. That is if all six terms are 1. So the correct value for $$p_6$$ should be $$p_6 = P(S=6|N=6) = \displaystyle\frac{1}{4096}$$.

the probability that S equals 6 becomes:

$$P(S=6) = \sum_{k=0}^{\infty} P(S=6|N=k)P(N=k)$$

$$P(S=6) = P(N=0)\cdot p_0 + P(N=1)\cdot p_1 + P(N=2)\cdot p_2 + P(N=3)\cdot p_3 + P(N=4)\cdot p_4 + P(N=5)\cdot p_5 + P(N=6)\cdot p_6$$

$$P(S=6) = \displaystyle\frac{e^{-2}2^0}{0!} \times 0 + \displaystyle\frac{e^{-2}2^1}{1!} \times 0 + \displaystyle\frac{e^{-2}2^2}{2!} \times \displaystyle\frac{3}{16} + \displaystyle\frac{e^{-2}2^3}{3!} \times \displaystyle\frac{10}{64} + \displaystyle\frac{e^{-2}2^4}{4!} \times \displaystyle\frac{10}{256} + \displaystyle\frac{e^{-2}2^5}{5!}\times \displaystyle\frac{5}{1024} + \displaystyle\frac{e^{-2}2^6}{6!} \times \displaystyle\frac{1}{4096}$$

$$P(S=6) = \displaystyle\frac{e^{-2}\cdot 3}{8} + \displaystyle\frac{e^{-2}\cdot 10}{48} + \displaystyle\frac{e^{-2}\cdot 10}{384} + \displaystyle\frac{e^{-2}}{768} + \displaystyle\frac{e^{-2}}{46080}$$

$$P(S=6) ≈ 0.0826$$

So the probability that S equals 6 is approximately 0.0826.

• For each value of $N$ (from 2 to 6) you might want to list out the possible outcomes. For example with $N=2$ the possible outcomes are (3,3), (2,4), and (4,2).
– JimB
Commented Aug 28, 2023 at 14:56
• In R you can check your result with a simulation such as S <- sapply(rpois(1e4, 2), \(n) sum(sample.int(4, n, replace = TRUE))); sum(S==6)/length(S) By inspecting S (as in table(S)) you might get some insight into how to compute the probabilities correctly. Notice, too, that 3+3=6.
– whuber
Commented Aug 28, 2023 at 15:46
• @whuber, When I implemented your 'R' program in 'R', 'R' gave me answer 0.0855. How is that? Commented Aug 28, 2023 at 16:23
– whuber
Commented Aug 28, 2023 at 16:25

Your approach looks correct but it's incomplete.

Here is a schematic of all the ways you can form $$6$$ from a sum of values of $$X_i,$$ organized by their unordered values:

N | Total ways | X's
- | ---------- | ----
1 |          0 | [Omitted: 6]
2 |          3 | 24, 42;  33; [Omitted: 51, 15]
3 |         10 | 114, 141, 411;  222;  123, 132, 213, 231, 312, 321
4 |         10 | 1113, 1131, 1311, 3111;  1122, 1212, 2112, 2211, 2121, 1221
5 |          5 | 11112, 11121, 11211, 12111, 21111
6 |          1 | 111111


Thus, when $$N=2$$ the chance of forming $$S=6$$ is $$3/4^2;$$ when $$N=3$$ the chance of $$S=6$$ is $$10/4^3;$$ and so on. To obtain the answer (which a quick simulation suggests must be close to $$0.082$$), apply the rules of conditional expectation:

$$\Pr(S=6) = \Pr(S=6\mid N=2)\Pr(N=2) + \cdots + \Pr(S=6\mid N=6)\Pr(N=6).$$

The pattern of total ways $$0,3,10,10,5,1$$ (beginning with $$N=1$$) derives from the sequence $$1, 5, 10, 10, 5, 1$$ of binomial coefficients counting the compositions of 6. The first two values are reduced from $$1$$ to $$0$$ and $$5$$ to $$3$$ because the compositions $$6=6$$ and $$6=1+5=5+1$$ are not available since no $$X_i$$ can exceed $$4.$$

• You answered this question using permutation. Combination is used in my answer. That means in your answer, order of values matters whereas in my answer, order of values doesn't matter. 😊 Commented Aug 28, 2023 at 17:39
• The question is worded to imply the order does matter. You can discover this by considering the simple subproblem where, say $N=2.$ What is $\Pr(S=6)$ in this case? This is tantamount to asking the chance that the sum on two four-sided dice is $6.$ There are many ways to work it out, but they all are equivalent and there's only one correct answer.
– whuber
Commented Aug 28, 2023 at 18:05