I try to estimate the number of tracks in the city by observing their serial numbers. Assume that the serial numbers are drawn from a uniform probability density ranging from 0 to an unknown parameter $\theta$, as which I take the number of trucks in the city. I use maximum likelihood method to estimate the unknown parameter.
I observe L trucks, take their serial numbers(s1, s2, ...,sL) down. Assume the observation results are independent, the maximum likelihood estimation of $\theta$ is $\hat{\theta}$ = max{s1, s2,..., sL}.
To find estimator baised or not, I take expectation of $\hat{\theta}$. $$E(\hat{\theta})=\sum_{i=0}^\theta i\frac{(i+1)^L-i^L)}{(\theta+1)^L}$$ where $\frac{(i+1)^L-i^L)}{(\theta+1)^L}$ is the ditribution of estimator $\hat{\theta}$.
The problem is I can not find a closed form formula for the expectation. Anyone can hep?
For independent and identically distributed observations $\boldsymbol s = (s_1, \ldots, s_n)$ from a discrete uniform distribution $S$ on $\{1, 2, \ldots, \theta\}$, the estimator $$\hat \theta = \max_i s_i$$ has the probability mass function $$\begin{align*} \Pr[\hat \theta = x] &= \Pr[\hat \theta \le x] - \Pr[\hat \theta \le x-1] \\ &= \prod_{i=1}^n \Pr[S_i \le x] - \prod_{i=1}^n \Pr[S_i \le x-1] \\ &= \left(\frac{x}{\theta}\right)^n - \left(\frac{x-1}{\theta}\right)^n, \quad x \in \{1, 2, \ldots, \theta\}, \quad n \in \mathbb Z^+. \end{align*}$$
The expectation is then $$\begin{align*} \operatorname{E}[\hat\theta] &= \sum_{i=1}^\theta x \Pr[\hat \theta = x] \\ &= \theta^{-n} \sum_{x=1}^\theta x(x^n - (x-1)^n) \\ &= \theta^{-n} \sum_{x=1}^\theta x^{n+1} - \sum_{x=0}^{\theta-1} (x+1)x^n \\ &= \theta^{-n} \sum_{x=1}^\theta x^{n+1} - \sum_{x=0}^{\theta-1} x^{n+1} + x^n \\ &= \theta^{-n} \left( \theta^{n+1} - 0^{n+1} - \sum_{x=1}^{\theta-1} x^n \right) \\ &= \theta - \frac{H_{\theta-1,-n}}{\theta^n} \\ \end{align*}$$ where $H_{m,n} = \sum_{x=1}^m \frac{1}{x^n}$ is a generalized harmonic number. It is trivial to see that $\operatorname{E}[\hat \theta] < \theta$, since $$\frac{H_{\theta-1,-n}}{\theta^n} = \sum_{x=1}^{\theta-1} \left(\frac{x}{\theta}\right)^n$$ is clearly a finite sum of positive rationals.
It is worth noting that the above calculation is completely unnecessary to establish that $\hat theta$ is necessarily biased, since $$\Pr[\hat \theta > \theta] = 0,$$ yet $$\Pr[\hat \theta < \theta] > 0.$$