# Show that the largest obervation from a discrete uniform distribution is complete and sufficient

Consider a random sample of size $n$ from a population with pmf $P(X=x)=\frac{1}{\theta}$ for $x\in \{1,2,..., \theta\}$. I need to show that $Y=X_{(n)}$ is complete sufficient where $X_{(n)}$ is the largest order statistic.

$P(Y=y)=P(Y \le y)- P(Y \le y-1) = P(X \le y)^n - P(X \le y-1)^n = \left( \frac{y}{\theta} \right)^n - \left( \frac{y-1}{\theta} \right)^n = \dfrac{y^n - (y-1)^n}{\theta ^n}$.

Also the sample pmf is $P(\mathbf X=\mathbf x) = \dfrac{1}{\theta ^n}$ and since $\frac{P(\mathbf X=\mathbf x) }{P(Y=y)}$ is independent of $\theta$ then this means that $Y$ is sufficient for $\theta$.

Now to show that if $Y$ is complete then for any measurable function $g(y)$ such that $Eg(y)=0$ for any $\theta$ implys that $g=0$ almost surely.

$0= Eg(y) = \sum_{y=1}^{\theta}g(y)\frac{1}{\theta ^n}(y^n - (y-1)^n )\Rightarrow \sum_{y=1}^{\theta}g(y)(y^n - (y-1)^n)=0$ . If we let $g(1)=1$ and $g(2)=-\frac{1}{2^n-1}$ and $g(y)=0$ for each $y\ge 3$ then the $Eg(y)=0$ but $g$ is not $0$ almost surely. So this would mean that $Y$ is not complete but Im assuming im doing something wrong here since the problem is telling me that $Y$ is complete and that I need to show that. Any help is appreciated

In your example, $E(g(Y))\ne 0$ for $\theta = 1.$
If $E(g(Y)) =0$ then we have $$\frac{1}{\theta^n}\sum_{i=1}^\theta g(y)(y^n-(y-1)^n)=0.$$ If this is true for all $\theta,$ then the $\theta=1$ case implies $g(1) = 0.$ Then do the $\theta=2$ case, etc.
• I dont see how my example doesnt work. If $\theta =1$ then we have $\sum_{i=1}^\theta g(y)(y^n-(y-1)^n)=0$. If we let $g(1)=1$ and $g(2)=−\frac{1}{2^n−1}$ and $g(y)=0$ for each $y \ge 3$ then $\sum_{i=1}^\theta g(y)(y^n-(y-1)^n)=1+(−\frac{1}{2^n−1})(2^n−1)+0+0+...+0=1-1=0$. Am I missing something? – alpastor Mar 5 '17 at 0:33
• @n.e. if $\theta = 1$ then $y$ can't be $2$ and there is only one term in the sum. You have $E(g(Y)) = g(1) = 1.$ – spaceisdarkgreen Mar 5 '17 at 0:38
• @n.e. No prob. You took the support into account when you wrote the sum defining the expectation value down correctly. For $\theta = 1$ it reads $0 = \sum_{i=1}^1g(y)(y^n-y^{n-1}) = g(1)$ – spaceisdarkgreen Mar 5 '17 at 0:44