# Finding bias of $\hat\theta=\max\{x_1,\ldots,x_k\}$ where $x_i$'s are discrete uniform

I am working through some textbook problems and came across a problem I am having difficulty with. The problem asks to give the bias of a point estimate, namely for a given set of data $$X = \{x_1, x_2,\ldots,x_n\}$$ drawn from a discrete $$\text{Uniform}\{0,1,\ldots, k\}$$, what is the bias of the estimator $$\hat\theta = \max(X)$$?

I'm pretty sure I have a representation for $$E[\hat\theta]$$, namely:

$$E[\hat\theta] = \sum_{i=0}^{n-1} \left(\frac{k-1}{k}\right)^{ni} \left(1-\left(\frac{k-1}{k}\right)^n\right)(k-i)\\ \hspace{.91cm} = \left(1-\left(\frac{k-1}{k}\right)^n\right)\sum_{i=0}^{n-1} \left(\frac{k-1}{k}\right)^{ni} (k-i)$$

The first term represents the probability that the numbers larger than $$k-i$$ have not been drawn, while $$1 - (\frac{k-1}{k})^n$$ represents the probability of any number in the range being drawn. Thus, those terms together represent the probability that $$k-i$$ is the largest number in the sample. However, to measure the bias, I need to simplify the summation as bias is $$E[\hat\theta] - k$$, but I am a bit unsure how to simplify the summation.

• Could you clarify what you mean by "Uniform$(0,k)$"? Is is a discrete uniform distribution on the integers $\{0,1,\ldots, k\}$ or a continuous uniform distribution on the interval $[0,k]$? – whuber Jun 8 at 23:17
• It is discrete, sorry about that. – user9933193 Jun 9 at 5:14
• Please edit the information into your question. – Glen_b Jun 9 at 6:27

Let $$X_1,\dots,X_n$$ be a random sample from a discrete uniform distribution $$\text{U}\{0,1,\dots,\kappa\}$$. Let $$\hat{\kappa}=\max\{X_1,\dots,X_n\}$$. Then (Why? Work out the details), $$\text{E}[\hat{\kappa}] = \sum_{m=0}^{\kappa-1} \Pr\{\hat{\kappa}>m\} = \sum_{m=0}^{\kappa-1} \left( 1 - \left(\frac{m+1}{\kappa+1}\right)^n\right) = \kappa - \frac{1}{(\kappa+1)^n} \sum_{m=1}^\kappa m^n,$$ in which $$\sum_{m=1}^\kappa m^n$$ can be written as a polynomial in $$\kappa$$ (if you want an explicit formula which involves Bernoulli numbers). Subtract $$\kappa$$ from $$\text{E}[\hat{\kappa}]$$ to get the bias of $$\hat{\kappa}$$.
kappa <- 10