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?
 A: 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.
A: 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}.$
