the probability generating function (pgf)
Suppose a random variable X counts something — the number of heads in ten flips, the number of customers in an hour, the number of accidents in a year. Its whole story lives in the list of probabilities P(X = 0), P(X = 1), P(X = 2), and so on. Carrying around an infinite list is awkward. The probability generating function packs that entire list into a single tidy function of a bookkeeping variable s, so the whole distribution travels as one object.
For a random variable X that takes only non-negative whole values, the pgf is G_X(s) = E[s^X] = sum from k=0 to infinity of P(X = k) times s^k. Read that sum like a coat rack: the coefficient hanging on s^k is exactly P(X = k). So s^0 carries P(X = 0), s^1 carries P(X = 1), and so on; the variable s itself has no meaning beyond holding the probabilities in their slots. Because all those probabilities are between 0 and 1 and add to 1, the series always converges for any s with |s| <= 1, so the pgf is guaranteed to exist for these counting variables — unlike the moment generating function, which can fail.
The pgf earns its keep because it turns hard operations into easy ones. The sum of two independent counting variables has a pgf equal to the product of their pgfs, which is how you add Poissons or binomials painlessly. And you can recover everything you stored: setting s = 1 gives G_X(1) = 1 (the probabilities sum to one), differentiating and evaluating recovers both the probabilities and the moments. It is the discrete cousin of the mgf and characteristic function, specialized to variables that count.
For a single fair coin counted as X = number of heads (0 or 1) with P(X=0) = P(X=1) = 1/2, the pgf is G_X(s) = (1/2) + (1/2)s. For X ~ Poisson(lambda) the pgf collapses to the clean form G_X(s) = e^(lambda(s - 1)) — a whole infinite list of probabilities folded into one exponential.
G_X(s) = E[s^X]: the coefficient of s^k is exactly P(X = k).
The pgf is only for non-negative integer-valued variables. For general continuous variables you reach instead for the moment generating function or the always-existing characteristic function.