# How can I compute the pmf of a random sum?

How can I compute the pmf of a random sum(1 to N) of iid bernoulli random variables, where N is distributed geometrically?

-
I suppose pmf stands for probability mass function. – Aryabhata Oct 19 '10 at 13:42

Let $S = \sum_{i=1}^{N} X_i$ be the random sum that you are interested in. $X_i$ are the iid Bernoulli random variables. To compute the probability that the random sum $S$ equals an integer $s$, use the law of total probability as follows:

$P(S=s) = \sum_{n=1}^{\infty} P(S=s \mid N=n) P(N=n)$.

Once we condition on $N = n$, the sum of $n$ iid Bernoulli random variables is easy to compute (the answer will be another familiar distribution). Since $P(N=n)$ follows the geometric law, we can compute both the terms of the product and then compute the infinite sum.

-
Is it possible to obtain a closed form for the resulting infinite sum? – user2617 Oct 19 '10 at 4:40
@user2617: Yes, I was able to get a closed form. – Dinesh Oct 19 '10 at 4:54

if $N$ is independent of the bernoulli sequence, you have what is called a compound distribution. the pmf can be obtained by conditioning: if $X$ is the [random] sum,

$P(X = k | N = n) = {\rm bin}(k,n,p) = {\binom{n}{k}}p^k(1-p)^{n-k}.$

if $N$ is geometric-$t, P(N = n) = (1- t)t^n, n = 0,1,\dots .$

then

$P(X=k, N=n) = \binom{n}{k}p^k(1-p)^{n-k}(1-t)t^n.$

now sum out $n$ for $n \ge k$ to get

$P(X=k) = \sum_{n=k}^\infty \binom{n}{k}p^k(1-p)^{n-k}(1-t)t^n$

$= p^kt^k(1-t)\sum_k^\infty \binom{n}{k}[(1-p)t)]^{n-k}$

$= (pt)^k(1-t)\sum_{m=0}^\infty \binom{m+k}{k}[(1-p)t)]^m$

$=(pt)^k(1-t)(1- (1-p)t)^{-(k+1)}$

$=\frac{1-t}{1-t+pt}[\frac{pt}{1-t+pt}]^k.$

so $X \sim {\rm geom}-\frac{pt}{1-t+pt}.$

-
Isn't the pmf of a geometric series (1-t)^(n-1)*t ? – user2617 Oct 19 '10 at 5:07
@user2617 - It depends on whether the geometric random variable takes values from $0,1,\dots$ or from $1,2,\dots$. The distribution you have in the comment corresponds to the former one. But in the context of your problem, the later version is more meaningful. – Dinesh Oct 19 '10 at 6:03