{
  "id": "probability-generating-function",
  "title": "Probability Generating Function",
  "lang": "en",
  "source_lang": "en",
  "summary": "A probability generating function encodes the distribution of a nonnegative integer-valued random variable as a power series, enabling calculations of probabilities, moments, and distributions of sums.",
  "category": "mathematics",
  "subcategory": "probability-statistics",
  "type": "concept",
  "aliases": [
    "PGF",
    "Probability-generating function"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/probability-generating-function/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/probability-generating-function/",
      "json": "https://aiwiki.page/zh/probability-generating-function.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A probability generating function (PGF) is a generating function whose coefficients are the probabilities of a nonnegative integer-valued random variable. It represents an entire probability distribution by a single function. Its algebraic and analytic properties make it especially useful for studying counts, sums of independent random variables, random sums, and population models."
    },
    {
      "heading": "Definition and domain",
      "text": "Let \\(X\\) take values in \\(\\{0,1,2,\\ldots\\}\\), with probability mass function\n\n\\[p_n=\\Pr(X=n).\\]\n\nThe probability generating function of \\(X\\) is\n\n\\[G_X(s)=\\mathbb E[s^X] =\\sum_{n=0}^{\\infty}p_n s^n,\\]\n\nwhere \\(\\mathbb E\\) denotes expectation. At \\(s=0\\), the term corresponding to \\(X=0\\) is defined to be \\(1\\), so that \\(G_X(0)=p_0\\).\n\nAlthough real arguments \\(0\\le s\\le1\\) suffice for many probabilistic applications, the PGF can also be treated as a function of a complex variable. Its defining power series converges absolutely for every \\(|s|\\le1\\), because\n\n\\[\\sum_{n=0}^{\\infty}|p_ns^n| \\le \\sum_{n=0}^{\\infty}p_n=1.\\]\n\nConsequently, its radius of convergence is at least \\(1\\). It is an analytic function on the open unit disk and continuous on the closed unit disk.\n\nThe radius may be larger than \\(1\\), but this is not guaranteed. Finite-support distributions have polynomial PGFs, whereas sufficiently heavy-tailed distributions can have radius of convergence exactly \\(1\\).\n\nA power series\n\n\\[G(s)=\\sum_{n=0}^{\\infty}a_ns^n\\]\n\nis a PGF precisely when its coefficients are nonnegative and sum to \\(1\\)."
    },
    {
      "heading": "Recovering probabilities",
      "text": "The coefficients of a PGF are exactly the probabilities it encodes. In particular,\n\n\\[\\Pr(X=n)=\\frac{G_X^{(n)}(0)}{n!}, \\qquad n=0,1,2,\\ldots,\\]\n\nwhere \\(G_X^{(0)}=G_X\\). Thus the PGF uniquely determines the distribution.\n\nUsing coefficient-extraction notation,\n\n\\[[s^n]G_X(s)=\\Pr(X=n).\\]\n\nFor example, if\n\n\\[G_X(s)=\\frac14+\\frac12s+\\frac14s^2,\\]\n\nthen \\(X\\) takes the values \\(0,1,2\\) with probabilities \\(1/4,1/2,1/4\\).\n\nCumulative probabilities can also be extracted from a generating function. For \\(|s|<1\\),\n\n\\[\\frac{G_X(s)}{1-s} = \\sum_{n=0}^{\\infty}\\Pr(X\\le n)s^n.\\]\n\nSimilarly,\n\n\\[\\frac{1-G_X(s)}{1-s} = \\sum_{n=0}^{\\infty}\\Pr(X>n)s^n.\\]\n\nThe second identity gives the tail-sum formula\n\n\\[\\mathbb E[X]=\\sum_{n=0}^{\\infty}\\Pr(X>n),\\]\n\nwith both sides allowed to be infinite."
    },
    {
      "heading": "Basic properties",
      "text": "Every PGF satisfies\n\n\\[G_X(0)=\\Pr(X=0), \\qquad G_X(1)=1.\\]\n\nOn the interval \\([0,1]\\), it is nondecreasing and convex. Within \\(0<s<1\\), all derivatives are nonnegative, since termwise differentiation gives\n\n\\[G_X^{(k)}(s) = \\sum_{n=k}^{\\infty} n(n-1)\\cdots(n-k+1)p_ns^{n-k}.\\]\n\nAt selected complex arguments, a PGF can reveal arithmetic features of the distribution. For example,\n\n\\[G_X(-1) = \\Pr(X\\text{ is even})-\\Pr(X\\text{ is odd}),\\]\n\nso\n\n\\[\\Pr(X\\text{ is even})=\\frac{1+G_X(-1)}2.\\]\n\nMore generally, values at roots of unity determine probabilities for residue classes. If \\(\\omega=e^{2\\pi i/m}\\), then\n\n\\[\\Pr(X\\equiv r\\pmod m) = \\frac1m\\sum_{j=0}^{m-1} \\omega^{-jr}G_X(\\omega^j).\\]\n\nThis is a finite Fourier inversion identity."
    },
    {
      "heading": "Factorial moments, mean, and variance",
      "text": "Differentiation at \\(s=1\\) yields factorial moments. Define the falling factorial by\n\n\\[(X)_k=X(X-1)\\cdots(X-k+1).\\]\n\nThen\n\n\\[G_X^{(k)}(1-)=\\mathbb E[(X)_k].\\]\n\nThe notation \\(1-\\) means the limit as \\(s\\) increases to \\(1\\) from below. These identities remain valid with value \\(+\\infty\\), even when the relevant moments are not finite.\n\nIn particular,\n\n\\[\\mathbb E[X]=G_X'(1-)\\]\n\nand\n\n\\[\\mathbb E[X(X-1)]=G_X''(1-).\\]\n\nWhen the second moment is finite, the variance is\n\n\\[\\operatorname{Var}(X) = G_X''(1-)+G_X'(1-) -\\bigl(G_X'(1-)\\bigr)^2.\\]\n\nThis follows from \\(X^2=X(X-1)+X\\).\n\nOrdinary moments can also be obtained with the differential operator\n\n\\[D=s\\frac{d}{ds}.\\]\n\nSince \\(D(s^n)=ns^n\\),\n\n\\[\\mathbb E[X^k] = \\lim_{s\\uparrow1}D^kG_X(s).\\]\n\nA PGF therefore always exists on \\([0,1]\\), even when the random variable has infinite mean or higher moments."
    },
    {
      "heading": "Standard examples",
      "text": "Bernoulli distribution\n\nFor a Bernoulli random variable with success probability \\(p\\),\n\n\\[\\Pr(X=0)=1-p,\\qquad \\Pr(X=1)=p,\\]\n\nand\n\n\\[G_X(s)=1-p+ps.\\]\n\nBinomial distribution\n\nIf \\(X\\) has a binomial distribution with parameters \\(n\\) and \\(p\\), then\n\n\\[G_X(s)=(1-p+ps)^n.\\]\n\nThe coefficients follow from the binomial theorem. Differentiation gives\n\n\\[\\mathbb E[X]=np, \\qquad \\operatorname{Var}(X)=np(1-p).\\]\n\nPoisson distribution\n\nFor a Poisson distribution with parameter \\(\\lambda\\ge0\\),\n\n\\[G_X(s) = \\sum_{n=0}^{\\infty} e^{-\\lambda}\\frac{\\lambda^n}{n!}s^n = e^{\\lambda(s-1)}.\\]\n\nConsequently,\n\n\\[\\mathbb E[X]=\\operatorname{Var}(X)=\\lambda.\\]\n\nGeometric distribution\n\nSuppose \\(X\\) counts failures before the first success in independent trials with success probability \\(p\\), where \\(0<p\\le1\\). Then\n\n\\[\\Pr(X=n)=p(1-p)^n,\\qquad n\\ge0,\\]\n\nand the geometric series gives\n\n\\[G_X(s)=\\frac{p}{1-(1-p)s}.\\]\n\nIf instead the variable counts trials up to and including the first success, its PGF is\n\n\\[\\frac{ps}{1-(1-p)s}.\\]\n\nThe distinction reflects the two common conventions for the geometric distribution."
    },
    {
      "heading": "Independent sums and convolution",
      "text": "If \\(X\\) and \\(Y\\) satisfy statistical independence, then\n\n\\[G_{X+Y}(s) = \\mathbb E[s^{X+Y}] = \\mathbb E[s^X]\\mathbb E[s^Y] = G_X(s)G_Y(s).\\]\n\nMultiplication of PGFs corresponds to convolution of probability mass functions:\n\n\\[\\Pr(X+Y=n) = \\sum_{k=0}^{n}\\Pr(X=k)\\Pr(Y=n-k).\\]\n\nFor independent \\(X_1,\\ldots,X_m\\),\n\n\\[G_{X_1+\\cdots+X_m}(s) = \\prod_{j=1}^{m}G_{X_j}(s).\\]\n\nIf they are identically distributed with PGF \\(G\\), this becomes \\(G(s)^m\\).\n\nFor example, independent Poisson variables with parameters \\(\\lambda_1,\\ldots,\\lambda_m\\) have a sum with PGF\n\n\\[\\prod_{j=1}^{m}e^{\\lambda_j(s-1)} = e^{(\\lambda_1+\\cdots+\\lambda_m)(s-1)},\\]\n\nwhich identifies the sum as Poisson with parameter \\(\\lambda_1+\\cdots+\\lambda_m\\).\n\nWithout independence, the product rule generally fails."
    },
    {
      "heading": "Random sums and thinning",
      "text": "Random sums\n\nLet \\(N\\) be a nonnegative integer-valued random variable, and let \\(X_1,X_2,\\ldots\\) be independent, identically distributed nonnegative integer-valued variables, independent of \\(N\\). Define\n\n\\[S=\\sum_{j=1}^{N}X_j,\\]\n\nwith \\(S=0\\) when \\(N=0\\).\n\nConditioning on \\(N\\) gives\n\n\\[G_S(s) = \\mathbb E[G_X(s)^N] = G_N(G_X(s)).\\]\n\nThus a random sum corresponds to composition of PGFs.\n\nWhen the relevant moments are finite,\n\n\\[\\mathbb E[S]=\\mathbb E[N]\\mathbb E[X_1]\\]\n\nand\n\n\\[\\operatorname{Var}(S) = \\mathbb E[N]\\operatorname{Var}(X_1) + \\operatorname{Var}(N)\\bigl(\\mathbb E[X_1]\\bigr)^2.\\]\n\nIf \\(N\\) is Poisson with parameter \\(\\lambda\\), the resulting compound Poisson distribution has PGF\n\n\\[G_S(s)=\\exp\\!\\left(\\lambda(G_X(s)-1)\\right).\\]\n\nIndependent thinning\n\nSuppose each of \\(X\\) objects is retained independently with probability \\(p\\). If \\(Y\\) is the number retained, then its conditional distribution given \\(X=n\\) is binomial:\n\n\\[Y\\mid X=n\\sim\\operatorname{Binomial}(n,p).\\]\n\nHence\n\n\\[G_Y(s)=G_X(1-p+ps).\\]\n\nIn particular, thinning a Poisson count with mean \\(\\lambda\\) produces a Poisson count with mean \\(p\\lambda\\)."
    },
    {
      "heading": "Branching processes",
      "text": "PGFs are central to branching processes. In a Galton–Watson process, each individual independently produces a random number of offspring with the same PGF \\(f\\). Let \\(Z_n\\) be the population in generation \\(n\\), starting from \\(Z_0=1\\).\n\nConditional on \\(Z_n\\), the next generation is a sum of \\(Z_n\\) independent offspring counts. Therefore,\n\n\\[G_{Z_{n+1}}(s)=G_{Z_n}(f(s)),\\]\n\nand\n\n\\[G_{Z_n}(s)=f^{\\circ n}(s),\\]\n\nwhere \\(f^{\\circ n}\\) denotes \\(n\\)-fold composition, not an ordinary power.\n\nThe probability of extinction by generation \\(n\\) is\n\n\\[\\Pr(Z_n=0)=f^{\\circ n}(0).\\]\n\nThe eventual extinction probability \\(q\\) is the smallest solution in \\([0,1]\\) of the fixed-point equation\n\n\\[q=f(q).\\]\n\nWriting \\(m=f'(1-)\\) for the mean number of offspring:\n\n- If \\(m<1\\), extinction occurs with probability \\(1\\).\n- If \\(m=1\\), extinction occurs with probability \\(1\\), except when every individual has exactly one offspring.\n- If \\(m>1\\), the extinction probability is less than \\(1\\)."
    },
    {
      "heading": "Multivariate probability generating functions",
      "text": "For nonnegative integer-valued random variables \\(X_1,\\ldots,X_d\\), the joint PGF is\n\n\\[G(s_1,\\ldots,s_d) = \\mathbb E\\!\\left[\\prod_{j=1}^{d}s_j^{X_j}\\right].\\]\n\nIts coefficients encode the joint distribution.\n\nSetting all variables except \\(s_i\\) equal to \\(1\\) yields the marginal PGF of \\(X_i\\). Setting every argument equal to \\(s\\) yields the PGF of \\(X_1+\\cdots+X_d\\), whether or not the variables are independent.\n\nMixed derivatives give mixed factorial moments. For distinct \\(i\\) and \\(j\\), with finite second moments,\n\n\\[\\operatorname{Cov}(X_i,X_j) = \\frac{\\partial^2G}{\\partial s_i\\partial s_j}(\\mathbf1) - \\frac{\\partial G}{\\partial s_i}(\\mathbf1) \\frac{\\partial G}{\\partial s_j}(\\mathbf1),\\]\n\nwhere boundary derivatives are interpreted as limits from within the domain.\n\nThe variables are mutually independent exactly when the joint PGF factors into their marginal PGFs."
    },
    {
      "heading": "Related transforms and limitations",
      "text": "The moment generating function\n\n\\[M_X(t)=\\mathbb E[e^{tX}]\\]\n\nis related to the PGF by\n\n\\[M_X(t)=G_X(e^t)\\]\n\nwhere the expectation is finite. A PGF is always finite on \\([0,1]\\), whereas \\(M_X(t)\\) need not be finite for any positive \\(t\\).\n\nThe characteristic function satisfies\n\n\\[\\varphi_X(t)=G_X(e^{it}),\\]\n\nand the Laplace transform satisfies\n\n\\[\\mathbb E[e^{-tX}]=G_X(e^{-t}), \\qquad t\\ge0.\\]\n\nThe ordinary PGF is tailored to nonnegative integer-valued variables. Variables with negative integer values generally require series with negative powers, while noninteger-valued variables are more naturally handled by other transforms.\n\nAlthough a PGF determines every probability, extracting high-order coefficients can be computationally difficult. Repeated numerical differentiation may be unstable; depending on the representation, coefficient recurrences, symbolic expansion, or Fourier-based methods may be preferable. Analytic continuation beyond the original disk of convergence also requires care: a continued function value need not equal a finite expectation \\(\\mathbb E[s^X]\\)."
    }
  ],
  "links": [
    "generating-function",
    "random-variable",
    "probability-distribution",
    "probability-mass-function",
    "expected-value",
    "complex-number",
    "power-series",
    "analytic-function",
    "discrete-fourier-transform",
    "variance",
    "bernoulli-distribution",
    "binomial-distribution",
    "binomial-theorem",
    "poisson-distribution",
    "geometric-series",
    "statistical-independence",
    "convolution",
    "function-composition",
    "conditional-probability",
    "fixed-point",
    "joint-probability-distribution",
    "laplace-transform"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}