How to find a maximum likelihood estimator for a discrete parameter? Let $X=\{x_1,x_2,...x_m\}$ be a random variable with density $f(x)=cx^{2n}$ if  $-1\lt x\lt 1$, $0$ otherwise, and $n \in \{ 1,2,3,4\}$.
Find the MLE of $n$.
I tried to find the Likelihood  function  : $(n+1/2)^m\prod_{i=1}^mx_i^{2n}$ but I'm not sure.
Suggestions? Thanks
 A: This has a few tricky points, so let's work it out.  
First, we note that $2n$ is an even number, so the function that wants to be a density will be non-negative from that respect, as it should, even though the variable $X$ may take negative values.  
Second we need to determine the value of $c$ so that we have a proper density. We require
$$\int_{-1}^1 cx^{2n}dx =1 \implies \frac{c}{2n+1}x^{2n+1} \Big|^1_{-1} =1$$
and since $2n+1$ is an odd number, we get
$$\frac{c}{2n+1}[1-(-1)] =1 \implies c= n+1/2$$
...as already noted in the comments.
Therefore
$$ f_X(x) = (n+1/2)x^{2n}, \;\;\; -1<x<1$$
and the likelihood function from an i.i.d. sample is ($I\{\}$ being the indicator function)
$$L = I_{\{-1<x<1\}}\cdot (n+1/2)^m\prod_{i=1}^mx_i^{2n} $$
We usually consider the log-likelihood for various beneficial reasons, but here, if we take logarithms we will be looking at $\ln x_i$ which is not defined if $x_i\leq 0$. But if one attempted to maximize the likelihood directly to avoid taking logs it would again hit on the same problem -the logarithm of the $x$-values would again appear if we considered the derivative with respect to $n$.
But since $x_i^{2n}$ is non-negative, we can write
$$L = I_{\{-1<x<1\}}\cdot (n+1/2)^m\prod_{i=1}^m|x_i|^{2n} $$
$$\implies\ln L = \ln \left(I_{\{-1<x<1\}}\right) + m\ln(n+1/2)+2n\sum_{i=1}^m\ln|x_i|$$
..which leaves us only with the problem of obtaining a realized value $x_i=0$ exactly. Well, from a theoretic point of view we invoke the zero-probability of a continuous r.v. taking a specific value, while from an applied point of view, if our sample contains an exact zero value, we can just discard it.
While  this log-likelihood is strictly concave in $n$ and has a straightforward f.o.c 
$$\frac{\partial \ln L}{\partial n} = \frac {m}{n+1/2} + 2\sum_{i=1}^m\ln|x_i|$$
$$\implies  \hat n = \frac {m}{-2\sum_{i=1}^m\ln|x_i|} - \frac 12$$
...we have just ignored the restrictions on the values of $n$. This is a discrete-optimization problem. Nothing guarantees that the above expression will give an integer, or that it will fall in between $1$ and $4$.
After a little thinking, instead of considering derivatives etc as usual and dance around $\hat n$,  it would be simpler to evaluate the log-likelihood at the four possible values of $n$ and see for which  it attains the highest value.
