Tutorials › VEE Mathematical Statistics › Discrete Uniform Estimation From The Sample Mean

VEE Mathematical Statistics · Estimators and Moments Methods · Tutorial 447 of 880

Discrete Uniform Estimation From The Sample Mean

Match the sample mean to the discrete uniform population mean, then check whether the resulting endpoint is an integer that can contain the observed data.

Intermediate 11 min read

What You'll Learn

  • State the discrete uniform model and its sampling assumptions.
  • Derive the population mean for the integers from one through an unknown endpoint.
  • Calculate the method-of-moments endpoint estimate from a sample mean.
  • Check whether the raw estimate is an integer and whether it is at least the sample maximum.
  • Distinguish an exact moment solution from a rounded, feasible integer adjustment.
  • Explain why sample means need not produce admissible integer endpoints.

Model and Estimation Goal

Suppose observations are sampled from a discrete uniform distribution on the consecutive integers \(1,2,\ldots,N\), where the upper endpoint \(N\) is unknown. The endpoint is restricted to a positive integer. This support condition matters: a numerical estimate such as \(6.2\) may solve a moment equation, but it cannot itself be the endpoint of this model.

Definition: The model is \(P(X=k)=1/N\) for \(k=1,2,\ldots,N\), and \(P(X=k)=0\) otherwise, where \(N\) is a positive integer. Assume \(X_1,\ldots,X_n\) are an independent, identically distributed sample from this model. The sample mean is \(\bar X=\frac{1}{n}\sum_{j=1}^n X_j\), and the sample maximum is \(X_{(n)}=\max(X_1,\ldots,X_n)\).

The method of moments equates a population moment to the corresponding sample moment and solves for the unknown parameter. For this one-parameter model, the first raw moment—the population mean—is enough to form an estimate. The resulting equation has a simple solution, but interpreting that solution requires a separate check of the integer parameter space and the observed data.

Deriving the Mean-Based Estimate

Each integer in the support has probability \(1/N\). Therefore, the population mean is the average of the integers from \(1\) through \(N\):

$$ E[X] =\sum_{k=1}^{N} kP(X=k) =\frac{1}{N}\sum_{k=1}^{N}k =\frac{1}{N}\frac{N(N+1)}{2} =\frac{N+1}{2}. $$

The sum formula follows by pairing terms: \(1+N\), \(2+(N-1)\), and so on each sum to \(N+1\); equivalently, the arithmetic sequence has \(N\) terms and average \((1+N)/2\). The sample first raw moment is \(\bar X\). Equating these moments gives

$$ \bar X=\frac{N+1}{2} \qquad\Longrightarrow\qquad \widetilde N_{\mathrm{MM}}=2\bar X-1. $$

The tilde emphasizes that this is initially a real-valued moment solution. Because a sample mean can be noninteger, the raw solution need not be an allowed endpoint. In addition, any endpoint consistent with the observed sample must be at least as large as the largest observation.

Key result: The raw method-of-moments estimate is \(\widetilde N_{\mathrm{MM}}=2\bar X-1\). It is an exact, admissible integer solution only if it is a positive integer and \(\widetilde N_{\mathrm{MM}}\ge X_{(n)}\). The second condition is required because every sampled value must lie in \(\{1,\ldots,N\}\).

Here, “admissible integer” means a value allowed by this model’s parameter space and support. It does not refer to the separate decision-theory meaning of admissibility. Since every observation is at least one, \(\bar X\ge1\) and the raw estimate is at least one; in practice, the key checks are integrality and whether the estimate reaches the sample maximum.

Worked Examples

Worked Example: A Noninteger Moment Solution That Can Be Rounded Feasibly

A quality-control analyst records the numbers of calibration marks found on five randomly selected, independent gauges. The counts are \(2,4,3,5,4\). Assume each count follows the discrete uniform model on \(1,\ldots,N\), with the same unknown positive integer \(N\). Find the raw moment estimate and assess an integer estimate.

Method. Calculate the sample mean, equate it to \((N+1)/2\), and then check the result against both integer validity and the observed maximum.

Step 1: Calculate the sample mean. The sample size is \(n=5\), and the sum is \(2+4+3+5+4=18\). Thus

$$ \bar X=\frac{18}{5}=3.6. $$

Step 2: Solve the moment equation.

$$ \widetilde N_{\mathrm{MM}}=2(3.6)-1=7.2-1=6.2. $$

The raw estimate is not an integer, so it is not an exact admissible endpoint. The largest observation is \(X_{(n)}=5\). If an integer-valued estimate is wanted, the nearest integer to \(6.2\) is \(6\), which is at least \(5\) and is therefore feasible as an endpoint.

This rounding is an adjustment, not an exact solution to the method-of-moments equation. At \(N=6\), the model mean is \((6+1)/2=3.5\), which differs from the observed mean \(3.6\) by \(0.1\). Check: endpoint \(6\) includes every observed count, but it does not make the sample mean equal the model mean.

Common mistake avoided: Do not report \(6.2\) as a valid upper integer endpoint. If asked for a rounded integer estimate, identify it as rounded and still verify that it is no smaller than the sample maximum.

Worked Example: An Exact and Feasible Integer Solution

A laboratory records the numbers of usable readings from six independent test panels: \(1,2,3,4,5,3\). Assume the readings follow the stated discrete uniform model with unknown positive integer endpoint \(N\). Determine whether the mean-based estimate is exact and admissible.

Method. Use the first-moment equation, then check both the integer restriction and the support bound from the data.

Step 1: Calculate the sample mean. There are \(n=6\) observations, and their sum is \(1+2+3+4+5+3=18\). Hence

$$ \bar X=\frac{18}{6}=3. $$

Step 2: Apply the moment formula.

$$ \widetilde N_{\mathrm{MM}}=2(3)-1=5. $$

This is an integer. The largest observation is \(X_{(n)}=5\), so the estimate also satisfies \(N\ge X_{(n)}\). Thus \(N=5\) is an exact, admissible integer solution to the first-moment equation. Check: the model mean at \(N=5\) is \((5+1)/2=3\), exactly the sample mean.

Common mistake avoided: Checking only that the estimate is an integer is not enough. If the sample had contained a value greater than \(5\), this endpoint would not have supported the observations, even though the moment equation still produced the integer \(5\).

Worked Example: The Raw Estimate Falls Below the Observed Maximum

An auditor records the numbers of flagged records in four independently sampled batches: \(1,1,1,8\). Suppose each count is modeled as discrete uniform on \(1,\ldots,N\), with a common unknown positive integer endpoint. Find the raw estimate and the nearest feasible integer adjustment.

Method. First solve the unrestricted moment equation. Then impose the necessary support condition \(N\ge X_{(n)}\) before choosing any integer adjustment.

Step 1: Calculate the sample mean. The sample size is \(4\), the sum is \(1+1+1+8=11\), and therefore

$$ \bar X=\frac{11}{4}=2.75. $$

Step 2: Find the raw moment solution.

$$ \widetilde N_{\mathrm{MM}}=2(2.75)-1=5.5-1=4.5. $$

The raw solution is not an integer. More importantly, \(X_{(n)}=8\), so any endpoint that can contain the observed sample must satisfy \(N\ge8\). Rounding \(4.5\) to \(5\) would still give an impossible endpoint because the observation \(8\) would lie outside its support.

Among feasible integers \(8,9,10,\ldots\), the one closest to \(4.5\) is \(8\). Thus \(8\) is the nearest feasible integer adjustment, but it is not an exact moment solution: its model mean is \((8+1)/2=4.5\), not \(2.75\). Check: endpoint \(8\) includes all four observations, while the raw mean equation remains unmatched.

Common mistake avoided: Rounding before checking the sample maximum can produce an integer that is still impossible for the observed data. The support check must come before calling a rounded value feasible.

Exact Solutions, Rounding, and Feasibility

It is useful to separate three questions that can otherwise be confused:

  1. What does the moment equation give? It gives the real-valued quantity \(2\bar X-1\).
  2. Does that quantity solve the model exactly? Only if it is an integer, since the parameter \(N\) must be an integer.
  3. Can that endpoint contain the observed sample? Only if \(N\ge X_{(n)}\).

The possible endpoints consistent with the sample’s support are the integers \(X_{(n)},X_{(n)}+1,\ldots\). This condition does not say that every such endpoint matches the sample mean; it says only that none of the observations is outside the model’s support. Thus a fractional moment solution may have feasible integer candidates nearby, while an integer moment solution can still fail the support check.

If a problem specifically asks for a practical integer adjustment, one transparent convention is to choose the feasible integer closest to the raw estimate. Let \(q=2\bar X-1\) and \(M=X_{(n)}\). Rounding to the nearest integer, with half-way cases rounded upward, and enforcing the support bound gives

$$ \widehat N_{\mathrm{adj}} =\max\!\left(M,\left\lfloor q+\frac12\right\rfloor\right). $$

This formula describes a constrained rounding rule; it is not a new exact moment equation. If the task gives a different rule for choosing among integers, follow that rule. If it asks whether the method-of-moments estimate itself is an admissible integer, report the raw value and state whether it passes both checks rather than silently replacing it with a rounded value.

1
Compute the sample mean.
Add all observations and divide by the sample size.
2
Use the population mean.
For the model on \(1,\ldots,N\), equate \(\bar X\) to \((N+1)/2\) and solve \(q=2\bar X-1\).
3
Check integer validity.
If \(q\) is not an integer, it is not an exact parameter value.
4
Check support feasibility.
Any endpoint proposed for the observed sample must be at least \(X_{(n)}\).
5
Label any adjustment.
If rounding or constraining the estimate, state the rule and do not present the adjusted value as an exact moment solution.

Why the Checks Matter

The population mean is a theoretical expectation, while the sample mean varies from sample to sample. Equating them is the moment-matching rule, not a claim that every observed sample mean must equal its population mean. That distinction explains why \(2\bar X-1\) can be fractional or can fall below the largest observation. Such outcomes do not change the algebra; they signal that the raw moment solution should not be mistaken for a valid endpoint without further qualification.

A frequent exam trap is to use the formula for a continuous uniform distribution instead. The mean of a continuous uniform distribution on an interval depends on the two interval endpoints, whereas this model assigns equal probabilities to the \(N\) integers from \(1\) through \(N\). Here the first and last support values are \(1\) and \(N\), and their average is \((N+1)/2\), not \(N/2\).

Key takeaway: For an independent sample from the discrete uniform model on \(1,\ldots,N\), the first-moment solution is \(2\bar X-1\). Call it an exact admissible endpoint only when it is an integer and is at least the observed sample maximum. Rounding may create a useful feasible estimate, but it does not turn a noninteger moment solution into an exact one.

Check Your Understanding

For each sample, calculate the raw moment estimate and decide whether it is an exact admissible integer. If needed, give the nearest feasible integer adjustment.

  1. A sample of four readings is \(1,3,2,4\). Find the mean, the raw endpoint estimate, and assess the endpoint against the sample maximum. (Answer: \(\bar X=2.5\), raw estimate \(4\); exact and admissible because the maximum is \(4\).)
  2. Five batch counts are \(2,2,5,3,4\). Find the raw estimate and state whether it is an exact admissible integer. (Answer: \(\bar X=16/5=3.2\), raw estimate \(5.4\); not an integer, so no exact integer solution; nearest feasible integer adjustment is \(5\), which equals the sample maximum.)
  3. Six observations are \(1,2,2,3,4,4\). Compute the mean-based estimate and the nearest feasible integer adjustment. (Answer: sum \(16\), \(\bar X=16/6=8/3\), raw estimate \(13/3\); no exact integer solution; nearest feasible integer is \(4\), equal to the sample maximum.)
  4. Four observed counts are \(1,1,2,9\). Calculate the raw estimate, check it against the maximum, and give the nearest feasible integer adjustment. (Answer: sum \(13\), \(\bar X=13/4=3.25\), raw estimate \(5.5\); it is noninteger and below the maximum \(9\); nearest feasible integer adjustment is \(9\).)
  5. Five measurements are \(2,3,3,4,6\). Determine whether rounding the raw estimate to the nearest integer gives a feasible endpoint, and check the model mean at that endpoint. (Answer: sum \(18\), \(\bar X=3.6\), raw estimate \(6.2\); rounded endpoint \(6\) is feasible since the maximum is \(6\), and its model mean is \(3.5\), so it is not an exact moment match.)
Clinical Biostats