Tutorials › VEE Mathematical Statistics › MGFs of Discrete Uniform and Hypergeometric Variables

VEE Mathematical Statistics · Moment Generating Functions · Tutorial 229 of 880

MGFs of Discrete Uniform and Hypergeometric Variables

Learn to build and evaluate MGFs by listing the possible values of each variable and weighting their exponentials by the correct probabilities.

Intermediate 10 min read

What You'll Learn

  • Write the MGF of a discrete uniform variable on consecutive integer values as a finite sum.
  • Determine the support and equal probabilities of a discrete uniform variable.
  • Determine the feasible support of a hypergeometric count from population and sample constraints.
  • Construct a hypergeometric MGF using its combinatorial probability weights.
  • Evaluate finite-sum MGFs at specified arguments and check the probability weights.
  • Avoid replacing sampling without replacement by an independent-draw model.

MGFs as Weighted Sums

For a random variable with a finite set of possible values, an MGF is a finite weighted sum: each possible value contributes an exponential term, weighted by the probability of that value. The main work is therefore to identify the support correctly and attach the right probabilities. This is especially important for a hypergeometric count, where the number of successes is constrained by sampling without replacement.

Definition: If \(X\) has finite support \(\mathcal{S}\), with \(P(X=x)=p_x\) for each \(x\in\mathcal{S}\), its moment generating function is $$ M_X(t)=E[e^{tX}]=\sum_{x\in\mathcal{S}} e^{tx}p_x. $$ Because the support is finite, this sum is finite for every real \(t\). At \(t=0\), \(M_X(0)=\sum_{x\in\mathcal{S}}p_x=1\).

This expression follows directly from the definition of expectation for a discrete random variable: the expected value of a function \(g(X)\) is \(\sum_x g(x)P(X=x)\). Taking \(g(x)=e^{tx}\) gives the MGF formula. The exponential is evaluated at each possible value; it is not evaluated at the mean of \(X\).

MGFs can encode moments through derivatives at zero, as established in the earlier material on MGFs. Here the focus is constructing the weighted sum correctly, not differentiating it.

Discrete Uniform Variables

A discrete uniform variable on consecutive integers assigns equal probability to every integer in its support. Let \(X\) be uniform on \(\{a,a+1,\ldots,b\}\), where \(a\) and \(b\) are integers with \(a\le b\). There are \(b-a+1\) possible values, each with probability \(1/(b-a+1)\).

Theorem: For \(X\) uniform on the integers from \(a\) through \(b\), inclusive, $$ M_X(t)=\frac{1}{b-a+1}\sum_{x=a}^{b}e^{tx}. $$ The finite-sum form applies for every real \(t\), including \(t=0\).

The endpoints matter: a uniform distribution on \(\{2,3,4,5,6\}\) has five outcomes, not six. A useful check is that setting \(t=0\) makes every exponential term equal to one, so the sum has exactly as many terms as there are support points and the MGF equals one.

Worked Example: A Discrete Uniform MGF at a Logarithmic Argument

A hypothetical audit selects one integer \(X\) uniformly from \(\{2,3,4,5,6\}\). Find \(M_X(t)\) as a finite sum and evaluate it at \(t=\ln 2\). State the method and check the result.

Method. List the five support points, assign probability \(1/5\) to each, and substitute into the weighted-sum definition. The argument \(t=\ln 2\) makes \(e^{tx}=2^x\).

The MGF for general \(t\) is $$ M_X(t)=\frac{1}{5}\left(e^{2t}+e^{3t}+e^{4t}+e^{5t}+e^{6t}\right). $$

At \(t=\ln 2\), evaluate each term using \(e^{x\ln 2}=2^x\): $$ M_X(\ln 2)=\frac{1}{5}(2^2+2^3+2^4+2^5+2^6) =\frac{1}{5}(4+8+16+32+64) =\frac{124}{5}=24.8. $$

Check. The probabilities sum to \(5(1/5)=1\), so the same finite-sum formula gives \(M_X(0)=1\). The value at \(\ln 2\) exceeds one, as expected because every possible \(X\) is positive and therefore \(2^X>1\). The common mistake avoided is counting six outcomes because the endpoint labels run from 2 to 6; there are five integers in that inclusive range.

Hypergeometric Variables

A hypergeometric variable counts successes when a fixed-size sample is drawn without replacement from a finite population. Let the population contain \(N\) objects, of which \(K\) are classified as successes and \(N-K\) as failures. Draw \(n\) objects, with every size-\(n\) subset equally likely, and let \(X\) be the number of successes drawn. The model requires integer parameters satisfying \(0\le K\le N\) and \(0\le n\le N\).

The support is determined by both the number of successes available and the number of failures available. The count cannot be negative or exceed either the number of successes in the population or the sample size. Also, at most \(N-K\) failures can be drawn, so at least \(n-(N-K)\) successes must be drawn when that quantity is positive.

Definition: Under the sampling model above, \(X\) has a hypergeometric distribution with population size \(N\), \(K\) successes, and sample size \(n\). Its support is $$ \mathcal{S}=\{\max(0,n-(N-K)),\ldots,\min(n,K)\}, $$ and for each integer \(x\in\mathcal{S}\), $$ P(X=x)=\frac{\binom{K}{x}\binom{N-K}{n-x}}{\binom{N}{n}}. $$ The numerator counts samples containing \(x\) successes and \(n-x\) failures. The denominator counts all possible samples of size \(n\).

Substituting these probabilities into the finite-support MGF definition gives the hypergeometric MGF:

$$ M_X(t)=\sum_{x=\max(0,n-(N-K))}^{\min(n,K)} e^{tx}\frac{\binom{K}{x}\binom{N-K}{n-x}}{\binom{N}{n}}. $$

This finite weighted sum is the standard expression to use. The support limits exclude impossible counts, and the combinatorial factor gives each feasible count its probability. The probabilities must sum to one because every possible sample of size \(n\) contains some feasible number of successes.

Worked Example: Three Draws Without Replacement

A hypothetical inspection lot contains 10 components, 4 of which have a specified feature. Three components are selected uniformly without replacement. Let \(X\) be the number with the feature. Find the MGF as a finite weighted sum and evaluate \(M_X(\ln 2)\).

Method. This is a hypergeometric model with \(N=10\), \(K=4\), and \(n=3\). The support starts at \(\max(0,3-6)=0\) and ends at \(\min(3,4)=3\). The total number of samples is \(\binom{10}{3}=120\).

For \(x=0,1,2,3\), the numbers of samples producing each count are: $$ \begin{aligned} x=0:&\quad \binom{4}{0}\binom{6}{3}=1(20)=20,\\ x=1:&\quad \binom{4}{1}\binom{6}{2}=4(15)=60,\\ x=2:&\quad \binom{4}{2}\binom{6}{1}=6(6)=36,\\ x=3:&\quad \binom{4}{3}\binom{6}{0}=4(1)=4. \end{aligned} $$

Dividing by 120 gives probabilities \(1/6,\ 1/2,\ 3/10,\ 1/30\), respectively. Thus $$ M_X(t)=\frac{1}{6}+\frac{1}{2}e^t+\frac{3}{10}e^{2t}+\frac{1}{30}e^{3t}. $$

Since \(e^{\ln 2}=2\), $$ M_X(\ln 2)=\frac{1}{6}+\frac{1}{2}(2)+\frac{3}{10}(4)+\frac{1}{30}(8) =\frac{5}{30}+\frac{30}{30}+\frac{36}{30}+\frac{8}{30} =\frac{79}{30}\approx 2.6333. $$

Check. The probabilities add to \((5+15+9+1)/30=1\). The common mistake avoided is treating the three draws as independent. That incorrect binomial model would give \((0.6+0.4e^t)^3\), and at \(t=\ln 2\) it gives \(1.4^3=2.744\), not the hypergeometric value \(79/30\). Without replacement, the draws are dependent.

When the Support Does Not Start at Zero

A frequent support error occurs when the sample is so large that it is impossible to draw only failures. In that case the hypergeometric variable has a positive minimum. The lower support bound is not merely a technical detail: omitting it can add impossible outcomes and omit probability mass from the actual distribution.

Worked Example: A Forced Minimum Number of Successes

A hypothetical shipment contains 12 devices, 5 of which are marked for a particular review. A review team selects 9 devices without replacement. Let \(X\) be the number marked. Find the support and MGF, then evaluate \(M_X(\ln 2)\).

Method. Here \(N=12\), \(K=5\), and \(n=9\). There are only \(N-K=7\) unmarked devices, so a selection of 9 must include at least \(9-7=2\) marked devices. The maximum is \(\min(9,5)=5\). Thus the support is \(\{2,3,4,5\}\), and the total number of samples is \(\binom{12}{9}=\binom{12}{3}=220\).

The numbers of samples for the feasible counts are $$ \begin{aligned} x=2:&\quad \binom{5}{2}\binom{7}{7}=10,\\ x=3:&\quad \binom{5}{3}\binom{7}{6}=10(7)=70,\\ x=4:&\quad \binom{5}{4}\binom{7}{5}=5(21)=105,\\ x=5:&\quad \binom{5}{5}\binom{7}{4}=1(35)=35. \end{aligned} $$

The corresponding probabilities are \(10/220,\ 70/220,\ 105/220,\ 35/220\), which simplify to \(1/22,\ 7/22,\ 21/44,\ 7/44\). Therefore $$ M_X(t)=\frac{1}{22}e^{2t}+\frac{7}{22}e^{3t}+\frac{21}{44}e^{4t}+\frac{7}{44}e^{5t}. $$

At \(t=\ln 2\), the exponential weights are \(4,8,16,32\): $$ M_X(\ln 2) =\frac{4}{22}+\frac{56}{22}+\frac{336}{44}+\frac{224}{44} =\frac{2}{11}+\frac{28}{11}+\frac{84}{11}+\frac{56}{11} =\frac{170}{11}\approx 15.4545. $$

Check. The probabilities total \(2/44+14/44+21/44+7/44=1\). The lower support value is 2 because the team cannot select 9 devices from a population containing only 7 unmarked devices without selecting at least 2 marked ones. Starting the sum at zero would include impossible counts.

Practical Checks and Exam Traps

A finite sum is manageable when its support and weights are correct. Before evaluating an MGF, check the model and the endpoints rather than jumping directly to exponentiation.

  • For a discrete uniform variable, count the integers inclusively. On \(\{a,\ldots,b\}\), there are \(b-a+1\) values.
  • For a hypergeometric variable, use the actual sample design. A fixed-size sample without replacement requires the hypergeometric weights, not independent Bernoulli probabilities.
  • Check both support bounds. The minimum may be positive, and the maximum may be less than the sample size.
  • Check the weights. Their sum must be one, so the resulting MGF must satisfy \(M_X(0)=1\).
  • Substitute the argument carefully. When \(t=\ln c\), \(e^{tx}=c^x\), not \(cx\).

These models are useful in finite-population settings. For example, a count of selected items with a specified attribute is naturally hypergeometric when the selection is made without replacement. Using the correct MGF preserves the dependence implied by that design.

Key takeaway: For a finite discrete distribution, \(M_X(t)\) is the sum of \(e^{tx}\) times the probability at \(x\). A discrete uniform variable uses equal weights; a hypergeometric variable uses combinatorial weights over its feasible support.

Check Your Understanding

For each problem, identify the support and probability weights before evaluating the requested MGF.

  1. A value is selected uniformly from \(\{0,1,2,3\}\). Write the finite-sum MGF and evaluate it at \(t=\ln 3\). (Answer: \(M_X(t)=(1+e^t+e^{2t}+e^{3t})/4\); \(M_X(\ln 3)=10\).)
  2. A value is selected uniformly from \(\{4,6,8\}\). Evaluate its MGF at \(t=\ln(1/2)\). (Answer: \(M_X(\ln(1/2))=7/256\).)
  3. A population has 9 objects, 3 of them successes. Two are drawn without replacement. Find the support and evaluate the MGF of the success count at \(t=\ln 2\). (Answer: support \(\{0,1,2\}\); probabilities \(5/12,1/2,1/12\); \(M_X(\ln 2)=7/4\).)
  4. A population contains 11 items, 4 of them flagged. Eight are drawn without replacement. Find the feasible support and evaluate the MGF of the flagged count at \(t=\ln 2\). (Answer: support \(\{1,2,3,4\}\); probabilities \(4/165,42/165,84/165,35/165\); \(M_X(\ln 2)=1408/165\).)
  5. In general, a sample of size \(n\) is drawn without replacement from \(N\) objects, \(K\) of which are successes. State the support and finite-sum MGF of the success count. (Answer: support \(\{\max(0,n-(N-K)),\ldots,\min(n,K)\}\); \(M_X(t)=\sum_x e^{tx}\binom{K}{x}\binom{N-K}{n-x}/\binom{N}{n}\), summed over that support.)
Clinical Biostats