Let $M \sim \operatorname{Geometric}(p)$ and $ X \vert M = m \sim $ Uniform discrete on {1,m}

51 Views Asked by At

Let $M \sim \operatorname{Geometric}(p)$ and $ X \vert M = m \sim $ Uniform discrete on {1,m}.

I want to find the density of X and then estimate the value of $p$ knowing one sample $X = x$.

If the density were continuous, I would do something like this:

$$ f_X = \int_{\text{over m}} f_M *f_{X \mid M = m}\,dm $$

However the densities are discrete so instead of the integral I have a summation.

This is what I found: $$ f_X(k) = \sum_{m=1}^{\infty} \frac{1}{m} p(1-p)^{m-1}\enspace (1<k<m)$$

First of all I am not so sure this is ok, so can someone check this result?

Then, how could I estimate the value of $p$ knowing the value of an output $x$?