If I have a Bernoulli random variable with a probability p of value 2 and a probability q=(1-p) of value 98, I can represent its PGF as G(z,p,q,1), see below. Is G(z,p,q,n) below correct for the PGF of the *product* of n independent such random samples? (%i1) G(z,p,q,1); 98 2 (%o1) q z + p z (%i2) G(z,p,q,2); 2 9604 196 2 4 (%o2) q z + 2 p q z + p z (%i3) G(z,p,q,n); n ==== i n - i \ i n - i 2 98 (%o3) > binomial(n, i) p q z / ==== i = 0 --- An aside: trying to *factor* such a polynomial as in %o2 above causes mucho pain! Are there any poly factoring algs that can factor polys like these (or prove they aren't factorable) ?